Class FileCheckpointStateStore
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.commit.FileCheckpointStateStore
-
- All Implemented Interfaces:
CheckpointStateStore
public class FileCheckpointStateStore extends Object implements CheckpointStateStore
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileCheckpointStateStore.Factory
-
Field Summary
Fields Modifier and Type Field Description static String
STATE_STORE_NAME
-
Constructor Summary
Constructors Constructor Description FileCheckpointStateStore(io.vertx.mutiny.core.Vertx vertx, String consumerGroupId, File stateDir, ProcessingStateCodec codec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Map<org.apache.kafka.common.TopicPartition,ProcessingState<?>>>
fetchProcessingState(Collection<org.apache.kafka.common.TopicPartition> partitions)
Fetch the latest processing state for given topic-partitions.protected io.smallrye.mutiny.Uni<ProcessingState<?>>
fetchProcessingState(org.apache.kafka.common.TopicPartition partition)
File
getStateDir()
io.smallrye.mutiny.Uni<Void>
persistProcessingState(Map<org.apache.kafka.common.TopicPartition,ProcessingState<?>> state)
Persist the given processing state in the state storeprotected io.smallrye.mutiny.Uni<Void>
persistProcessingState(org.apache.kafka.common.TopicPartition partition, ProcessingState<?> state)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.smallrye.reactive.messaging.kafka.commit.CheckpointStateStore
close
-
-
-
-
Field Detail
-
STATE_STORE_NAME
public static final String STATE_STORE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileCheckpointStateStore
public FileCheckpointStateStore(io.vertx.mutiny.core.Vertx vertx, String consumerGroupId, File stateDir, ProcessingStateCodec codec)
-
-
Method Detail
-
getStateDir
public File getStateDir()
-
fetchProcessingState
public io.smallrye.mutiny.Uni<Map<org.apache.kafka.common.TopicPartition,ProcessingState<?>>> fetchProcessingState(Collection<org.apache.kafka.common.TopicPartition> partitions)
Description copied from interface:CheckpointStateStore
Fetch the latest processing state for given topic-partitions.Called on Vert.x event loop context
- Specified by:
fetchProcessingState
in interfaceCheckpointStateStore
- Parameters:
partitions
- set of topic-partitions- Returns:
- the
Uni
completing with the map of processing state by topic-partition
-
fetchProcessingState
protected io.smallrye.mutiny.Uni<ProcessingState<?>> fetchProcessingState(org.apache.kafka.common.TopicPartition partition)
-
persistProcessingState
public io.smallrye.mutiny.Uni<Void> persistProcessingState(Map<org.apache.kafka.common.TopicPartition,ProcessingState<?>> state)
Description copied from interface:CheckpointStateStore
Persist the given processing state in the state storeCalled on Vert.x event loop context
- Specified by:
persistProcessingState
in interfaceCheckpointStateStore
- Parameters:
state
- map of processing state by topic-partition- Returns:
- the
Uni
completing when the persist operation is completed.
-
persistProcessingState
protected io.smallrye.mutiny.Uni<Void> persistProcessingState(org.apache.kafka.common.TopicPartition partition, ProcessingState<?> state)
-
-