Class DefaultCheckpointMetadata<T>

    • Constructor Detail

      • DefaultCheckpointMetadata

        public DefaultCheckpointMetadata​(org.apache.kafka.common.TopicPartition topicPartition,
                                         long recordOffset,
                                         KafkaCheckpointCommit.CheckpointState<T> checkpointState)
    • Method Detail

      • fromMessage

        public static <S> DefaultCheckpointMetadata<S> fromMessage​(org.eclipse.microprofile.reactive.messaging.Message<?> message)
      • getTopicPartition

        public org.apache.kafka.common.TopicPartition getTopicPartition()
        Specified by:
        getTopicPartition in interface CheckpointMetadata<T>
        Returns:
        the topic-partition of this record
      • isPersistOnAck

        public boolean isPersistOnAck()
        Specified by:
        isPersistOnAck in interface CheckpointMetadata<T>
        Returns:
        true if the processing state will be persisted on message acknowledgement
      • setNext

        public T setNext​(T state,
                         boolean persistOnAck)
        Description copied from interface: CheckpointMetadata
        Set the next processing state to the given state, associated with the current record offset + 1.
        Specified by:
        setNext in interface CheckpointMetadata<T>
        Parameters:
        state - the next state
        persistOnAck - If true then the state will be persisted on message acknowledgement
        Returns:
        the previous state
      • setNext

        public T setNext​(T state)
        Description copied from interface: CheckpointMetadata
        Set the next processing state to the given state, associated with the current record offset + 1. The state will not be persisted on message acknowledgement.
        Specified by:
        setNext in interface CheckpointMetadata<T>
        Parameters:
        state - the next state
        Returns:
        the previous state
      • transform

        public T transform​(Supplier<T> initialStateSupplier,
                           Function<T,​T> transformation,
                           boolean persistOnAck)
        Description copied from interface: CheckpointMetadata
        Apply the transformation to the current state, if a previous state doesn't exist, start the transformation from the supplied initial state. The state will be associated with the current record offset + 1.
        Specified by:
        transform in interface CheckpointMetadata<T>
        Parameters:
        initialStateSupplier - if no previous state does exist, start the transformation from this state.
        transformation - the transformation function
        persistOnAck - If true then the state will be persisted on message acknowledgement
        Returns:
        the previous state