public class ReadOnlyFileStore extends AbstractFileStore
AbstractFileStore
implementation that supports going back
to old revisions.
All write methods are no-ops.
ioMonitor, remoteStoreMonitor
EMPTY_STORE
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
collectBlobReferences(Consumer<String> collector)
Finds all external blob references that are currently accessible
in this repository and adds them to the given collector.
|
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
Set<SegmentId> |
getReferencedSegmentIds() |
ReadOnlyRevisions |
getRevisions() |
Iterable<SegmentId> |
getSegmentIds() |
Map<UUID,Set<UUID>> |
getTarGraph(String fileName) |
Map<String,Set<UUID>> |
getTarReaderIndex() |
@NotNull SegmentWriter |
getWriter() |
@NotNull Segment |
readSegment(SegmentId id)
Reads the identified segment from this store.
|
void |
setRevision(String revision)
Go to the specified
revision |
void |
writeSegment(SegmentId id,
byte[] data,
int offset,
int length)
Writes the given segment to the segment store.
|
getBlobStore, getHead, getReader, getSegmentCacheStats, getSegmentIdProvider, getStringCacheStats, getTemplateCacheStats
public void setRevision(String revision)
revision
revision
- public void writeSegment(SegmentId id, byte[] data, int offset, int length)
SegmentStore
id
- segment identifierdata
- byte buffer that contains the raw contents of the segmentoffset
- start offset within the byte bufferlength
- length of the segmentpublic boolean containsSegment(SegmentId id)
SegmentStore
id
- segment identifiertrue
if the segment exists, false
otherwise@NotNull public @NotNull Segment readSegment(SegmentId id)
SegmentStore
id
- segment identifierSegmentNotFoundException
thrown if not foundpublic void close()
@NotNull public @NotNull SegmentWriter getWriter()
getWriter
in class AbstractFileStore
public Map<UUID,Set<UUID>> getTarGraph(String fileName) throws IOException
IOException
public ReadOnlyRevisions getRevisions()
getRevisions
in class AbstractFileStore
Revisions
object bound to the current store.public void collectBlobReferences(Consumer<String> collector) throws IOException
AbstractFileStore
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.
collectBlobReferences
in class AbstractFileStore
collector
- reference collector called back for each blob reference foundIOException
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.