com.hazelcast.partition.impl
Class PartitionStateGeneratorImpl

java.lang.Object
  extended by com.hazelcast.partition.impl.PartitionStateGeneratorImpl
All Implemented Interfaces:
PartitionStateGenerator

public final class PartitionStateGeneratorImpl
extends Object
implements PartitionStateGenerator


Constructor Summary
PartitionStateGeneratorImpl()
           
 
Method Summary
 Address[][] initialize(Collection<MemberGroup> memberGroups, int partitionCount)
          Returns the initial layout for the partitions.
 Address[][] reArrange(Collection<MemberGroup> memberGroups, InternalPartition[] currentState)
          Rearranges the partition layout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartitionStateGeneratorImpl

public PartitionStateGeneratorImpl()
Method Detail

initialize

public Address[][] initialize(Collection<MemberGroup> memberGroups,
                              int partitionCount)
Description copied from interface: PartitionStateGenerator
Returns the initial layout for the partitions.

A 2 dimensional array of addresses is returned where the first index is the partition id, and the second index is the replica index.

Specified by:
initialize in interface PartitionStateGenerator
partitionCount - the number of partitions.
Returns:

reArrange

public Address[][] reArrange(Collection<MemberGroup> memberGroups,
                             InternalPartition[] currentState)
Description copied from interface: PartitionStateGenerator
Rearranges the partition layout.

This method does not actually change the partitions, but send back the updated layout.

A 2 dimensional array of addresses is returned where the first index is the partition id, and the second index is the replica index.

Specified by:
reArrange in interface PartitionStateGenerator
currentState - the current partition state.
Returns:


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.