Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleAdminClient.java
    /**
     * <p>Commits offsets for the specified group.
     *
     * <p>This is a convenience method for {@link #commitOffsets(String, Map, CommitOffsetsOptions)} with default options.
     * See the overload for more details.
     *
     * @param groupId The group for which to commit offsets.
     * @param offsets A map of offsets by partition with associated metadata.
     * @return The CommitOffsetsResult.
     */
    public CommitOffsetsResult commitOffsetscommitConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets) {
        return commitOffsets(groupId, offsets, new CommitOffsetsOptions());
    }

    /**
     * <p>Commits offsets for the specified group.
     *
     * <p>This operation is not transactional so it may succeed for some partition while fail for others.
     *
     * @param groupId The group for which to commit offsets.
     * @param offsets A map of offsets by partition with associated metadata.
     * @param options The options to use when committing the offsets.
     * @return The CommitOffsetsResult.
     */
    public abstract CommitOffsetsResult commitOffsetscommitConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, CommitOffsetsOptions options);

    /**
     * <p>List offset for the specified partitions.
     *
     * <p>This is a convenience method for {@link #listOffsets(Collection, ListOffsetsOptions)} which returns the
     * latest uncommitted offsets.
     *
     * @param topicPartitionOffsets The topicPartitionsmapping Afrom listpartition ofto {@linkthe TopicPartition}timestamp to retrievelook offsets forup.
     * @return The ListOffsetsResult.
     */
    public ListOffsetsResult listOffsets(Collection<TopicPartition> topicPartitionsMap<TopicPartition, Long> topicPartitionOffsets) {
        return listOffsets(topicPartitionstopicPartitionOffsets, ListOffsetsOptions.latestUncommitted());
    }


    /**
     * <p>List offset for the specified partitions.
     *
     * @param topicPartitionOffsets The topicPartitionsmapping Afrom listpartition ofto {@linkthe TopicPartition}timestamp to retrievelook offsets forup.
     * @param options The options to use when retrieving the offsets
     * @return The ListOffsetsResult.
     */
    public abstract ListOffsetsResult listOffsets(Collection<TopicPartition> topicPartitionsMap<TopicPartition, Long> topicPartitionOffsets, ListOffsetsOptions options);

...

  • CommitOffsetsOptions


    Code Block
    languagejava
    titleCommitOffsetsOptions.java
    /**
     * Options for the {@link AdminClient#commitOffsets(String, org.apache.kafka.clients.consumer.OffsetAndMetadata, CommitOffsetsOptions) call.
     *
     * The API of this class is evolving, see {@link AdminClient} for details.
     */
    @InterfaceStability.Evolving
    public class CommitOffsetsOptions extends AbstractOptions<CommitOffsetsOptions> {
    }


  • ListOffsetsResult


    Code Block
    languagejava
    titleListOffsetsResult.java
    /**
     * The result of the {@link AdminClient#listOffsets(String)} call.
     *
     * The API of this class is evolving, see {@link AdminClient} for details.
     */
    @InterfaceStability.Evolving
    public class ListOffsetsResult {
    
        public ListOffsetsResult(Map<TopicPartition, KafkaFuture<ListOffsetsResultInfo>> futures) {}
    
        /**
         * Return a map from TopicPartition to futures which can be used to retrieve the offsets
         */
        public Map<TopicPartition, KafkaFuture<ListOffsetsResultInfo>> values() {}
    
        /**
         * Return a future which succeeds only if offsets for all specified partitions have been successfully
         * retrieved.
         */
        public KafkaFuture<Map<TopicPartition, ListOffsetsResultInfo>> all() {}
    
        static public class ListOffsetsResultInfo {
    
            ListOffsetsResultInfo(long offset, long timestamp) {}
    
            long getOffset() {}
            long getTimestamp() {}
        }
    }


  • ListOffsetsOptions



    Code Block
    languagejava
    titleListOffsetsOptions.java
    /**
     * Options for {@link AdminClient#listOffsets()}.
     *
     * The API of this class is evolving, see {@link AdminClient} for details.
     */
    @InterfaceStability.Evolving
    public class ListOffsetsOptions extends AbstractOptions<ListOffsetsOptions> {
    
        private final long timestamp;
        private final String isolationLevel;
    
        public static ListOffsetsOptions latestUncommitted() {}
    
        public static ListOffsetsOptions latestCommitted() {}
    
        public static ListOffsetsOptions earliestUncommitted() {}
    
        public static ListOffsetsOptions earliestCommitted() {}
    
        public ListOffsetsOptions(long timestamp, String isolationLevel) {}
    
        public long timestamp() {}
    
        public String isolationLevel() {}
    }



...

  • public CommitOffsetsResult commitOffsetscommitConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets) {}
  • public abstract CommitOffsetsResult commitOffsetscommitConsumerGroupOffsets(String groupId, Map<TopicPartition, OffsetAndMetadata> offsets, CommitOffsetsOptions options);
  • public ListOffsetsResult listOffsets(Collection<TopicPartition> topicPartitionsMap<TopicPartition, Long> topicPartitionOffsets) {}
  • public abstract ListOffsetsResult listOffsets(Collection<TopicPartition> topicPartitionsMap<TopicPartition, Long> topicPartitionOffsets, ListOffsetsOptions options);

...