public class MemoryStore extends Object implements SegmentStore
| Constructor and Description |
|---|
MemoryStore() |
MemoryStore(org.apache.jackrabbit.oak.spi.state.NodeState root) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
void |
gc()
Triggers removal of segments that are no longer referenceable.
|
org.apache.jackrabbit.oak.spi.blob.BlobStore |
getBlobStore()
Returns the external BlobStore (if configured) with this store
|
SegmentNodeState |
getHead()
Returns the head state.
|
SegmentTracker |
getTracker() |
org.apache.jackrabbit.oak.api.Blob |
readBlob(String reference)
Read a blob from external storage.
|
Segment |
readSegment(SegmentId id)
Reads the identified segment from this store.
|
boolean |
setHead(SegmentNodeState base,
SegmentNodeState head) |
void |
writeSegment(SegmentId id,
byte[] data,
int offset,
int length)
Writes the given segment to the segment store.
|
public MemoryStore(org.apache.jackrabbit.oak.spi.state.NodeState root)
throws IOException
IOExceptionpublic MemoryStore()
throws IOException
IOExceptionpublic SegmentTracker getTracker()
getTracker in interface SegmentStorepublic SegmentNodeState getHead()
SegmentStoregetHead in interface SegmentStorepublic boolean setHead(SegmentNodeState base, SegmentNodeState head)
setHead in interface SegmentStorepublic boolean containsSegment(SegmentId id)
SegmentStorecontainsSegment in interface SegmentStoreid - segment identifiertrue if the segment exists, false otherwise@Nonnull public Segment readSegment(SegmentId id)
SegmentStorereadSegment in interface SegmentStoreid - segment identifierSegmentNotFoundException thrown if not foundpublic void writeSegment(SegmentId id, byte[] data, int offset, int length) throws IOException
SegmentStorewriteSegment in interface SegmentStoreid - segment identifierdata - byte buffer that contains the raw contents of the segmentoffset - start offset within the byte bufferlength - length of the segmentIOExceptionpublic void close()
close in interface SegmentStorepublic org.apache.jackrabbit.oak.api.Blob readBlob(String reference)
SegmentStorereadBlob in interface SegmentStorereference - blob referencepublic org.apache.jackrabbit.oak.spi.blob.BlobStore getBlobStore()
SegmentStoregetBlobStore in interface SegmentStorepublic void gc()
SegmentStoregc in interface SegmentStoreCopyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.