Package unlimited.fc.client.cache
Interface CachedFileIndexInterface
-
- All Known Implementing Classes:
CachedFileIndexInterface.Adapter,CachedFileIndexInterface.NullCachedFileIndex,MappedMemoryTransferCache
public interface CachedFileIndexInterface
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCachedFileIndexInterface.Adapterstatic interfaceCachedFileIndexInterface.CacheKeyCredentialsstatic classCachedFileIndexInterface.NullCachedFileIndex
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.hash.HashFunctionhasher
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Map<unlimited.core.util.common.files.LoadableIndexedFile,java.lang.Boolean>addDirect(java.util.Set<unlimited.core.util.common.files.LoadableIndexedFile> files)java.util.Map<CachedFileToDB,java.lang.Boolean>addDirectAndMerge(java.util.Set<CachedFileToDB> file)voidaddFile(java.lang.String indexedString, long timestamp, long size)default voidaddFile(java.nio.file.Path file)default voidaddFile(java.nio.file.Path file, long timestamp, long size)default voidaddFile(FileListDataItem item)default CachedFileToDBbuildCachedFileToDB(java.lang.String path, long timestamp)default unlimited.core.util.common.files.IndexedFilebuildFromDBResult(CachedFileToDB cachedFileInDB)static longbuildTaskKey(java.lang.String taskID, java.lang.String clientID, java.lang.String siteId, boolean isUpload)static longbuildTaskKey(CachedFileIndexInterface.CacheKeyCredentials t)voidclearIndex()voiddeleteIndex()default <T> java.util.stream.Stream<T>filteredShouldTransfer(java.util.stream.Stream<T> in, java.util.function.Function<java.util.Set<T>,java.util.Map<T,java.lang.Boolean>> batcher)java.lang.StringgetCacheDirName()Method that returns the name of the cache directory for a single transfer.java.lang.StringgetCacheDirName(java.lang.String direction)java.nio.file.PathgetClientDirectory()java.lang.StringgetClientID()default com.google.common.hash.HashCodegetHashCode(java.lang.String path)unlimited.core.util.common.files.IndexedFilegetIndexedFile(java.nio.file.Path file)unlimited.core.util.common.files.IndexedFilegetIndexedFile(FileListDataItem item)default java.lang.StringgetIndexedPath(java.nio.file.Path f)default java.lang.StringgetIndexedPath(FileListDataItem f)default CachedFileIndexInterfacegetLegacyFromThis()unlimited.core.util.common.logs.LogUtilsgetLogs()default longgetMD5(java.lang.String path)default longgetMD5(java.nio.file.Path path)default longgetMD5(FileListDataItem item)default java.lang.StringgetMD5Str(java.lang.String path)java.lang.StringgetSiteID()java.lang.StringgetTaskID()default booleanhasMatch(java.nio.file.Path p)default booleanhasMatch(unlimited.core.util.common.files.IndexedFile indexedFile, long currentModified, long currentSize)default booleanhasMatch(FileListDataItem fileItem)java.util.Map<FileListDataItem,java.lang.Boolean>hasMatchBatchFLDI(java.util.Set<FileListDataItem> set)default java.util.Map<unlimited.core.util.common.files.LoadableIndexedFile,java.lang.Boolean>hasMatchBatchIDX(java.util.Set<unlimited.core.util.common.files.LoadableIndexedFile> set)java.util.Map<java.nio.file.Path,java.lang.Boolean>hasMatchBatchPath(java.util.Set<java.nio.file.Path> set)booleanisIndexed(java.nio.file.Path file)booleanisIndexed(FileListDataItem item)default booleanisMigrated()booleanisUpload()default CachedFileToDBmapFLDIToDB(FileListDataItem file)default CachedFileToDBmapIDXToDB(unlimited.core.util.common.files.LoadableIndexedFile file)default CachedFileToDBmapPathToDB(java.nio.file.Path file, long timestamp)voidpreCacheEntries()voidremoveFile(java.nio.file.Path file)voidremoveFile(FileListDataItem item)default booleanshouldTransfer(java.nio.file.Path p)default <T> java.util.stream.Stream<unlimited.core.util.common.tuples.Pair<T,java.lang.Boolean>>shouldTransfer(java.util.stream.Stream<T> in, java.util.function.Function<java.util.Set<T>,java.util.Map<T,java.lang.Boolean>> batcher)default booleanshouldTransfer(FileListDataItem fileItem)default java.util.stream.Stream<unlimited.core.util.common.tuples.Pair<FileListDataItem,java.lang.Boolean>>shouldTransferFLDI(java.util.stream.Stream<FileListDataItem> in)default <T> booleanshouldTransferGeneric(T t)default java.util.stream.Stream<unlimited.core.util.common.tuples.Pair<java.nio.file.Path,java.lang.Boolean>>shouldTransferPath(java.util.stream.Stream<java.nio.file.Path> in)intsize()
-
-
-
Method Detail
-
getHashCode
default com.google.common.hash.HashCode getHashCode(java.lang.String path)
-
isUpload
boolean isUpload()
-
getSiteID
java.lang.String getSiteID()
-
getClientID
java.lang.String getClientID()
-
getTaskID
java.lang.String getTaskID()
-
getMD5
default long getMD5(java.lang.String path)
-
getMD5Str
default java.lang.String getMD5Str(java.lang.String path)
-
getMD5
default long getMD5(java.nio.file.Path path)
-
getMD5
default long getMD5(FileListDataItem item)
-
addDirect
default java.util.Map<unlimited.core.util.common.files.LoadableIndexedFile,java.lang.Boolean> addDirect(java.util.Set<unlimited.core.util.common.files.LoadableIndexedFile> files)
-
mapIDXToDB
default CachedFileToDB mapIDXToDB(unlimited.core.util.common.files.LoadableIndexedFile file)
-
addDirectAndMerge
java.util.Map<CachedFileToDB,java.lang.Boolean> addDirectAndMerge(java.util.Set<CachedFileToDB> file)
-
getIndexedPath
default java.lang.String getIndexedPath(java.nio.file.Path f)
-
getClientDirectory
java.nio.file.Path getClientDirectory()
-
getIndexedPath
default java.lang.String getIndexedPath(FileListDataItem f)
-
isIndexed
boolean isIndexed(java.nio.file.Path file)
-
getIndexedFile
unlimited.core.util.common.files.IndexedFile getIndexedFile(java.nio.file.Path file)
-
getIndexedFile
unlimited.core.util.common.files.IndexedFile getIndexedFile(FileListDataItem item)
-
addFile
void addFile(java.lang.String indexedString, long timestamp, long size)
-
addFile
default void addFile(java.nio.file.Path file)
-
addFile
default void addFile(java.nio.file.Path file, long timestamp, long size)
-
addFile
default void addFile(FileListDataItem item)
-
buildFromDBResult
default unlimited.core.util.common.files.IndexedFile buildFromDBResult(CachedFileToDB cachedFileInDB)
-
mapPathToDB
default CachedFileToDB mapPathToDB(java.nio.file.Path file, long timestamp)
-
mapFLDIToDB
default CachedFileToDB mapFLDIToDB(FileListDataItem file)
-
removeFile
void removeFile(java.nio.file.Path file)
-
removeFile
void removeFile(FileListDataItem item)
-
clearIndex
void clearIndex()
-
deleteIndex
void deleteIndex()
-
isIndexed
boolean isIndexed(FileListDataItem item)
-
preCacheEntries
void preCacheEntries()
-
shouldTransfer
default boolean shouldTransfer(java.nio.file.Path p)
-
hasMatchBatchPath
java.util.Map<java.nio.file.Path,java.lang.Boolean> hasMatchBatchPath(java.util.Set<java.nio.file.Path> set)
-
hasMatchBatchFLDI
java.util.Map<FileListDataItem,java.lang.Boolean> hasMatchBatchFLDI(java.util.Set<FileListDataItem> set)
-
hasMatchBatchIDX
default java.util.Map<unlimited.core.util.common.files.LoadableIndexedFile,java.lang.Boolean> hasMatchBatchIDX(java.util.Set<unlimited.core.util.common.files.LoadableIndexedFile> set)
-
filteredShouldTransfer
default <T> java.util.stream.Stream<T> filteredShouldTransfer(java.util.stream.Stream<T> in, java.util.function.Function<java.util.Set<T>,java.util.Map<T,java.lang.Boolean>> batcher)- Parameters:
in-batcher- - This should either be hasMatchBatchPath, or hasMatchBatchFLDI- Returns:
- a stream of pairs where the second value of the pair will be if the item should transfer
-
shouldTransfer
default <T> java.util.stream.Stream<unlimited.core.util.common.tuples.Pair<T,java.lang.Boolean>> shouldTransfer(java.util.stream.Stream<T> in, java.util.function.Function<java.util.Set<T>,java.util.Map<T,java.lang.Boolean>> batcher)- Parameters:
in- a stream of items that need to be checked against the transfer cache.batcher- - This should either be hasMatchBatchPath, or hasMatchBatchFLDI- Returns:
- a stream of items that should be transferred
-
getLegacyFromThis
default CachedFileIndexInterface getLegacyFromThis()
-
shouldTransferFLDI
default java.util.stream.Stream<unlimited.core.util.common.tuples.Pair<FileListDataItem,java.lang.Boolean>> shouldTransferFLDI(java.util.stream.Stream<FileListDataItem> in)
-
shouldTransferPath
default java.util.stream.Stream<unlimited.core.util.common.tuples.Pair<java.nio.file.Path,java.lang.Boolean>> shouldTransferPath(java.util.stream.Stream<java.nio.file.Path> in)
-
shouldTransfer
default boolean shouldTransfer(FileListDataItem fileItem)
-
shouldTransferGeneric
default <T> boolean shouldTransferGeneric(T t)
-
hasMatch
default boolean hasMatch(unlimited.core.util.common.files.IndexedFile indexedFile, long currentModified, long currentSize)
-
hasMatch
default boolean hasMatch(java.nio.file.Path p)
-
hasMatch
default boolean hasMatch(FileListDataItem fileItem)
-
buildCachedFileToDB
default CachedFileToDB buildCachedFileToDB(java.lang.String path, long timestamp)
-
getLogs
unlimited.core.util.common.logs.LogUtils getLogs()
-
buildTaskKey
static long buildTaskKey(CachedFileIndexInterface.CacheKeyCredentials t)
-
buildTaskKey
static long buildTaskKey(java.lang.String taskID, java.lang.String clientID, java.lang.String siteId, boolean isUpload)
-
getCacheDirName
java.lang.String getCacheDirName()
Method that returns the name of the cache directory for a single transfer.- Returns:
- String
-
getCacheDirName
java.lang.String getCacheDirName(java.lang.String direction)
-
size
int size()
-
isMigrated
default boolean isMigrated()
-
-