public interface SegmentStore
Modifier and Type | Field and Description |
---|---|
static SegmentStore |
EMPTY_STORE
A store that is always empty and that cannot be written to.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
@NotNull 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.
|
static final SegmentStore EMPTY_STORE
boolean containsSegment(SegmentId id)
id
- segment identifiertrue
if the segment exists, false
otherwise@NotNull @NotNull 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
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.