Package org.apache.bookkeeper.bookie
Class EntryLogCompactor
- java.lang.Object
-
- org.apache.bookkeeper.bookie.AbstractLogCompactor
-
- org.apache.bookkeeper.bookie.EntryLogCompactor
-
public class EntryLogCompactor extends AbstractLogCompactor
This is the basic entry log compactor to compact entry logs. The compaction is done by scanning the old entry log file, copy the active ledgers to the current entry logger and remove the old entry log when the scan is over.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
EntryLogCompactor.CompactionScannerFactory
A scanner wrapper to check whether a ledger is alive in an entry log file.-
Nested classes/interfaces inherited from class org.apache.bookkeeper.bookie.AbstractLogCompactor
AbstractLogCompactor.LogRemovalListener, AbstractLogCompactor.Throttler
-
-
Field Summary
Fields Modifier and Type Field Description (package private) EntryLogger
entryLogger
(package private) CompactableLedgerStorage
ledgerStorage
(package private) EntryLogCompactor.CompactionScannerFactory
scannerFactory
-
Fields inherited from class org.apache.bookkeeper.bookie.AbstractLogCompactor
conf, logRemovalListener, throttler
-
-
Constructor Summary
Constructors Constructor Description EntryLogCompactor(ServerConfiguration conf, EntryLogger entryLogger, CompactableLedgerStorage ledgerStorage, AbstractLogCompactor.LogRemovalListener logRemover)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
compact(EntryLogMetadata entryLogMeta)
Compact entry log file.-
Methods inherited from class org.apache.bookkeeper.bookie.AbstractLogCompactor
cleanUpAndRecover
-
-
-
-
Field Detail
-
scannerFactory
final EntryLogCompactor.CompactionScannerFactory scannerFactory
-
entryLogger
final EntryLogger entryLogger
-
ledgerStorage
final CompactableLedgerStorage ledgerStorage
-
-
Constructor Detail
-
EntryLogCompactor
public EntryLogCompactor(ServerConfiguration conf, EntryLogger entryLogger, CompactableLedgerStorage ledgerStorage, AbstractLogCompactor.LogRemovalListener logRemover)
-
-
Method Detail
-
compact
public boolean compact(EntryLogMetadata entryLogMeta)
Description copied from class:AbstractLogCompactor
Compact entry log file.- Specified by:
compact
in classAbstractLogCompactor
- Parameters:
entryLogMeta
- log metadata for the entry log to be compacted- Returns:
- true for succeed
-
-