public class FileStore extends AbstractFileStore
ioMonitor, remoteStoreMonitor
EMPTY_STORE
Modifier and Type | Method and Description |
---|---|
void |
cancelGC()
Cancel a running revision garbage collection compaction process as soon as possible.
|
void |
cleanup()
Run garbage collection on the segment level: reclaim those data segments
that are from an old segment generation and those bulk segments that are not
reachable anymore.
|
void |
close() |
void |
collectBlobReferences(Consumer<String> collector)
Finds all external blob references that are currently accessible
in this repository and adds them to the given collector.
|
boolean |
compactFull()
Copy every referenced record in data (non-bulk) segments.
|
boolean |
compactTail() |
boolean |
containsSegment(SegmentId id)
Checks whether the identified segment exists in this store.
|
void |
flush()
Flush all pending changes
|
void |
fullGC()
Run full garbage collection: estimation, compaction, cleanup.
|
GCNodeWriteMonitor |
getGCNodeWriteMonitor() |
Runnable |
getGCRunner() |
@NotNull TarRevisions |
getRevisions() |
int |
getSegmentCount() |
FileStoreStats |
getStats() |
@NotNull SegmentWriter |
getWriter() |
int |
readerCount() |
@NotNull Segment |
readSegment(SegmentId id)
Reads the identified segment from this store.
|
void |
tailGC()
Run tail garbage collection.
|
void |
tryFlush()
Try to flush all pending changes to disk if possible without waiting
for a lock or other resources currently not available.
|
void |
writeSegment(SegmentId id,
byte[] buffer,
int offset,
int length)
Writes the given segment to the segment store.
|
getBlobStore, getHead, getReader, getSegmentCacheStats, getSegmentIdProvider, getStringCacheStats, getTemplateCacheStats
public Runnable getGCRunner()
public GCNodeWriteMonitor getGCNodeWriteMonitor()
public int readerCount()
public int getSegmentCount()
public FileStoreStats getStats()
public void flush() throws IOException
IOException
public void tryFlush()
public void fullGC() throws IOException
IOException
public void tailGC() throws IOException
IOException
public boolean compactFull()
true
on success, false
otherwise.public boolean compactTail()
public void cleanup() throws IOException
IOException
public void collectBlobReferences(Consumer<String> collector) throws IOException
Note that this method only collects blob references that are already stored in the repository (at the time when this method is called), so the garbage collector will need some other mechanism for tracking in-memory references and references stored while this method is running.
collectBlobReferences
in class AbstractFileStore
collector
- reference collector called back for each blob reference foundIOException
public void cancelGC()
@NotNull public @NotNull SegmentWriter getWriter()
getWriter
in class AbstractFileStore
@NotNull public @NotNull TarRevisions getRevisions()
getRevisions
in class AbstractFileStore
Revisions
object bound to the current store.public void close()
public boolean containsSegment(SegmentId id)
SegmentStore
id
- segment identifiertrue
if the segment exists, false
otherwise@NotNull public @NotNull Segment readSegment(SegmentId id)
SegmentStore
id
- segment identifierSegmentNotFoundException
thrown if not foundpublic void writeSegment(SegmentId id, byte[] buffer, int offset, int length) throws IOException
SegmentStore
id
- segment identifierbuffer
- byte buffer that contains the raw contents of the segmentoffset
- start offset within the byte bufferlength
- length of the segmentIOException
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.