Versions Compared

Key

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

...

Code Block
languagejava
firstline1
titleTaskMetadata.java
linenumberstrue
package org.apache.kafka.streams.processor;

/**
* This function will return a map of TopicPartitions and the highest committed offset seen so far
*/
public Map<TopicPartition, Long> committedOffsets();

/**
* This function will return a map of TopicPartitions and the highest offset seen so far
*/
public Map<TopicPartition, Long> endOffsetshighWatermark();

/**
* This function will return the time task idling started, if the task is not currently idling it will return -1
*/
public Optional<Long> timeCurrentIdlingStarted();

...

In order to make these more accessible we will allow localThreadMetadata() to be called in all states, not just running or rebalancing. This is not a change but the localThreadMetadata() returns the ThreadMetadata for each thread. That ThreadMetadata includes the TaskMetadata for each Task in the thread, this allows for the added methods to be used. There is the potential to have a task missing if it is during a rebalance and the task is being reassigned.

committedOffsets

This method will return a map that contains a mapping of all TopicPartitions and their committed offsets. The committed offset will be the highest seen so far.

...

highWatermark

Similarly this method will return a map that contains a mapping of all TopicPartitions and their end offsetshigh watermark offset.

timeCurrentIdlingStarted

...