public class HttpStore extends Object implements SegmentStore
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
void |
gc()
Triggers removal of segments that are no longer referenceable.
|
protected URLConnection |
get(String fragment)
Builds a simple URLConnection.
|
org.apache.jackrabbit.oak.spi.blob.BlobStore |
getBlobStore()
Returns the external BlobStore (if configured) with this store
|
SegmentNodeState |
getHead()
Returns the head state.
|
SegmentTracker |
getTracker() |
org.apache.jackrabbit.oak.api.Blob |
readBlob(String reference)
Read a blob from external storage.
|
Segment |
readSegment(SegmentId id)
Reads the identified segment from this store.
|
boolean |
setHead(SegmentNodeState base,
SegmentNodeState head) |
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 relativepublic SegmentTracker getTracker()
getTracker in interface SegmentStoreprotected URLConnection get(String fragment) throws MalformedURLException, IOException
MalformedURLExceptionIOExceptionpublic SegmentNodeState getHead()
SegmentStoregetHead in interface SegmentStorepublic boolean setHead(SegmentNodeState base, SegmentNodeState head)
setHead in interface SegmentStorepublic boolean containsSegment(SegmentId id)
SegmentStorecontainsSegment in interface SegmentStoreid - segment identifiertrue if the segment exists, false otherwisepublic Segment readSegment(SegmentId id)
SegmentStorereadSegment in interface SegmentStoreid - segment identifierSegmentNotFoundException thrown if not foundpublic void writeSegment(SegmentId id, byte[] bytes, int offset, int length) throws IOException
SegmentStorewriteSegment in interface SegmentStoreid - segment identifierbytes - byte buffer that contains the raw contents of the segmentoffset - start offset within the byte bufferlength - length of the segmentIOExceptionpublic void close()
close in interface SegmentStore@CheckForNull public org.apache.jackrabbit.oak.api.Blob readBlob(String reference)
SegmentStorereadBlob in interface SegmentStorereference - blob reference@CheckForNull public org.apache.jackrabbit.oak.spi.blob.BlobStore getBlobStore()
SegmentStoregetBlobStore in interface SegmentStorepublic void gc()
SegmentStoregc in interface SegmentStoreCopyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.