Interface FileStore

All Known Implementing Classes:
DistribFileStore

public interface FileStore
The interface to be implemented by any package store provider
WARNING: This API is experimental and might change in incompatible ways in the next release.
  • Method Details

    • put

      void put(FileStore.FileEntry fileEntry) throws IOException
      Store a file into the filestore. This should ensure that it is replicated across all nodes in the cluster
      Throws:
      IOException
    • get

      void get(String path, Consumer<FileStore.FileEntry> consumer, boolean fetchMissing) throws IOException
      Read file content from a given path.

      TODO: Is fetchMissing actually used? I don't see it being used, but the IDE doesn't flag it not being used!

      Throws:
      IOException
    • fetch

      boolean fetch(String path, String from)
      Fetch a resource from another node internal API
    • list

      List<FileStore.FileDetails> list(String path, Predicate<String> predicate)
    • syncToAllNodes

      void syncToAllNodes(String path) throws IOException
      Sync a local file to all nodes. All the nodes are asked to pull the file from this node
      Throws:
      IOException
    • getRealPath

      Path getRealPath(String path)
      get the real path on filesystem
    • getType

      FileStore.FileType getType(String path, boolean fetchMissing)
      The type of the resource
    • getKeys

      Map<String,byte[]> getKeys() throws IOException
      Get all the keys in the package store. The data is a .DER file content
      Throws:
      IOException
    • refresh

      void refresh(String path)
      Refresh the files in a path. Maybe this node does not have all files?
      Parameters:
      path - the path to be refreshed.
    • delete

      void delete(String path)
      Delete a file cluster-wide
    • deleteLocal

      void deleteLocal(String path)
      Delete file from local file system