Class ClusterNodeStartUtils

java.lang.Object
org.apache.iotdb.confignode.manager.node.ClusterNodeStartUtils

public class ClusterNodeStartUtils extends Object
Startup check utils before register/restart a ConfigNode/DataNode.
  • Field Details

    • ACCEPT_NODE_REGISTRATION

      public static final TSStatus ACCEPT_NODE_REGISTRATION
    • ACCEPT_NODE_RESTART

      public static final TSStatus ACCEPT_NODE_RESTART
  • Method Details

    • confirmClusterId

      public static TSStatus confirmClusterId(ConfigManager configManager)
    • confirmDataNodeRegistration

      public static TSStatus confirmDataNodeRegistration(TDataNodeRegisterReq req, ConfigManager configManager)
    • confirmConfigNodeRegistration

      public static TSStatus confirmConfigNodeRegistration(TConfigNodeRegisterReq req, ConfigManager configManager)
    • confirmAINodeRegistration

      public static TSStatus confirmAINodeRegistration(TAINodeRegisterReq req, ConfigManager configManager)
    • checkConflictTEndPointForNewAINode

      public static List<TEndPoint> checkConflictTEndPointForNewAINode(TAINodeLocation newAINodeLocation, List<TAINodeConfiguration> registeredAINodes)
      Check if there exist conflict TEndPoints on the DataNode to be registered.
      Parameters:
      newAINodeLocation - The TDataNodeLocation of the DataNode to be registered
      registeredAINodes - All registered DataNodes
      Returns:
      The conflict TEndPoints if exist
    • confirmNodeRestart

      public static TSStatus confirmNodeRestart(NodeType nodeType, String clusterName, String clusterId, int nodeId, Object nodeLocation, ConfigManager configManager)
    • checkConflictTEndPointForNewConfigNode

      public static List<TEndPoint> checkConflictTEndPointForNewConfigNode(TConfigNodeLocation newConfigNodeLocation, List<TConfigNodeLocation> registeredConfigNodes)
      Check if there exist conflict TEndPoints on the ConfigNode to be registered.
      Parameters:
      newConfigNodeLocation - The TConfigNode of the ConfigNode to be registered
      registeredConfigNodes - All registered ConfigNodes
      Returns:
      The conflict TEndPoints if exist
    • checkConflictTEndPointForNewDataNode

      public static List<TEndPoint> checkConflictTEndPointForNewDataNode(TDataNodeLocation newDataNodeLocation, List<TDataNodeConfiguration> registeredDataNodes)
      Check if there exist conflict TEndPoints on the DataNode to be registered.
      Parameters:
      newDataNodeLocation - The TDataNodeLocation of the DataNode to be registered
      registeredDataNodes - All registered DataNodes
      Returns:
      The conflict TEndPoints if exist
    • matchRegisteredConfigNode

      public static TConfigNodeLocation matchRegisteredConfigNode(TConfigNodeLocation configNodeLocation, List<TConfigNodeLocation> registeredConfigNodes)
      Check if there exists a registered ConfigNode who has the same index of the given one.
      Parameters:
      configNodeLocation - The given ConfigNode
      registeredConfigNodes - Registered ConfigNodes
      Returns:
      The ConfigNodeLocation who has the same index of the given one, null otherwise.
    • matchRegisteredAINode

      public static TAINodeLocation matchRegisteredAINode(TAINodeLocation aiNodeLocation, List<TAINodeConfiguration> registeredAINodes)
      Check if there exists a registered AINode who has the same index of the given one.
      Parameters:
      aiNodeLocation - The given AINode
      registeredAINodes - Registered AINodes
      Returns:
      The AINodeLocation who has the same index of the given one, null otherwise.
    • matchRegisteredDataNode

      public static TDataNodeLocation matchRegisteredDataNode(TDataNodeLocation dataNodeLocation, List<TDataNodeConfiguration> registeredDataNodes)
      Check if there exists a registered DataNode who has the same index of the given one.
      Parameters:
      dataNodeLocation - The given DataNode
      registeredDataNodes - Registered DataNodes
      Returns:
      The DataNodeLocation who has the same index of the given one, null otherwise.
    • checkUpdatedTEndPointOfConfigNode

      public static Set<Integer> checkUpdatedTEndPointOfConfigNode(TConfigNodeLocation restartLocation, TConfigNodeLocation recordLocation)
      Check if some TEndPoints of the specified ConfigNode have updated.
      Parameters:
      restartLocation - The location of restart ConfigNode
      recordLocation - The record ConfigNode location
      Returns:
      The set of TEndPoints that have modified.
    • checkUpdatedTEndPointOfDataNode

      public static Set<Integer> checkUpdatedTEndPointOfDataNode(TDataNodeLocation restartLocation, TDataNodeLocation recordLocation)
      Check if some TEndPoints of the specified DataNode have updated.
      Parameters:
      restartLocation - The location of restart DataNode
      recordLocation - The record DataNode location
      Returns:
      The set of TEndPoints that have modified.