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(BlobStore blobStore,
File directory,
int maxFileSizeMB,
boolean memoryMapping)
Deprecated.
|
FileStore(BlobStore blobStore,
File directory,
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 |
---|---|
void |
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 |
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.
|
Iterable<SegmentId> |
getSegmentIds() |
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. |
Blob |
readBlob(String blobId)
Read a blob from external storage.
|
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, 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(BlobStore blobStore, File directory, NodeState initial, int maxFileSizeMB, int cacheSizeMB, boolean memoryMapping) throws IOException
IOException
public static FileStore.Builder newFileStore(File directory)
FileStore.Builder
for a file store.directory
- directory where the tar files are storedFileStore.Builder
instance.public boolean maybeCompact(boolean cleanup)
public long size() throws IOException
IOException
public void flush() throws IOException
IOException
public void 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.
IOException
public void compact()
public SegmentTracker getTracker()
getTracker
in interface SegmentStore
public SegmentNodeState getHead()
SegmentStore
getHead
in interface SegmentStore
public boolean setHead(SegmentNodeState base, SegmentNodeState head)
setHead
in interface SegmentStore
public void close()
close
in interface SegmentStore
public boolean containsSegment(SegmentId id)
SegmentStore
containsSegment
in interface SegmentStore
id
- segment identifiertrue
if the segment exists, false
otherwisepublic Segment readSegment(SegmentId id)
SegmentStore
readSegment
in interface SegmentStore
id
- segment identifierSegmentNotFoundException
thrown if not foundpublic void writeSegment(SegmentId id, byte[] data, int offset, int length)
SegmentStore
writeSegment
in interface SegmentStore
id
- segment identifierdata
- byte buffer that contains the raw contents of the segmentoffset
- start offset within the byte bufferlength
- length of the segmentpublic Blob readBlob(String blobId)
SegmentStore
readBlob
in interface SegmentStore
blobId
- blob referencepublic BlobStore getBlobStore()
SegmentStore
getBlobStore
in interface SegmentStore
public void gc()
SegmentStore
gc
in interface SegmentStore
public Map<UUID,List<UUID>> getTarGraph(String fileName) throws IOException
IOException
public FileStore setCompactionStrategy(CompactionStrategy strategy)
public SegmentVersion getVersion()
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"