Class ReadOnlyFileStore

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, SegmentStore

    public class ReadOnlyFileStore
    extends AbstractFileStore
    A read only AbstractFileStore implementation that supports going back to old revisions.

    All write methods are no-ops.

    • Method Detail

      • setRevision

        public void setRevision​(java.lang.String revision)
        Go to the specified revision
        Parameters:
        revision -
      • writeSegment

        public void writeSegment​(SegmentId id,
                                 byte[] data,
                                 int offset,
                                 int length)
        Description copied from interface: SegmentStore
        Writes the given segment to the segment store.
        Parameters:
        id - segment identifier
        data - byte buffer that contains the raw contents of the segment
        offset - start offset within the byte buffer
        length - length of the segment
      • containsSegment

        public boolean containsSegment​(SegmentId id)
        Description copied from interface: SegmentStore
        Checks whether the identified segment exists in this store.
        Parameters:
        id - segment identifier
        Returns:
        true if the segment exists, false otherwise
      • readSegment

        @NotNull
        public @NotNull Segment readSegment​(SegmentId id)
        Description copied from interface: SegmentStore
        Reads the identified segment from this store.
        Parameters:
        id - segment identifier
        Returns:
        identified segment, or a SegmentNotFoundException thrown if not found
      • close

        public void close()
      • getTarReaderIndex

        public java.util.Map<java.lang.String,​java.util.Set<java.util.UUID>> getTarReaderIndex()
      • getTarGraph

        public java.util.Map<java.util.UUID,​java.util.Set<java.util.UUID>> getTarGraph​(java.lang.String fileName)
                                                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getSegmentIds

        public java.lang.Iterable<SegmentId> getSegmentIds()
      • getReferencedSegmentIds

        public java.util.Set<SegmentId> getReferencedSegmentIds()
      • collectBlobReferences

        public void collectBlobReferences​(java.util.function.Consumer<java.lang.String> collector)
                                   throws java.io.IOException
        Description copied from class: AbstractFileStore
        Finds all external blob references that are currently accessible in this repository and adds them to the given collector. Useful for collecting garbage in an external data store.

        Note that this method only collects blob references that are already stored in the repository (at the time when this method is called), so the garbage collector will need some other mechanism for tracking in-memory references and references stored while this method is running.

        Specified by:
        collectBlobReferences in class AbstractFileStore
        Parameters:
        collector - reference collector called back for each blob reference found
        Throws:
        java.io.IOException