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
Constructors Constructor Description ScanEntryLogPhase(EntryLogMetadata metadata, CompactionEntryLog compactionLog)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
abort()
(package private) boolean
complete()
(package private) void
start()
-
Methods inherited from class org.apache.bookkeeper.bookie.TransactionalEntryLogCompactor.CompactionPhase
run
-
-
-
-
Constructor Detail
-
ScanEntryLogPhase
ScanEntryLogPhase(EntryLogMetadata metadata, CompactionEntryLog compactionLog)
-
-
Method Detail
-
start
void start() throws java.io.IOException
- Specified by:
start
in classTransactionalEntryLogCompactor.CompactionPhase
- Throws:
java.io.IOException
-
complete
boolean complete()
- Specified by:
complete
in classTransactionalEntryLogCompactor.CompactionPhase
-
abort
void abort()
- Specified by:
abort
in classTransactionalEntryLogCompactor.CompactionPhase
-
-