All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.streamnative.pulsar.handlers.kop.storage.ProducerStateManagerSnapshotBuffer Maven / Gradle / Ivy

There is a newer version: 4.0.0.4
Show newest version
/**
 * 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() {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy