类 DataNodeRemoveHandler
- java.lang.Object
-
- org.apache.iotdb.confignode.procedure.env.DataNodeRemoveHandler
-
public class DataNodeRemoveHandler extends java.lang.Object
-
-
构造器概要
构造器 构造器 说明 DataNodeRemoveHandler(ConfigManager configManager)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 org.apache.iotdb.common.rpc.thrift.TSStatusaddRegionPeer(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation destDataNode, org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)Order the specific ConsensusGroup to add peer for the new RegionReplica.voidbroadcastDisableDataNode(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation disabledDataNode)broadcast these datanode in RemoveDataNodeReq are disabled, so they will not accept read/write requestvoidchangeRegionLeader(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation originalDataNode, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation migrateDestDataNode)Change the leader of given Region.DataNodeToStatusRespcheckRemoveDataNodeRequest(RemoveDataNodePlan removeDataNodePlan)check if the remove datanode request illegalorg.apache.iotdb.common.rpc.thrift.TSStatuscreateNewRegionPeer(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation destDataNode)Create a new RegionReplica and build the ConsensusGroup on the destined DataNodeorg.apache.iotdb.common.rpc.thrift.TSStatusdeleteOldRegionPeer(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation originalDataNode, org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)Delete a Region peer in the given ConsensusGroup and all of its data on the specified DataNodeorg.apache.iotdb.common.rpc.thrift.TDataNodeLocationfindDestDataNode(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)Find dest data nodejava.util.List<org.apache.iotdb.common.rpc.thrift.TDataNodeLocation>findRegionLocations(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)Find all DataNodes which contains the given regionIdstatic java.lang.StringgetIdWithRpcEndpoint(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation location)java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId>getMigratedDataNodeRegions(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation removedDataNode)Get all consensus group id in this nodeLockQueuegetRegionMigrateLock()voidremoveDataNodePersistence(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation tDataNodeLocation)Remove data node in node infoorg.apache.iotdb.common.rpc.thrift.TSStatusremoveRegionPeer(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation originalDataNode, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation destDataNode, org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)Order the specific ConsensusGroup to remove peer for the old RegionReplica.voidstopDataNode(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation dataNode)Stop old data nodevoidupdateRegionLocationCache(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation originalDataNode, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation destDataNode)Update region location cache
-
-
-
构造器详细资料
-
DataNodeRemoveHandler
public DataNodeRemoveHandler(ConfigManager configManager)
-
-
方法详细资料
-
getIdWithRpcEndpoint
public static java.lang.String getIdWithRpcEndpoint(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation location)
-
getMigratedDataNodeRegions
public java.util.List<org.apache.iotdb.common.rpc.thrift.TConsensusGroupId> getMigratedDataNodeRegions(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation removedDataNode)
Get all consensus group id in this node- 参数:
removedDataNode- the DataNode to be removed- 返回:
- group id list to be migrated
-
broadcastDisableDataNode
public void broadcastDisableDataNode(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation disabledDataNode)
broadcast these datanode in RemoveDataNodeReq are disabled, so they will not accept read/write request- 参数:
disabledDataNode- TDataNodeLocation
-
findDestDataNode
public org.apache.iotdb.common.rpc.thrift.TDataNodeLocation findDestDataNode(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)
Find dest data node- 参数:
regionId- region id- 返回:
- dest data node location
-
createNewRegionPeer
public org.apache.iotdb.common.rpc.thrift.TSStatus createNewRegionPeer(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation destDataNode)Create a new RegionReplica and build the ConsensusGroup on the destined DataNodecreateNewRegionPeer should be invoked on a DataNode that doesn't contain any peer of the specific ConsensusGroup, in order to avoid there exists one DataNode who has more than one RegionReplica.
- 参数:
regionId- The given ConsensusGroupdestDataNode- The destined DataNode where the new peer will be created- 返回:
- status
-
addRegionPeer
public org.apache.iotdb.common.rpc.thrift.TSStatus addRegionPeer(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation destDataNode, org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)Order the specific ConsensusGroup to add peer for the new RegionReplica.The add peer interface could be invoked at any DataNode who contains one of the RegionReplica of the specified ConsensusGroup except the new one
- 参数:
destDataNode- The DataNodeLocation where the new RegionReplica is createdregionId- region id- 返回:
- TSStatus
-
removeRegionPeer
public org.apache.iotdb.common.rpc.thrift.TSStatus removeRegionPeer(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation originalDataNode, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation destDataNode, org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)Order the specific ConsensusGroup to remove peer for the old RegionReplica.The remove peer interface could be invoked at any DataNode who contains one of the RegionReplica of the specified ConsensusGroup except the origin one
- 参数:
originalDataNode- The DataNodeLocation who contains the original RegionReplicaregionId- region id- 返回:
- TSStatus
-
deleteOldRegionPeer
public org.apache.iotdb.common.rpc.thrift.TSStatus deleteOldRegionPeer(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation originalDataNode, org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)Delete a Region peer in the given ConsensusGroup and all of its data on the specified DataNodeIf the originalDataNode is down, we should delete local data and do other cleanup works manually.
- 参数:
originalDataNode- The DataNodeLocation who contains the original RegionReplicaregionId- region id- 返回:
- TSStatus
-
updateRegionLocationCache
public void updateRegionLocationCache(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation originalDataNode, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation destDataNode)Update region location cache- 参数:
regionId- region idoriginalDataNode- old location data nodedestDataNode- dest data node
-
findRegionLocations
public java.util.List<org.apache.iotdb.common.rpc.thrift.TDataNodeLocation> findRegionLocations(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)
Find all DataNodes which contains the given regionId- 参数:
regionId- region id- 返回:
- DataNode locations
-
stopDataNode
public void stopDataNode(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation dataNode)
Stop old data node- 参数:
dataNode- old data node
-
checkRemoveDataNodeRequest
public DataNodeToStatusResp checkRemoveDataNodeRequest(RemoveDataNodePlan removeDataNodePlan)
check if the remove datanode request illegal- 参数:
removeDataNodePlan- RemoveDataNodeReq- 返回:
- SUCCEED_STATUS when request is legal.
-
getRegionMigrateLock
public LockQueue getRegionMigrateLock()
-
removeDataNodePersistence
public void removeDataNodePersistence(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation tDataNodeLocation)
Remove data node in node info- 参数:
tDataNodeLocation- data node location
-
changeRegionLeader
public void changeRegionLeader(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation originalDataNode, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation migrateDestDataNode)Change the leader of given Region.For IOT_CONSENSUS, using `changeLeaderForIoTConsensus` method to change the regionLeaderMap maintained in ConfigNode.
For RATIS_CONSENSUS, invoking `changeRegionLeader` DataNode RPC method to change the leader.
- 参数:
regionId- The region to be migratedoriginalDataNode- The DataNode where the region locatesmigrateDestDataNode- The DataNode where the region is to be migrated
-
-