Class SnapshotSegmentAbortedTxnProcessorImpl.PersistentWorker

java.lang.Object
org.apache.pulsar.broker.transaction.buffer.impl.SnapshotSegmentAbortedTxnProcessorImpl.PersistentWorker
Enclosing class:
SnapshotSegmentAbortedTxnProcessorImpl

public class SnapshotSegmentAbortedTxnProcessorImpl.PersistentWorker extends Object
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.