public interface SegmentStore
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
SegmentId |
newBulkSegmentId()
Create a new
SegmentId for a segment of type "bulk". |
SegmentId |
newDataSegmentId()
Create a new
SegmentId for a segment of type "data". |
SegmentId |
newSegmentId(long msb,
long lsb)
Create a
SegmentId represented by the given MSB/LSB pair. |
Segment |
readSegment(SegmentId segmentId)
Reads the identified segment from this store.
|
void |
writeSegment(SegmentId id,
byte[] bytes,
int offset,
int length)
Writes the given segment to the segment store.
|
boolean containsSegment(SegmentId id)
id - segment identifiertrue if the segment exists, false otherwise@Nonnull Segment readSegment(SegmentId segmentId)
segmentId - segment identifierSegmentNotFoundException thrown if not foundvoid writeSegment(SegmentId id, byte[] bytes, int offset, int length) throws IOException
id - segment identifierbytes - byte buffer that contains the raw contents of the segmentoffset - start offset within the byte bufferlength - length of the segmentIOException@Nonnull SegmentId newSegmentId(long msb, long lsb)
SegmentId represented by the given MSB/LSB pair.@Nonnull SegmentId newBulkSegmentId()
SegmentId for a segment of type "bulk".null instance of SegmentId.Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.