Package org.nuxeo.ecm.core.blob.binary
Interface BinaryGarbageCollector
- All Known Implementing Classes:
AbstractBinaryGarbageCollector,AbstractBlobGarbageCollector,AzureBlobStore.AzureBlobGarbageCollector,AzureGarbageCollector,CachingBlobStore.CachingBinaryGarbageCollector,EmptyBlobStore.EmptyBlobGarbageCollector,GoogleStorageBinaryManager.GoogleStorageBinaryGarbageCollector,GoogleStorageBlobStore.GoogleStorageBlobGarbageCollector,GridFSBinaryManager.GridFSBinaryGarbageCollector,GridFSBlobStore.GridFSBlobGarbageCollector,InMemoryBlobStore.InMemoryBlobGarbageCollector,LocalBinaryManager.DefaultBinaryGarbageCollector,LocalBlobStore.LocalBlobGarbageCollector,S3BlobStore.S3BlobGarbageCollector
public interface BinaryGarbageCollector
A Garbage Collector for a
BinaryManager.
First, inform the GC that it is started by calling start().
Then for all binaries to mark, call mark(java.lang.String).
Finally when all binaries have been marked, callstop(boolean) to delete the non-marked binaries.
After this, getStatus() returns information about the binaries remaining and those that have been GCed.
-
Method Summary
Modifier and TypeMethodDescriptiongetId()Gets a unique identifier for this garbage collector.Gets the status of the binaries to GC and of those that won't be.booleanChecks if a GC is in progress.voidMarks a binary as being in use.voidstart()Starts the garbage collection process.voidstop(boolean delete) Stops the garbage collection process and deletes all binaries that have not been marked (sweep).
-
Method Details
-
getId
String getId()Gets a unique identifier for this garbage collector. Two garbage collectors that would impact the same files must have the same identifier.- Returns:
- a unique identifier
-
start
void start()Starts the garbage collection process.After this, all active binaries must be fed to the
mark(java.lang.String)method. -
mark
Marks a binary as being in use.- Parameters:
digest- the binary's digest
-
stop
void stop(boolean delete) Stops the garbage collection process and deletes all binaries that have not been marked (sweep).- Parameters:
delete-trueif actual deletion must be performed,falseif the binaries to delete should simply be counted in the status
-
getStatus
BinaryManagerStatus getStatus()Gets the status of the binaries to GC and of those that won't be.Available after
stop(boolean).- Returns:
- the status
-
isInProgress
boolean isInProgress()Checks if a GC is in progress.A GC is in progress is
#starthas been called but not#stop.It's only useful to call this from a separate thread from the one that calls
mark(java.lang.String).- Returns:
trueif a GC is in progress
-