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, newSegmentIdpublic void setRevision(String revision)
revisionrevision - 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 graphIOExceptionpublic void writeSegment(SegmentId id, byte[] data, int offset, int length)
SegmentStoreid - 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)
SegmentStoreid - segment identifiertrue if the segment exists, false otherwise@Nonnull public Segment readSegment(SegmentId id)
SegmentStoreid - segment identifierSegmentNotFoundException thrown if not foundpublic void close()
@Nonnull public SegmentWriter getWriter()
getWriter in class AbstractFileStorepublic Map<UUID,List<UUID>> getTarGraph(String fileName) throws IOException
IOExceptionpublic ReadOnlyRevisions getRevisions()
getRevisions in class AbstractFileStoreRevisions object bound to the current store.Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.