public class MemoryStore extends Object implements SegmentStore
EMPTY_STORE
Constructor and Description |
---|
MemoryStore() |
Modifier and Type | Method and 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() |
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.
|
public MemoryStore() throws IOException
IOException
@NotNull public @NotNull SegmentWriter getWriter()
@NotNull public @NotNull SegmentReader getReader()
@NotNull public @NotNull SegmentIdProvider getSegmentIdProvider()
@NotNull public @NotNull Revisions getRevisions()
public boolean containsSegment(SegmentId id)
SegmentStore
containsSegment
in interface SegmentStore
id
- segment identifiertrue
if the segment exists, false
otherwise@NotNull public @NotNull Segment readSegment(SegmentId id)
SegmentStore
readSegment
in interface SegmentStore
id
- segment identifierSegmentNotFoundException
thrown if not foundpublic void writeSegment(SegmentId id, byte[] data, int offset, int length) throws IOException
SegmentStore
writeSegment
in interface SegmentStore
id
- segment identifierdata
- byte buffer that contains the raw contents of the segmentoffset
- start offset within the byte bufferlength
- length of the segmentIOException
@Nullable public @Nullable org.apache.jackrabbit.oak.spi.blob.BlobStore getBlobStore()
null
public void gc()
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.