Versions Compared

Key

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

...

Deprecate the taskId() getter that returns the task id as a string , and add an API to return the actual TaskId, also deprecate the string constructor and replace with one that accepts a TaskId:

Code Block
languagejava
titleTaskMetadata
class TaskMetadata {

	/**
     * @deprecated since 3.0, please use the constructor that accepts a TaskId object instead of a String
     */
    @Deprecated
    public TaskMetadata(final TaskId taskId, // changed from String to TaskIdString taskId,
                        final Set<TopicPartition> topicPartitions,
                        final Map<TopicPartition, Long> committedOffsets,
                        final Map<TopicPartition, Long> endOffsets,
                        final Optional<Long> timeCurrentIdlingStarted);

	// new
    public TaskMetadata(final TaskId taskId,
                        final Set<TopicPartition> topicPartitions,
                        final Map<TopicPartition, Long> committedOffsets,
                        final Map<TopicPartition, Long> endOffsets,
                        final Optional<Long> timeCurrentIdlingStarted);

    /**
     * @return the basic task metadata such as subtopology and partition id
     */
    public TaskId getTaskId() {
        return taskId;
    }

    /**
     * @return the basic task metadata such as subtopology and partition id
     * @deprecated please use {@link #getTaskId()} instead.
     */
    @Deprecated
    public String taskId() {
        return taskId.toString();
    }
}

...