public final class TopicPlacement extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TopicPlacement.ConstraintCount |
static class |
TopicPlacement.ObserverPromotionPolicy |
static class |
TopicPlacement.Replica |
static class |
TopicPlacement.TopicPlacementValidator |
Modifier and Type | Field and Description |
---|---|
static int |
LATEST_VERSION |
static org.apache.kafka.common.config.ConfigDef.Validator |
VALIDATOR |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
hasObserverConstraints() |
boolean |
matchesObservers(Map<String,String> attributes)
Determines if a set of attributes matches the observers constraints.
|
boolean |
matchesReplicas(Map<String,String> attributes)
Determines if a set of attributes matches the replicas constraints.
|
TopicPlacement.ObserverPromotionPolicy |
observerPromotionPolicy() |
List<TopicPlacement.ConstraintCount> |
observers() |
static Optional<TopicPlacement> |
parse(String value) |
List<TopicPlacement.ConstraintCount> |
replicas() |
String |
toJson()
Serialize this object back to json string.
|
String |
toString() |
static Optional<String> |
validateAssignment(TopicPlacement topicPlacement,
List<TopicPlacement.Replica> syncReplicas,
List<TopicPlacement.Replica> observers)
Returns an error string if the sync and observer replica assignment doesn't match the constraints.
|
int |
version() |
public static final int LATEST_VERSION
public static final org.apache.kafka.common.config.ConfigDef.Validator VALIDATOR
public int version()
public TopicPlacement.ObserverPromotionPolicy observerPromotionPolicy()
public List<TopicPlacement.ConstraintCount> replicas()
public List<TopicPlacement.ConstraintCount> observers()
public boolean hasObserverConstraints()
public boolean matchesReplicas(Map<String,String> attributes)
public boolean matchesObservers(Map<String,String> attributes)
public static Optional<TopicPlacement> parse(String value)
public String toJson()
public static Optional<String> validateAssignment(TopicPlacement topicPlacement, List<TopicPlacement.Replica> syncReplicas, List<TopicPlacement.Replica> observers)
TopicPlacement.Replica
for a description of the type.topicPlacement
- The replica placement constraint to use to validate the assignment.syncReplicas
- The list sync replicas in the assignment. See TopicPlacement.Replica
.observers
- The list observer replicas in the assignment. See TopicPlacement.Replica
.