Class MongoFullGcNodeBin
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.mongo.MongoFullGcNodeBin
-
- All Implemented Interfaces:
FullGcNodeBin
public class MongoFullGcNodeBin extends Object implements FullGcNodeBin
This class is as a wrapper around DocumentStore that expose two methods used to clean garbage from NODES collection public int remove(MaporphanOrDeletedRemovalMap) public List findAndUpdate(List updateOpList) When enabled Each method saves the document ID or empty properties names (that will be deleted) to a separate _bin collection as a BinDocument then delegates deletion to DocumentStore When disabled (default) Each method delegates directly to DocumentStore
-
-
Field Summary
Fields Modifier and Type Field Description static String
GC_COLLECTED_AT
-
Constructor Summary
Constructors Constructor Description MongoFullGcNodeBin(MongoDocumentStore ds)
MongoFullGcNodeBin(MongoDocumentStore store, boolean fullGcBinEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<NodeDocument>
findAndUpdate(List<UpdateOp> updateOpList)
Performs a conditional update If the bin is enabled, the removed properties are saved to the BIN collection with ID prefixed with '/bin/' and empty value If the document ID and properties cannot be saved then the removal of the property fails If bin is disabled, the removed properties are directly removed from the NODES collectionboolean
isEnabled()
int
remove(Map<String,Long> orphanOrDeletedRemovalMap)
Remove orphaned or deleted documents from the NODES collection If bin is enabled, the document IDs are saved to the BIN collection with ID prefixed with '/bin/' If document ID cannot be saved then the removal of the document fails If the bin is disabled, the document IDs are directly removed from the NODES collectionvoid
setEnabled(boolean value)
Enable or disable the bin
-
-
-
Field Detail
-
GC_COLLECTED_AT
public static final String GC_COLLECTED_AT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MongoFullGcNodeBin
public MongoFullGcNodeBin(MongoDocumentStore ds)
-
MongoFullGcNodeBin
public MongoFullGcNodeBin(MongoDocumentStore store, boolean fullGcBinEnabled)
-
-
Method Detail
-
remove
public int remove(Map<String,Long> orphanOrDeletedRemovalMap)
Remove orphaned or deleted documents from the NODES collection If bin is enabled, the document IDs are saved to the BIN collection with ID prefixed with '/bin/' If document ID cannot be saved then the removal of the document fails If the bin is disabled, the document IDs are directly removed from the NODES collection- Specified by:
remove
in interfaceFullGcNodeBin
- Parameters:
orphanOrDeletedRemovalMap
- the keys of the documents to remove with the corresponding timestamps- Returns:
- the number of documents removed
- See Also:
DocumentStore.remove(Collection, Map)
-
findAndUpdate
public List<NodeDocument> findAndUpdate(List<UpdateOp> updateOpList)
Performs a conditional update If the bin is enabled, the removed properties are saved to the BIN collection with ID prefixed with '/bin/' and empty value If the document ID and properties cannot be saved then the removal of the property fails If bin is disabled, the removed properties are directly removed from the NODES collection- Specified by:
findAndUpdate
in interfaceFullGcNodeBin
- Parameters:
updateOpList
- the update operation List- Returns:
- the list containing old documents
- See Also:
DocumentStore.findAndUpdate(Collection, List)
-
setEnabled
public void setEnabled(boolean value)
Description copied from interface:FullGcNodeBin
Enable or disable the bin- Specified by:
setEnabled
in interfaceFullGcNodeBin
- Parameters:
value
- true to enable, false to disable
-
isEnabled
public boolean isEnabled()
-
-