Class GreedyRegionGroupAllocator

java.lang.Object
org.apache.iotdb.confignode.manager.load.balancer.region.GreedyRegionGroupAllocator
All Implemented Interfaces:
IRegionGroupAllocator

public class GreedyRegionGroupAllocator extends Object implements IRegionGroupAllocator
Allocate Region Greedily
  • Constructor Details

    • GreedyRegionGroupAllocator

      public GreedyRegionGroupAllocator()
  • Method Details

    • generateOptimalRegionReplicasDistribution

      public TRegionReplicaSet generateOptimalRegionReplicasDistribution(Map<Integer,TDataNodeConfiguration> availableDataNodeMap, Map<Integer,Double> freeDiskSpaceMap, List<TRegionReplicaSet> allocatedRegionGroups, List<TRegionReplicaSet> databaseAllocatedRegionGroups, int replicationFactor, TConsensusGroupId consensusGroupId)
      Description copied from interface: IRegionGroupAllocator
      Generate an optimal RegionReplicas' distribution for a new RegionGroup.
      Specified by:
      generateOptimalRegionReplicasDistribution in interface IRegionGroupAllocator
      Parameters:
      availableDataNodeMap - DataNodes that can be used for allocation
      freeDiskSpaceMap - The free disk space of the DataNodes
      allocatedRegionGroups - Allocated RegionGroups
      databaseAllocatedRegionGroups - Allocated RegionGroups within the same Database with the result
      replicationFactor - Replication factor of TRegionReplicaSet
      consensusGroupId - TConsensusGroupId of result TRegionReplicaSet
      Returns:
      The optimal TRegionReplicaSet derived by the specified algorithm