Interface CachedFileIndexInterface

    • Field Detail

      • hasher

        static final com.google.common.hash.HashFunction hasher
    • 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)
      • 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)
      • 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)
      • buildFromDBResult

        default unlimited.core.util.common.files.IndexedFile buildFromDBResult​(CachedFileToDB cachedFileInDB)
      • mapPathToDB

        default CachedFileToDB mapPathToDB​(java.nio.file.Path file,
                                           long timestamp)
      • removeFile

        void removeFile​(java.nio.file.Path file)
      • clearIndex

        void clearIndex()
      • deleteIndex

        void deleteIndex()
      • 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)
      • 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
      • 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)
      • buildCachedFileToDB

        default CachedFileToDB buildCachedFileToDB​(java.lang.String path,
                                                   long timestamp)
      • getLogs

        unlimited.core.util.common.logs.LogUtils getLogs()
      • 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()