Interface ExternalStore

All Superinterfaces:
PieceStore
All Known Implementing Classes:
InPlaceStore

public interface ExternalStore extends PieceStore
A read-only backend that serves artifacts from where they already lie: files on this host (InPlaceStore) or objects behind a remote service, read by range. The swarm never writes to it. A host hashes the artifact, then calls Content.publishExternal(ExternalStore, String, ContentRoots.Hashed, PublishOptions), which builds the manifest and registers it here under the host's key; every piece is hashed whole at its first serve (PieceStore.external()).
  • Method Details

    • register

      void register(Manifest manifest, String key)
      Registers an artifact as complete under a key this backend understands: a file path, an object key.
      Parameters:
      manifest - the manifest the swarm built for the artifact
      key - where the artifact lies, in this backend's terms
    • external

      default boolean external()
      Description copied from interface: PieceStore
      Whether this backend serves bytes the swarm did not write and verify itself, such as files in place or objects behind a remote service. The swarm hashes each piece of an external backend whole at its first serve and forgets the root on a mismatch (LB-T-10); it skips external roots in its sampled check on start, since reading them may cost a remote call.
      Specified by:
      external in interface PieceStore
      Returns:
      true for an external backend; false by default