Class SnapshotSegmentAbortedTxnProcessorImpl.PersistentWorker
java.lang.Object
org.apache.pulsar.broker.transaction.buffer.impl.SnapshotSegmentAbortedTxnProcessorImpl.PersistentWorker
- Enclosing class:
- SnapshotSegmentAbortedTxnProcessorImpl
The PersistentWorker be responsible for executing the persistent tasks, including:
1. Write snapshot segment --- Encapsulate a sealed snapshot segment and persistent it. 2. Delete snapshot segment --- Evict expired snapshot segments. 3. Update snapshot indexes --- Update snapshot indexes after writing or deleting snapshot segment or update snapshot indexes metadata regularly. 4. Clear all snapshot segments and indexes. --- Executed when deleting this topic.
* Task 1 and task 2 will be put into a task queue. The tasks in the queue will be executed in order. * If the task queue is empty, task 3 will be executed immediately when it is appended to the worker. Else, the worker will try to execute the tasks in the task queue. * When task 4 was appended into worker, the worker will change the operation state to closed and cancel all tasks in the task queue. finally, execute the task 4 (clear task). If there are race conditions, throw an Exception to let users try again.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendTask(SnapshotSegmentAbortedTxnProcessorImpl.PersistentWorker.OperationType operationType, Supplier<CompletableFuture<Void>> task)
-
Field Details
-
sequenceID
-
-
Constructor Details
-
PersistentWorker
-
-
Method Details
-
appendTask
public CompletableFuture<Void> appendTask(SnapshotSegmentAbortedTxnProcessorImpl.PersistentWorker.OperationType operationType, Supplier<CompletableFuture<Void>> task)
-