public class DefaultFileHashCache extends Object implements ProjectFileHashCache
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultFileHashCache(ProjectFilesystem projectFilesystem,
java.util.function.Predicate<Path> ignoredPredicate,
FileHashCacheMode fileHashCacheMode) |
| Modifier and Type | Method and Description |
|---|---|
static DefaultFileHashCache |
createBuckOutFileHashCache(ProjectFilesystem projectFilesystem,
FileHashCacheMode fileHashCacheMode) |
static DefaultFileHashCache |
createDefaultFileHashCache(ProjectFilesystem projectFilesystem,
FileHashCacheMode fileHashCacheMode) |
static com.google.common.collect.ImmutableList<? extends ProjectFileHashCache> |
createOsRootDirectoriesCaches(ProjectFilesystemFactory projectFilesystemFactory,
FileHashCacheMode fileHashCacheMode) |
java.util.stream.Stream<Map.Entry<Path,com.google.common.hash.HashCode>> |
debugDump() |
com.google.common.hash.HashCode |
get(Path relativePath) |
protected static java.util.function.Predicate<Path> |
getDefaultPathPredicate(ProjectFilesystem projectFilesystem)
This predicate matches files that might be result of builds or files that are explicitly
ignored.
|
ProjectFilesystem |
getFilesystem() |
com.google.common.hash.HashCode |
getForArchiveMember(Path relativeArchivePath,
Path memberPath) |
Optional<com.google.common.hash.HashCode> |
getIfPresent(Path relativePath) |
long |
getSize(Path relativePath) |
List<AbstractBuckEvent> |
getStatsEvents() |
void |
invalidate(Path relativePath) |
void |
invalidateAll() |
boolean |
isIgnored(Path path) |
void |
set(Path relativePath,
com.google.common.hash.HashCode hashCode) |
FileHashCache.FileHashCacheVerificationResult |
verify() |
boolean |
willGet(ArchiveMemberPath archiveMemberPath) |
boolean |
willGet(Path relativePath) |
protected DefaultFileHashCache(ProjectFilesystem projectFilesystem, java.util.function.Predicate<Path> ignoredPredicate, FileHashCacheMode fileHashCacheMode)
public static DefaultFileHashCache createBuckOutFileHashCache(ProjectFilesystem projectFilesystem, FileHashCacheMode fileHashCacheMode)
public static DefaultFileHashCache createDefaultFileHashCache(ProjectFilesystem projectFilesystem, FileHashCacheMode fileHashCacheMode)
protected static java.util.function.Predicate<Path> getDefaultPathPredicate(ProjectFilesystem projectFilesystem)
public static com.google.common.collect.ImmutableList<? extends ProjectFileHashCache> createOsRootDirectoriesCaches(ProjectFilesystemFactory projectFilesystemFactory, FileHashCacheMode fileHashCacheMode)
public boolean willGet(Path relativePath)
willGet in interface ProjectFileHashCachepublic boolean isIgnored(Path path)
isIgnored in interface ProjectFileHashCachepublic boolean willGet(ArchiveMemberPath archiveMemberPath)
willGet in interface ProjectFileHashCachepublic void invalidate(Path relativePath)
invalidate in interface ProjectFileHashCachepublic void invalidateAll()
invalidateAll in interface ProjectFileHashCachepublic com.google.common.hash.HashCode get(Path relativePath) throws IOException
get in interface ProjectFileHashLoaderHashCode of the contents of path.IOExceptionpublic long getSize(Path relativePath) throws IOException
getSize in interface ProjectFileHashLoaderIOExceptionpublic Optional<com.google.common.hash.HashCode> getIfPresent(Path relativePath)
getIfPresent in interface ProjectFileHashLoaderpublic com.google.common.hash.HashCode getForArchiveMember(Path relativeArchivePath, Path memberPath) throws IOException
getForArchiveMember in interface ProjectFileHashLoaderIOExceptionpublic ProjectFilesystem getFilesystem()
getFilesystem in interface ProjectFileHashCachepublic void set(Path relativePath, com.google.common.hash.HashCode hashCode)
set in interface ProjectFileHashCachepublic FileHashCache.FileHashCacheVerificationResult verify() throws IOException
verify in interface ProjectFileHashCacheIOExceptionpublic java.util.stream.Stream<Map.Entry<Path,com.google.common.hash.HashCode>> debugDump()
debugDump in interface ProjectFileHashCachepublic List<AbstractBuckEvent> getStatsEvents()