Class MemoryStore
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.memory.MemoryStore
-
- All Implemented Interfaces:
SegmentStore
public class MemoryStore extends Object implements SegmentStore
A store used for in-memory operations.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.segment.SegmentStore
EMPTY_STORE
-
-
Constructor Summary
Constructors Constructor Description MemoryStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsSegment(SegmentId id)Checks whether the identified segment exists in this store.voidgc()@Nullable BlobStoregetBlobStore()@NotNull SegmentReadergetReader()Set<SegmentId>getReferencedSegmentIds()@NotNull RevisionsgetRevisions()@NotNull SegmentIdProvidergetSegmentIdProvider()@NotNull SegmentWritergetWriter()@NotNull SegmentreadSegment(SegmentId id)Reads the identified segment from this store.voidwriteSegment(SegmentId id, byte[] data, int offset, int length)Writes the given segment to the segment store.
-
-
-
Constructor Detail
-
MemoryStore
public MemoryStore() throws IOException- Throws:
IOException
-
-
Method Detail
-
getWriter
@NotNull public @NotNull SegmentWriter getWriter()
-
getReader
@NotNull public @NotNull SegmentReader getReader()
-
getSegmentIdProvider
@NotNull public @NotNull SegmentIdProvider getSegmentIdProvider()
-
getRevisions
@NotNull public @NotNull Revisions getRevisions()
-
containsSegment
public boolean containsSegment(SegmentId id)
Description copied from interface:SegmentStoreChecks whether the identified segment exists in this store.- Specified by:
containsSegmentin interfaceSegmentStore- Parameters:
id- segment identifier- Returns:
trueif the segment exists,falseotherwise
-
readSegment
@NotNull public @NotNull Segment readSegment(SegmentId id)
Description copied from interface:SegmentStoreReads the identified segment from this store.- Specified by:
readSegmentin interfaceSegmentStore- Parameters:
id- segment identifier- Returns:
- identified segment, or a
SegmentNotFoundExceptionthrown if not found
-
writeSegment
public void writeSegment(SegmentId id, byte[] data, int offset, int length) throws IOException
Description copied from interface:SegmentStoreWrites the given segment to the segment store.- Specified by:
writeSegmentin interfaceSegmentStore- Parameters:
id- segment identifierdata- byte buffer that contains the raw contents of the segmentoffset- start offset within the byte bufferlength- length of the segment- Throws:
IOException
-
getBlobStore
@Nullable public @Nullable BlobStore getBlobStore()
- Returns:
null
-
gc
public void gc()
-
-