public class MemoryStore extends java.lang.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 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.
|
public MemoryStore() throws java.io.IOException
java.io.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 java.io.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 segmentjava.io.IOException
@Nullable public @Nullable BlobStore getBlobStore()
null
public void gc()
public java.util.Set<SegmentId> getReferencedSegmentIds()
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.