Class LocalFileCacheClient

java.lang.Object
org.gorpipe.gor.clients.LocalFileCacheClient
All Implemented Interfaces:
AutoCloseable, org.gorpipe.client.FileCache
Direct Known Subclasses:
NoCacheFileCacheClient

public class LocalFileCacheClient extends Object implements org.gorpipe.client.FileCache
Local implementation of file cache client working directly against the file system. This can be used for non server implementations of file cache.
  • Constructor Details

    • LocalFileCacheClient

      public LocalFileCacheClient(org.gorpipe.gor.model.DriverBackedFileReader fileReader, String rootPath, boolean useSubFolders, int subFolderSize)
      Constructs an instance of local file cache. If sub folders are used the first subFolderSize letters of the fingerprint are used to create a sub folder storing the result file.
      Parameters:
      rootPath - File cache location
      useSubFolders - Inserts sub folders for fingerprints.
      subFolderSize - Insers sub folders for fingerprints.
    • LocalFileCacheClient

      public LocalFileCacheClient(org.gorpipe.gor.model.DriverBackedFileReader fileReader, String rootPath)
  • Method Details

    • lookupFile

      public String lookupFile(String fingerprint)
      Specified by:
      lookupFile in interface org.gorpipe.client.FileCache
    • store

      public String store(Path from, String fingerprint, String ext, long cost)
      Specified by:
      store in interface org.gorpipe.client.FileCache
    • storeWithSpecificCacheFilename

      public String storeWithSpecificCacheFilename(Path path, String fingerprint, String cacheFilename, long cost)
      Specified by:
      storeWithSpecificCacheFilename in interface org.gorpipe.client.FileCache
    • storeSibling

      public String storeSibling(Path path, String fingerprint)
      Specified by:
      storeSibling in interface org.gorpipe.client.FileCache
    • tempLocation

      public String tempLocation(String fingerprint, String ext)
      Specified by:
      tempLocation in interface org.gorpipe.client.FileCache
    • multiLookup

      public String[] multiLookup(String[] fingerprints, boolean defer)
      Specified by:
      multiLookup in interface org.gorpipe.client.FileCache
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception