Class GreedyRegionGroupAllocator
java.lang.Object
org.apache.iotdb.confignode.manager.load.balancer.region.GreedyRegionGroupAllocator
- All Implemented Interfaces:
IRegionGroupAllocator
Allocate Region Greedily
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateOptimalRegionReplicasDistribution(Map<Integer, TDataNodeConfiguration> availableDataNodeMap, Map<Integer, Double> freeDiskSpaceMap, List<TRegionReplicaSet> allocatedRegionGroups, List<TRegionReplicaSet> databaseAllocatedRegionGroups, int replicationFactor, TConsensusGroupId consensusGroupId) Generate an optimal RegionReplicas' distribution for a new RegionGroup.
-
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:IRegionGroupAllocatorGenerate an optimal RegionReplicas' distribution for a new RegionGroup.- Specified by:
generateOptimalRegionReplicasDistributionin interfaceIRegionGroupAllocator- Parameters:
availableDataNodeMap- DataNodes that can be used for allocationfreeDiskSpaceMap- The free disk space of the DataNodesallocatedRegionGroups- Allocated RegionGroupsdatabaseAllocatedRegionGroups- Allocated RegionGroups within the same Database with the resultreplicationFactor- Replication factor of TRegionReplicaSetconsensusGroupId- TConsensusGroupId of result TRegionReplicaSet- Returns:
- The optimal TRegionReplicaSet derived by the specified algorithm
-