public class HttpStore extends Object implements SegmentStore
Modifier and Type | Method and Description |
---|---|
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
BinaryReferenceConsumer |
getBinaryReferenceConsumer() |
org.apache.jackrabbit.oak.spi.blob.BlobStore |
getBlobStore() |
SegmentReader |
getReader() |
Revisions |
getRevisions() |
SegmentTracker |
getTracker() |
SegmentWriter |
getWriter() |
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 id)
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.
|
public HttpStore(URL base)
base
- make sure the url ends with a slash "/", otherwise the
requests will end up as absolute instead of relative@Nonnull public SegmentTracker getTracker()
@Nonnull public SegmentWriter getWriter()
@Nonnull public SegmentReader getReader()
@Nonnull public BinaryReferenceConsumer getBinaryReferenceConsumer()
@Nonnull public SegmentId newSegmentId(long msb, long lsb)
SegmentStore
SegmentId
represented by the given MSB/LSB pair.newSegmentId
in interface SegmentStore
msb
- The most significant bits of the SegmentId
.lsb
- The least significant bits of the SegmentId
.null
instance of SegmentId
.@Nonnull public SegmentId newBulkSegmentId()
SegmentStore
SegmentId
for a segment of type "bulk".newBulkSegmentId
in interface SegmentStore
null
instance of SegmentId
.@Nonnull public SegmentId newDataSegmentId()
SegmentStore
SegmentId
for a segment of type "data".newDataSegmentId
in interface SegmentStore
null
instance of SegmentId
.public boolean containsSegment(SegmentId id)
SegmentStore
containsSegment
in interface SegmentStore
id
- segment identifiertrue
if the segment exists, false
otherwise@Nonnull public Segment readSegment(SegmentId id)
SegmentStore
readSegment
in interface SegmentStore
id
- segment identifierSegmentNotFoundException
thrown if not foundpublic void writeSegment(SegmentId id, byte[] bytes, int offset, int length) throws IOException
SegmentStore
writeSegment
in interface SegmentStore
id
- segment identifierbytes
- byte buffer that contains the raw contents of the segmentoffset
- start offset within the byte bufferlength
- length of the segmentIOException
@CheckForNull public org.apache.jackrabbit.oak.spi.blob.BlobStore getBlobStore()
null
Copyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.