Class DefaultPartition

    • Constructor Detail

      • DefaultPartition

        public DefaultPartition​(short master,
                                short[] replicas)
        Creates a new DefaultPartition.
        Parameters:
        master - the array index of the master
        replicas - the array indexes of the replicas.
    • Method Detail

      • master

        public short master()
        Description copied from interface: Partition
        Returns the master node index for this partition.
        Specified by:
        master in interface Partition
        Returns:
        the master node index.
      • replica

        public short replica​(int num)
        Description copied from interface: Partition
        Returns the replica index for this partition.
        Specified by:
        replica in interface Partition
        Parameters:
        num - number of replica.
        Returns:
        the replica node index, -1 if not set.