Class PartitionInfo


  • public class PartitionInfo
    extends java.lang.Object
    This is used to describe per-partition state in the MetadataResponse.
    • Constructor Summary

      Constructors 
      Constructor Description
      PartitionInfo​(java.lang.String topic, int partition, Node leader, Node[] replicas, Node[] inSyncReplicas)  
      PartitionInfo​(java.lang.String topic, int partition, Node leader, Node[] replicas, Node[] inSyncReplicas, Node[] offlineReplicas)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Node[] inSyncReplicas()
      The subset of the replicas that are in sync, that is caught-up to the leader and ready to take over as leader if the leader should fail
      Node leader()
      The node id of the node currently acting as a leader for this partition or null if there is no leader
      Node[] offlineReplicas()
      The subset of the replicas that are offline
      int partition()
      The partition id
      Node[] replicas()
      The complete set of replicas for this partition regardless of whether they are alive or up-to-date
      java.lang.String topic()
      The topic name
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PartitionInfo

        public PartitionInfo​(java.lang.String topic,
                             int partition,
                             Node leader,
                             Node[] replicas,
                             Node[] inSyncReplicas)
      • PartitionInfo

        public PartitionInfo​(java.lang.String topic,
                             int partition,
                             Node leader,
                             Node[] replicas,
                             Node[] inSyncReplicas,
                             Node[] offlineReplicas)
    • Method Detail

      • topic

        public java.lang.String topic()
        The topic name
      • partition

        public int partition()
        The partition id
      • leader

        public Node leader()
        The node id of the node currently acting as a leader for this partition or null if there is no leader
      • replicas

        public Node[] replicas()
        The complete set of replicas for this partition regardless of whether they are alive or up-to-date
      • inSyncReplicas

        public Node[] inSyncReplicas()
        The subset of the replicas that are in sync, that is caught-up to the leader and ready to take over as leader if the leader should fail
      • offlineReplicas

        public Node[] offlineReplicas()
        The subset of the replicas that are offline
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object