forked from apache/kafka
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KAFKA-15045: (KIP-924 pt. 5) Add rack information to ApplicationState (…
…apache#15972) This rack information is required to compute rack-aware assignments, which many of the current assigners do. The internal ClientMetadata class was also edited to pass around this rack information. Reviewers: Anna Sophie Blee-Goldman <[email protected]>
- Loading branch information
1 parent
d9da8ca
commit dd275ce
Showing
12 changed files
with
489 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
streams/src/main/java/org/apache/kafka/streams/processor/assignment/TaskInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.kafka.streams.processor.assignment; | ||
|
||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
import org.apache.kafka.common.TopicPartition; | ||
import org.apache.kafka.streams.processor.TaskId; | ||
|
||
/** | ||
* A simple container class corresponding to a given {@link TaskId}. | ||
* Includes metadata such as whether it's stateful and the names of all state stores | ||
* belonging to this task, the set of input topic partitions and changelog topic partitions | ||
* for all logged state stores, and the rack ids of all replicas of each topic partition | ||
* in the task. | ||
*/ | ||
public interface TaskInfo { | ||
|
||
/** | ||
* | ||
* @return The {@code TaskId} of the underlying task. | ||
*/ | ||
TaskId id(); | ||
|
||
/** | ||
* | ||
* @return true if the underlying task is stateful, and false otherwise. | ||
*/ | ||
boolean isStateful(); | ||
|
||
/** | ||
* | ||
* @return the set of state store names that this task makes use of. In the case of stateless tasks, | ||
* this set will be empty as no state stores are used. | ||
*/ | ||
Set<String> stateStoreNames(); | ||
|
||
/** | ||
* | ||
* @return the set of source topic partitions. This set will include both changelog and non-changelog | ||
* topic partitions. | ||
*/ | ||
Set<TopicPartition> sourceTopicPartitions(); | ||
|
||
/** | ||
* | ||
* @return the set of changelog topic partitions. This set will include both source and non-source | ||
* topic partitions. | ||
*/ | ||
Set<TopicPartition> changelogTopicPartitions(); | ||
|
||
/** | ||
* | ||
* @return the mapping of {@code TopicPartition} to set of rack ids that this partition resides on. | ||
*/ | ||
Map<TopicPartition, Set<String>> partitionToRackIds(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.