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 ProjectFileHashCache
public boolean isIgnored(Path path)
isIgnored
in interface ProjectFileHashCache
public boolean willGet(ArchiveMemberPath archiveMemberPath)
willGet
in interface ProjectFileHashCache
public void invalidate(Path relativePath)
invalidate
in interface ProjectFileHashCache
public void invalidateAll()
invalidateAll
in interface ProjectFileHashCache
public com.google.common.hash.HashCode get(Path relativePath) throws IOException
get
in interface ProjectFileHashLoader
HashCode
of the contents of path.IOException
public long getSize(Path relativePath) throws IOException
getSize
in interface ProjectFileHashLoader
IOException
public Optional<com.google.common.hash.HashCode> getIfPresent(Path relativePath)
getIfPresent
in interface ProjectFileHashLoader
public com.google.common.hash.HashCode getForArchiveMember(Path relativeArchivePath, Path memberPath) throws IOException
getForArchiveMember
in interface ProjectFileHashLoader
IOException
public ProjectFilesystem getFilesystem()
getFilesystem
in interface ProjectFileHashCache
public void set(Path relativePath, com.google.common.hash.HashCode hashCode)
set
in interface ProjectFileHashCache
public FileHashCache.FileHashCacheVerificationResult verify() throws IOException
verify
in interface ProjectFileHashCache
IOException
public java.util.stream.Stream<Map.Entry<Path,com.google.common.hash.HashCode>> debugDump()
debugDump
in interface ProjectFileHashCache
public List<AbstractBuckEvent> getStatsEvents()