public class FileStore extends java.lang.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(BlobStore blobStore,
java.io.File directory,
int maxFileSizeMB,
boolean memoryMapping)
Deprecated.
|
FileStore(BlobStore blobStore,
java.io.File directory,
NodeState initial,
int maxFileSizeMB,
int cacheSizeMB,
boolean memoryMapping)
Deprecated.
|
FileStore(java.io.File directory,
int maxFileSizeMB)
Deprecated.
|
FileStore(java.io.File directory,
int maxFileSizeMB,
boolean memoryMapping)
Deprecated.
|
FileStore(java.io.File directory,
int maxFileSizeMB,
int cacheSizeMB,
boolean memoryMapping)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.io.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.
|
BlobStore |
getBlobStore()
Returns the external BlobStore (if configured) with this store
|
SegmentNodeState |
getHead()
Returns the head state.
|
java.lang.Iterable<SegmentId> |
getSegmentIds() |
FileStoreStats |
getStats() |
java.util.Map<java.util.UUID,java.util.List<java.util.UUID>> |
getTarGraph(java.lang.String fileName) |
java.util.Map<java.lang.String,java.util.Set<java.util.UUID>> |
getTarReaderIndex() |
SegmentTracker |
getTracker() |
SegmentVersion |
getVersion() |
boolean |
maybeCompact(boolean cleanup) |
static FileStore.Builder |
newFileStore(java.io.File directory)
Create a new instance of a
FileStore.Builder for a file store. |
Blob |
readBlob(java.lang.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(BlobStore blobStore, java.io.File directory, int maxFileSizeMB, boolean memoryMapping) throws java.io.IOException
java.io.IOException@Deprecated
public FileStore(java.io.File directory,
int maxFileSizeMB,
boolean memoryMapping)
throws java.io.IOException
java.io.IOException@Deprecated
public FileStore(java.io.File directory,
int maxFileSizeMB)
throws java.io.IOException
java.io.IOException@Deprecated
public FileStore(java.io.File directory,
int maxFileSizeMB,
int cacheSizeMB,
boolean memoryMapping)
throws java.io.IOException
java.io.IOExceptionpublic static FileStore.Builder newFileStore(java.io.File directory)
FileStore.Builder for a file store.directory - directory where the tar files are storedFileStore.Builder instance.public boolean maybeCompact(boolean cleanup)
throws java.io.IOException
java.io.IOExceptionpublic long size()
public int readerCount()
public FileStoreStats getStats()
public void flush()
throws java.io.IOException
java.io.IOExceptionpublic void flush(boolean cleanup)
throws java.io.IOException
java.io.IOExceptionpublic java.util.List<java.io.File> cleanup()
throws java.io.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.
java.io.IOExceptionpublic void compact()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Iterable<SegmentId> getSegmentIds()
public 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 java.io.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 segmentjava.io.IOExceptionpublic Blob readBlob(java.lang.String blobId)
SegmentStorereadBlob in interface SegmentStoreblobId - blob referencepublic BlobStore getBlobStore()
SegmentStoregetBlobStore in interface SegmentStorepublic void gc()
SegmentStoregc in interface SegmentStorepublic java.util.Map<java.lang.String,java.util.Set<java.util.UUID>> getTarReaderIndex()
public java.util.Map<java.util.UUID,java.util.List<java.util.UUID>> getTarGraph(java.lang.String fileName)
throws java.io.IOException
java.io.IOExceptionpublic FileStore setCompactionStrategy(CompactionStrategy strategy)
public SegmentVersion getVersion()
"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"