Class MemoryStore
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.memory.MemoryStore
-
- All Implemented Interfaces:
SegmentStore
public class MemoryStore extends java.lang.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 boolean
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.void
gc()
@Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore
getBlobStore()
@NotNull SegmentReader
getReader()
java.util.Set<SegmentId>
getReferencedSegmentIds()
@NotNull Revisions
getRevisions()
@NotNull SegmentIdProvider
getSegmentIdProvider()
@NotNull SegmentWriter
getWriter()
@NotNull Segment
readSegment(SegmentId id)
Reads the identified segment from this store.void
writeSegment(SegmentId id, byte[] data, int offset, int length)
Writes the given segment to the segment store.
-
-
-
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:SegmentStore
Checks whether the identified segment exists in this store.- Specified by:
containsSegment
in interfaceSegmentStore
- Parameters:
id
- segment identifier- Returns:
true
if the segment exists,false
otherwise
-
readSegment
@NotNull public @NotNull Segment readSegment(SegmentId id)
Description copied from interface:SegmentStore
Reads the identified segment from this store.- Specified by:
readSegment
in interfaceSegmentStore
- Parameters:
id
- segment identifier- Returns:
- identified segment, or a
SegmentNotFoundException
thrown if not found
-
writeSegment
public void writeSegment(SegmentId id, byte[] data, int offset, int length) throws java.io.IOException
Description copied from interface:SegmentStore
Writes the given segment to the segment store.- Specified by:
writeSegment
in 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:
java.io.IOException
-
getBlobStore
@Nullable public @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore getBlobStore()
- Returns:
null
-
gc
public void gc()
-
getReferencedSegmentIds
public java.util.Set<SegmentId> getReferencedSegmentIds()
-
-