Class 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(Map orphanOrDeletedRemovalMap) 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
    • Constructor Detail

      • 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 interface FullGcNodeBin
        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 interface FullGcNodeBin
        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 interface FullGcNodeBin
        Parameters:
        value - true to enable, false to disable
      • isEnabled

        public boolean isEnabled()