-
Constructor Summary
Constructors
-
Method Summary
int
Returns the master node index for this partition.
int
Returns the replica index for this partition.
-
Constructor Details
-
DefaultPartition
public DefaultPartition(int primary,
int[] replicas)
- Parameters:
primary - the array index of the master
replicas - the array indexes of the replicas.
-
Method Details
-
primary
public int primary()
Returns the master node index for this partition.
- Specified by:
primary in interface Partition
- Returns:
- the master node index.
-
replica
public int replica(int num)
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.
-