public class ReadOnlyFileStore extends AbstractFileStore
AbstractFileStore
implementation that supports going back
to old revisions.
All write methods are no-ops.
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
ReadOnlyRevisions |
getRevisions() |
Iterable<SegmentId> |
getSegmentIds() |
Map<UUID,List<UUID>> |
getTarGraph(String fileName) |
Map<String,Set<UUID>> |
getTarReaderIndex() |
SegmentWriter |
getWriter() |
Segment |
readSegment(SegmentId id)
Reads the identified segment from this store.
|
void |
setRevision(String revision)
Go to the specified
revision |
void |
traverseSegmentGraph(Set<UUID> roots,
SegmentGraph.SegmentGraphVisitor visitor)
Build the graph of segments reachable from an initial set of segments
|
void |
writeSegment(SegmentId id,
byte[] data,
int offset,
int length)
Writes the given segment to the segment store.
|
getBlobStore, getHead, getReader, getSegmentCacheStats, getStringCacheStats, getTemplateCacheStats, getTracker, newBulkSegmentId, newDataSegmentId, newSegmentId
public void setRevision(String revision)
revision
revision
- public void traverseSegmentGraph(@Nonnull Set<UUID> roots, @Nonnull SegmentGraph.SegmentGraphVisitor visitor) throws IOException
roots
- the initial set of segmentsvisitor
- visitor receiving call back while following the segment graphIOException
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@Nonnull public Segment readSegment(SegmentId id)
SegmentStore
id
- segment identifierSegmentNotFoundException
thrown if not foundpublic void close()
@Nonnull public SegmentWriter getWriter()
getWriter
in class AbstractFileStore
public Map<UUID,List<UUID>> getTarGraph(String fileName) throws IOException
IOException
public ReadOnlyRevisions getRevisions()
getRevisions
in class AbstractFileStore
Revisions
object bound to the current store.Copyright © 2012-2019 The Apache Software Foundation. All Rights Reserved.