Class SnapshotTransferServiceImpl
java.lang.Object
io.camunda.zeebe.snapshots.transfer.SnapshotTransferServiceImpl
- All Implemented Interfaces:
AsyncClosable,SnapshotSenderService,SnapshotTransferService
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.snapshots.transfer.SnapshotTransferService
SnapshotTransferService.TakeSnapshot -
Constructor Summary
ConstructorsConstructorDescriptionSnapshotTransferServiceImpl(PersistedSnapshotStore snapshotStore, SnapshotTransferService.TakeSnapshot takeSnapshot, int partitionId, BiConsumer<Path, Path> copyForBootstrap, ConcurrencyControl concurrency) -
Method Summary
Modifier and TypeMethodDescriptiondeleteSnapshots(int partitionId) Delete the underlying snapshot for bootstrap and terminate all pending transfersgetLatestSnapshot(int partition, long lastProcessedPosition, UUID transferId) Initiate the transfer of the latest snapshot for a partition.getNextChunk(int partition, String snapshotId, String previousChunkName, UUID transferId) Get the next chunk for the snapshot.
-
Constructor Details
-
SnapshotTransferServiceImpl
public SnapshotTransferServiceImpl(PersistedSnapshotStore snapshotStore, SnapshotTransferService.TakeSnapshot takeSnapshot, int partitionId, BiConsumer<Path, Path> copyForBootstrap, ConcurrencyControl concurrency)
-
-
Method Details
-
getLatestSnapshot
public ActorFuture<SnapshotChunk> getLatestSnapshot(int partition, long lastProcessedPosition, UUID transferId) Description copied from interface:SnapshotTransferServiceInitiate the transfer of the latest snapshot for a partition.- Specified by:
getLatestSnapshotin interfaceSnapshotTransferService- Parameters:
partition- the partition to get the snapshot fromlastProcessedPosition- the minimum value of lastProcessedPosition that the snapshot must havetransferId- an identifier to trace the transfer- Returns:
- the first
SnapshotChunk. It must be used in subsequent calls toSnapshotTransferService.getNextChunk(int, java.lang.String, java.lang.String, java.util.UUID)
-
getNextChunk
public ActorFuture<SnapshotChunk> getNextChunk(int partition, String snapshotId, String previousChunkName, UUID transferId) Description copied from interface:SnapshotTransferServiceGet the next chunk for the snapshot.- Specified by:
getNextChunkin interfaceSnapshotTransferService- Parameters:
partition- the partition to request the snapshot fromsnapshotId- the snapshotId of the snapshot being transferredpreviousChunkName- the chunkName of the previous chunk, so that the next one can be identified- Returns:
- null if there is no other chunk or the SnapshotChunk after
-
deleteSnapshots
Description copied from interface:SnapshotSenderServiceDelete the underlying snapshot for bootstrap and terminate all pending transfers- Specified by:
deleteSnapshotsin interfaceSnapshotSenderService- Parameters:
partitionId- the partition for which to delete snapshots
-
closeAsync
- Specified by:
closeAsyncin interfaceAsyncClosable
-