类 LoadManager
- java.lang.Object
-
- org.apache.iotdb.confignode.manager.load.LoadManager
-
public class LoadManager extends java.lang.ObjectThe LoadManager at ConfigNodeGroup-Leader is active. It proactively implements the cluster dynamic load balancing policy and passively accepts the PartitionTable expansion request.
-
-
构造器概要
构造器 构造器 说明 LoadManager(IManager configManager)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.util.Map<java.lang.String,org.apache.iotdb.commons.partition.DataPartitionTable>allocateDataPartition(java.util.Map<java.lang.String,java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList>> unassignedDataPartitionSlotsMap)Allocate DataPartitionsCreateRegionGroupsPlanallocateRegionGroups(java.util.Map<java.lang.String,java.lang.Integer> allotmentMap, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType consensusGroupType)Generate an optimal CreateRegionGroupsPlanjava.util.Map<java.lang.String,org.apache.iotdb.commons.partition.SchemaPartitionTable>allocateSchemaPartition(java.util.Map<java.lang.String,java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>> unassignedSchemaPartitionSlotsMap)Allocate SchemaPartitionsvoidbroadcastLatestRegionRouteMap()java.util.Map<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId,java.lang.Integer>getLatestRegionLeaderMap()java.util.Map<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId,org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet>getLatestRegionRouteMap()Generate an optimal real-time read/write requests routing policy.RouteBalancergetRouteBalancer()voidinitHeartbeatCache()Initialize all kinds of the HeartbeatCache when the ConfigNode-Leader is switchedvoidstartLoadStatisticsService()Start the load statistics servicevoidstopLoadStatisticsService()Stop the load statistics service
-
-
-
构造器详细资料
-
LoadManager
public LoadManager(IManager configManager)
-
-
方法详细资料
-
allocateRegionGroups
public CreateRegionGroupsPlan allocateRegionGroups(java.util.Map<java.lang.String,java.lang.Integer> allotmentMap, org.apache.iotdb.common.rpc.thrift.TConsensusGroupType consensusGroupType) throws NotEnoughDataNodeException, StorageGroupNotExistsException
Generate an optimal CreateRegionGroupsPlan- 参数:
allotmentMap- MapconsensusGroupType- TConsensusGroupType of RegionGroup to be allocated- 返回:
- CreateRegionGroupsPlan
- 抛出:
NotEnoughDataNodeException- If there are not enough DataNodesStorageGroupNotExistsException- If some specific StorageGroups don't exist
-
allocateSchemaPartition
public java.util.Map<java.lang.String,org.apache.iotdb.commons.partition.SchemaPartitionTable> allocateSchemaPartition(java.util.Map<java.lang.String,java.util.List<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot>> unassignedSchemaPartitionSlotsMap) throws NoAvailableRegionGroupExceptionAllocate SchemaPartitions- 参数:
unassignedSchemaPartitionSlotsMap- SchemaPartitionSlots that should be assigned- 返回:
- Map
, the allocating result - 抛出:
NoAvailableRegionGroupException
-
allocateDataPartition
public java.util.Map<java.lang.String,org.apache.iotdb.commons.partition.DataPartitionTable> allocateDataPartition(java.util.Map<java.lang.String,java.util.Map<org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot,org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList>> unassignedDataPartitionSlotsMap) throws NoAvailableRegionGroupExceptionAllocate DataPartitions- 参数:
unassignedDataPartitionSlotsMap- DataPartitionSlots that should be assigned- 返回:
- Map
, the allocating result - 抛出:
NoAvailableRegionGroupException
-
getLatestRegionLeaderMap
public java.util.Map<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId,java.lang.Integer> getLatestRegionLeaderMap()
-
getLatestRegionRouteMap
public java.util.Map<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId,org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet> getLatestRegionRouteMap()
Generate an optimal real-time read/write requests routing policy.- 返回:
- Map
, The routing policy of read/write requests for each Region is based on the order in the TRegionReplicaSet. The replica with higher sorting result have higher priority.
-
startLoadStatisticsService
public void startLoadStatisticsService()
Start the load statistics service
-
stopLoadStatisticsService
public void stopLoadStatisticsService()
Stop the load statistics service
-
broadcastLatestRegionRouteMap
public void broadcastLatestRegionRouteMap()
-
initHeartbeatCache
public void initHeartbeatCache()
Initialize all kinds of the HeartbeatCache when the ConfigNode-Leader is switched
-
getRouteBalancer
public RouteBalancer getRouteBalancer()
-
-