public static class FileStore.ReadOnlyStore extends FileStore
FileStore implementation that supports
going back to old revisions.
All write methods are no-ops.
FileStore.Builder, FileStore.ReadOnlyStore| Constructor and Description |
|---|
FileStore.ReadOnlyStore(File directory) |
FileStore.ReadOnlyStore(File directory,
org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore) |
FileStore.ReadOnlyStore(File directory,
int cacheSize,
boolean memoryMapping) |
FileStore.ReadOnlyStore(File directory,
int cacheSize,
boolean memoryMapping,
org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore) |
| Modifier and Type | Method and Description |
|---|---|
LinkedList<File> |
cleanup()
Runs garbage collection on the segment level, which could write new
generations of tar files.
|
void |
compact()
Copy every referenced record in data (non-bulk) segments.
|
void |
flush()
no-op
|
void |
gc()
Triggers removal of segments that are no longer referenceable.
|
boolean |
maybeCompact(boolean cleanup) |
boolean |
setHead(SegmentNodeState base,
SegmentNodeState head) |
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.
|
close, containsSegment, flush, getBlobStore, getHead, getSegmentIds, getStats, getTarGraph, getTarReaderIndex, getTracker, getVersion, newFileStore, readBlob, readerCount, readSegment, setCompactionStrategy, sizepublic FileStore.ReadOnlyStore(File directory, int cacheSize, boolean memoryMapping) throws IOException
IOExceptionpublic FileStore.ReadOnlyStore(File directory, int cacheSize, boolean memoryMapping, org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore) throws IOException
IOExceptionpublic FileStore.ReadOnlyStore(File directory) throws IOException
IOExceptionpublic FileStore.ReadOnlyStore(File directory, org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore) throws IOException
IOExceptionpublic 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 boolean setHead(SegmentNodeState base, SegmentNodeState head)
setHead in interface SegmentStoresetHead in class FileStorepublic void writeSegment(SegmentId id, byte[] data, int offset, int length)
SegmentStorewriteSegment in interface SegmentStorewriteSegment in class FileStoreid - segment identifierdata - byte buffer that contains the raw contents of the segmentoffset - start offset within the byte bufferlength - length of the segmentpublic LinkedList<File> cleanup()
FileStoreA new generation of a tar file is created (and segments are only discarded) if doing so releases more than 25% of the space in a tar file.
public void gc()
SegmentStoregc in interface SegmentStoregc in class FileStorepublic void compact()
FileStorepublic boolean maybeCompact(boolean cleanup)
maybeCompact in class FileStoreCopyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.