Class BrokerClusterStateImpl
java.lang.Object
io.camunda.zeebe.gateway.impl.broker.cluster.BrokerClusterStateImpl
- All Implemented Interfaces:
BrokerClusterState
-
Field Summary
Fields inherited from interface io.camunda.zeebe.gateway.impl.broker.cluster.BrokerClusterState
NODE_ID_NULL, PARTITION_ID_NULL, UNKNOWN_NODE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBrokerIfAbsent(int nodeId) voidaddPartitionFollower(int partitionId, int followerId) voidaddPartitionIfAbsent(int partitionId) voidaddPartitionInactive(int partitionId, int brokerId) getBrokerAddress(int brokerId) getBrokerVersion(int brokerId) intgetFollowersForPartition(int partition) getInactiveNodesForPartition(int partition) intgetLeaderForPartition(int partition) intgetPartition(int index) getPartitionHealth(int brokerId, int partitionId) intintintvoidremoveBroker(int brokerId) voidsetBrokerAddressIfPresent(int brokerId, String address) voidsetBrokerVersionIfPresent(int brokerId, String version) voidsetClusterSize(int clusterSize) voidsetPartitionHealthStatus(int brokerId, int partitionId, PartitionHealthStatus status) voidsetPartitionLeader(int partitionId, int leaderId, long term) voidsetPartitionsCount(int partitionsCount) voidsetReplicationFactor(int replicationFactor) toString()
-
Constructor Details
-
BrokerClusterStateImpl
-
BrokerClusterStateImpl
public BrokerClusterStateImpl()
-
-
Method Details
-
setPartitionLeader
public void setPartitionLeader(int partitionId, int leaderId, long term) -
setPartitionHealthStatus
-
addPartitionFollower
public void addPartitionFollower(int partitionId, int followerId) -
addPartitionInactive
public void addPartitionInactive(int partitionId, int brokerId) -
addPartitionIfAbsent
public void addPartitionIfAbsent(int partitionId) -
addBrokerIfAbsent
public void addBrokerIfAbsent(int nodeId) -
setBrokerAddressIfPresent
-
setBrokerVersionIfPresent
-
removeBroker
public void removeBroker(int brokerId) -
getClusterSize
public int getClusterSize()- Specified by:
getClusterSizein interfaceBrokerClusterState
-
setClusterSize
public void setClusterSize(int clusterSize) -
getPartitionsCount
public int getPartitionsCount()- Specified by:
getPartitionsCountin interfaceBrokerClusterState
-
setPartitionsCount
public void setPartitionsCount(int partitionsCount) -
getReplicationFactor
public int getReplicationFactor()- Specified by:
getReplicationFactorin interfaceBrokerClusterState
-
setReplicationFactor
public void setReplicationFactor(int replicationFactor) -
getLeaderForPartition
public int getLeaderForPartition(int partition) - Specified by:
getLeaderForPartitionin interfaceBrokerClusterState
-
getFollowersForPartition
- Specified by:
getFollowersForPartitionin interfaceBrokerClusterState
-
getInactiveNodesForPartition
- Specified by:
getInactiveNodesForPartitionin interfaceBrokerClusterState
-
getRandomBroker
public int getRandomBroker()- Specified by:
getRandomBrokerin interfaceBrokerClusterState- Returns:
- the node id of a random broker or
BrokerClusterState.UNKNOWN_NODE_IDif no brokers are known
-
getPartitions
- Specified by:
getPartitionsin interfaceBrokerClusterState
-
getBrokers
- Specified by:
getBrokersin interfaceBrokerClusterState
-
getBrokerAddress
- Specified by:
getBrokerAddressin interfaceBrokerClusterState
-
getPartition
public int getPartition(int index) - Specified by:
getPartitionin interfaceBrokerClusterState
-
getBrokerVersion
- Specified by:
getBrokerVersionin interfaceBrokerClusterState
-
getPartitionHealth
- Specified by:
getPartitionHealthin interfaceBrokerClusterState
-
toString
-