Class ScanAndCompareGarbageCollector

  • All Implemented Interfaces:
    GarbageCollector

    public class ScanAndCompareGarbageCollector
    extends java.lang.Object
    implements GarbageCollector
    Garbage collector implementation using scan and compare.

    Garbage collection is processed as below:

    • fetch all existing ledgers from zookeeper or metastore according to the LedgerManager, called globalActiveLedgers
    • fetch all active ledgers from bookie server, said bkActiveLedgers
    • loop over bkActiveLedgers to find those ledgers that are not in globalActiveLedgers, do garbage collection on them.