类 DataNodeRemoveHandler


  • public class DataNodeRemoveHandler
    extends java.lang.Object
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      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.
      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
      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.
      DataNodeToStatusResp checkRemoveDataNodeRequest​(RemoveDataNodePlan removeDataNodePlan)
      check if the remove datanode request illegal
      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 DataNode
      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 DataNode
      org.apache.iotdb.common.rpc.thrift.TDataNodeLocation findDestDataNode​(org.apache.iotdb.common.rpc.thrift.TConsensusGroupId regionId)
      Find dest data node
      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
      static java.lang.String getIdWithRpcEndpoint​(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 node
      LockQueue getRegionMigrateLock()  
      void removeDataNodePersistence​(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation tDataNodeLocation)
      Remove data node in node info
      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.
      void stopDataNode​(org.apache.iotdb.common.rpc.thrift.TDataNodeLocation dataNode)
      Stop old data node
      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
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • 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 DataNode

        createNewRegionPeer 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 ConsensusGroup
        destDataNode - 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 created
        regionId - 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 RegionReplica
        regionId - 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 DataNode

        If the originalDataNode is down, we should delete local data and do other cleanup works manually.

        参数:
        originalDataNode - The DataNodeLocation who contains the original RegionReplica
        regionId - 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 id
        originalDataNode - old location data node
        destDataNode - 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 migrated
        originalDataNode - The DataNode where the region locates
        migrateDestDataNode - The DataNode where the region is to be migrated