Package org.nuxeo.ecm.core.blob
Class CachingBlobStore.CachingBinaryGarbageCollector
java.lang.Object
org.nuxeo.ecm.core.blob.CachingBlobStore.CachingBinaryGarbageCollector
- All Implemented Interfaces:
BinaryGarbageCollector
- Enclosing class:
CachingBlobStore
public class CachingBlobStore.CachingBinaryGarbageCollector
extends Object
implements BinaryGarbageCollector
Garbage collector that delegates to the underlying one, but purges the cache after an actual GC is done.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BinaryGarbageCollectorprotected final BinaryGarbageCollector -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.since 11.5 -
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).
-
Field Details
-
delegate
-
cacheDelegate
-
-
Constructor Details
-
CachingBinaryGarbageCollector
public CachingBinaryGarbageCollector() -
CachingBinaryGarbageCollector
Deprecated.since 11.5
-
-
Method Details
-
getId
Description copied from interface:BinaryGarbageCollectorGets a unique identifier for this garbage collector. Two garbage collectors that would impact the same files must have the same identifier.- Specified by:
getIdin interfaceBinaryGarbageCollector- Returns:
- a unique identifier
-
start
public void start()Description copied from interface:BinaryGarbageCollectorStarts the garbage collection process.After this, all active binaries must be fed to the
BinaryGarbageCollector.mark(java.lang.String)method.- Specified by:
startin interfaceBinaryGarbageCollector
-
mark
Description copied from interface:BinaryGarbageCollectorMarks a binary as being in use.- Specified by:
markin interfaceBinaryGarbageCollector- Parameters:
key- the binary's digest
-
stop
public void stop(boolean delete) Description copied from interface:BinaryGarbageCollectorStops the garbage collection process and deletes all binaries that have not been marked (sweep).- Specified by:
stopin interfaceBinaryGarbageCollector- Parameters:
delete-trueif actual deletion must be performed,falseif the binaries to delete should simply be counted in the status
-
getStatus
Description copied from interface:BinaryGarbageCollectorGets the status of the binaries to GC and of those that won't be.Available after
BinaryGarbageCollector.stop(boolean).- Specified by:
getStatusin interfaceBinaryGarbageCollector- Returns:
- the status
-
isInProgress
public boolean isInProgress()Description copied from interface:BinaryGarbageCollectorChecks 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
BinaryGarbageCollector.mark(java.lang.String).- Specified by:
isInProgressin interfaceBinaryGarbageCollector- Returns:
trueif a GC is in progress
-