io.streamnative.pulsar.handlers.kop.storage.ProducerStateManagerSnapshotBuffer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulsar-protocol-handler-kafka Show documentation
Show all versions of pulsar-protocol-handler-kafka Show documentation
Kafka on Pulsar implemented using Pulsar Protocol Handler
/**
* Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved.
*/
package io.streamnative.pulsar.handlers.kop.storage;
import java.util.concurrent.CompletableFuture;
public interface ProducerStateManagerSnapshotBuffer {
/**
* Write the snapshot to the storage.
*
* @param snapshot the snapshot
* @return the future that indicates if the write operation succeeds
*/
CompletableFuture write(ProducerStateManagerSnapshot snapshot);
/**
* Read the latest snapshot of the partition.
*
* @param partitionName the topic-partition name of the Pulsar format, e.g.
* "persistent://public/default/my-topic-partition-0"
* @return the future of the latest snapshot whose value is null if the partition's snapshot does not exist
*/
CompletableFuture readLatestSnapshot(String partitionName);
default void shutdown() {
}
}