public class FileStore extends Object implements SegmentStore
| Modifier and Type | Class and Description |
|---|---|
static class |
FileStore.Builder
Builder for creating
FileStore instances. |
static class |
FileStore.ReadOnlyStore
A read only
FileStore implementation that supports
going back to old revisions. |
| Constructor and Description |
|---|
FileStore(org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore,
File directory,
int maxFileSizeMB,
boolean memoryMapping)
Deprecated.
|
FileStore(org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore,
File directory,
org.apache.jackrabbit.oak.spi.state.NodeState initial,
int maxFileSizeMB,
int cacheSizeMB,
boolean memoryMapping)
Deprecated.
|
FileStore(File directory,
int maxFileSizeMB)
Deprecated.
|
FileStore(File directory,
int maxFileSizeMB,
boolean memoryMapping)
Deprecated.
|
FileStore(File directory,
int maxFileSizeMB,
int cacheSizeMB,
boolean memoryMapping)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
List<File> |
cleanup()
Runs garbage collection on the segment level, which could write new
generations of tar files.
|
void |
close() |
void |
compact()
Copy every referenced record in data (non-bulk) segments.
|
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
void |
flush() |
void |
flush(boolean cleanup) |
void |
gc()
Triggers removal of segments that are no longer referenceable.
|
org.apache.jackrabbit.oak.spi.blob.BlobStore |
getBlobStore()
Returns the external BlobStore (if configured) with this store
|
SegmentNodeState |
getHead()
Returns the head state.
|
Iterable<SegmentId> |
getSegmentIds() |
FileStoreStats |
getStats() |
Map<UUID,List<UUID>> |
getTarGraph(String fileName) |
Map<String,Set<UUID>> |
getTarReaderIndex() |
SegmentTracker |
getTracker() |
SegmentVersion |
getVersion() |
boolean |
maybeCompact(boolean cleanup) |
static FileStore.Builder |
newFileStore(File directory)
Create a new instance of a
FileStore.Builder for a file store. |
org.apache.jackrabbit.oak.api.Blob |
readBlob(String blobId)
Read a blob from external storage.
|
int |
readerCount() |
Segment |
readSegment(SegmentId id)
Reads the identified segment from this store.
|
FileStore |
setCompactionStrategy(CompactionStrategy strategy) |
boolean |
setHead(SegmentNodeState base,
SegmentNodeState head) |
long |
size() |
void |
writeSegment(SegmentId id,
byte[] data,
int offset,
int length)
Writes the given segment to the segment store.
|
@Deprecated public FileStore(org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore, File directory, int maxFileSizeMB, boolean memoryMapping) throws IOException
IOException@Deprecated public FileStore(File directory, int maxFileSizeMB, boolean memoryMapping) throws IOException
IOException@Deprecated public FileStore(File directory, int maxFileSizeMB) throws IOException
IOException@Deprecated public FileStore(File directory, int maxFileSizeMB, int cacheSizeMB, boolean memoryMapping) throws IOException
IOException@Deprecated public FileStore(org.apache.jackrabbit.oak.spi.blob.BlobStore blobStore, File directory, org.apache.jackrabbit.oak.spi.state.NodeState initial, int maxFileSizeMB, int cacheSizeMB, boolean memoryMapping) throws IOException
IOException@Nonnull public static FileStore.Builder newFileStore(@Nonnull File directory)
FileStore.Builder for a file store.directory - directory where the tar files are storedFileStore.Builder instance.public boolean maybeCompact(boolean cleanup)
throws IOException
IOExceptionpublic long size()
public int readerCount()
public FileStoreStats getStats()
public void flush()
throws IOException
IOExceptionpublic void flush(boolean cleanup)
throws IOException
IOExceptionpublic List<File> cleanup() throws IOException
A new generation of a tar file is created (and segments are only discarded) if doing so releases more than 25% of the space in a tar file.
IOExceptionpublic void compact()
throws IOException
IOExceptionpublic SegmentTracker getTracker()
getTracker in interface SegmentStorepublic SegmentNodeState getHead()
SegmentStoregetHead in interface SegmentStorepublic boolean setHead(SegmentNodeState base, SegmentNodeState head)
setHead in interface SegmentStorepublic void close()
close 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[] data, int offset, int length) throws IOException
SegmentStorewriteSegment in interface SegmentStoreid - segment identifierdata - byte buffer that contains the raw contents of the segmentoffset - start offset within the byte bufferlength - length of the segmentIOExceptionpublic org.apache.jackrabbit.oak.api.Blob readBlob(String blobId)
SegmentStorereadBlob in interface SegmentStoreblobId - blob referencepublic org.apache.jackrabbit.oak.spi.blob.BlobStore getBlobStore()
SegmentStoregetBlobStore in interface SegmentStorepublic void gc()
SegmentStoregc in interface SegmentStorepublic Map<UUID,List<UUID>> getTarGraph(String fileName) throws IOException
IOExceptionpublic FileStore setCompactionStrategy(CompactionStrategy strategy)
public SegmentVersion getVersion()
Copyright © 2012-2016 The Apache Software Foundation. All Rights Reserved.