public final class TopicPlacement
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TopicPlacement.ConstraintCount |
static class |
TopicPlacement.Replica |
static class |
TopicPlacement.TopicPlacementValidator |
Modifier and Type | Field and Description |
---|---|
static org.apache.kafka.common.config.ConfigDef.Validator |
VALIDATOR |
Modifier and Type | Method and Description |
---|---|
boolean |
hasObserverConstraints() |
boolean |
matchesObservers(java.util.Map<java.lang.String,java.lang.String> attributes)
Determines if a set of attributes matches the observers constraints.
|
boolean |
matchesReplicas(java.util.Map<java.lang.String,java.lang.String> attributes)
Determines if a set of attributes matches the replicas constraints.
|
java.util.List<TopicPlacement.ConstraintCount> |
observers() |
static java.util.Optional<TopicPlacement> |
parse(java.lang.String value) |
java.util.List<TopicPlacement.ConstraintCount> |
replicas() |
java.lang.String |
toJson()
Serialize this object back to json string.
|
java.lang.String |
toString() |
static java.util.Optional<java.lang.String> |
validateAssignment(TopicPlacement topicPlacement,
java.util.List<TopicPlacement.Replica> syncReplicas,
java.util.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 org.apache.kafka.common.config.ConfigDef.Validator VALIDATOR
public java.lang.String toString()
toString
in class java.lang.Object
public int version()
public java.util.List<TopicPlacement.ConstraintCount> replicas()
public java.util.List<TopicPlacement.ConstraintCount> observers()
public boolean hasObserverConstraints()
public boolean matchesReplicas(java.util.Map<java.lang.String,java.lang.String> attributes)
public boolean matchesObservers(java.util.Map<java.lang.String,java.lang.String> attributes)
public static java.util.Optional<TopicPlacement> parse(java.lang.String value)
public java.lang.String toJson()
public static java.util.Optional<java.lang.String> validateAssignment(TopicPlacement topicPlacement, java.util.List<TopicPlacement.Replica> syncReplicas, java.util.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
.