Package org.apache.bookkeeper.bookie
Class TransactionalEntryLogCompactor.ScanEntryLogPhase
java.lang.Object
org.apache.bookkeeper.bookie.TransactionalEntryLogCompactor.CompactionPhase
org.apache.bookkeeper.bookie.TransactionalEntryLogCompactor.ScanEntryLogPhase
- Enclosing class:
- TransactionalEntryLogCompactor
class TransactionalEntryLogCompactor.ScanEntryLogPhase
extends TransactionalEntryLogCompactor.CompactionPhase
Assume we're compacting entry log 1 to entry log 3.
The first phase is to scan entries in 1.log and copy them to compaction log file "3.log.compacting".
We'll try to allocate a new compaction log before scanning to make sure we have a log file to write.
If after scanning, there's no data written, it means there's no valid entries to be compacted,
so we can remove 1.log directly, clear the offsets and end the compaction.
Otherwise, we should move on to the next phase.
If anything failed in this phase, we should delete the compaction log and clean the offsets.
-
Constructor Summary
ConstructorsConstructorDescriptionScanEntryLogPhase(EntryLogMetadata metadata, CompactionEntryLog compactionLog) -
Method Summary
Methods inherited from class org.apache.bookkeeper.bookie.TransactionalEntryLogCompactor.CompactionPhase
run
-
Constructor Details
-
ScanEntryLogPhase
ScanEntryLogPhase(EntryLogMetadata metadata, CompactionEntryLog compactionLog)
-
-
Method Details
-
start
- Specified by:
startin classTransactionalEntryLogCompactor.CompactionPhase- Throws:
IOException
-
complete
boolean complete()- Specified by:
completein classTransactionalEntryLogCompactor.CompactionPhase
-
abort
void abort()- Specified by:
abortin classTransactionalEntryLogCompactor.CompactionPhase
-