Class NodeManager
java.lang.Object
org.apache.iotdb.confignode.manager.node.NodeManager
NodeManager manages cluster node addition and removal requests.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyConfigNode(TConfigNodeLocation configNodeLocation, TNodeVersionInfo versionInfo) Only leader use this interface, record the new ConfigNode's information.checkConfigNodeBeforeRemove(RemoveConfigNodePlan removeConfigNodePlan) Only leader use this interface, check the ConfigNode before remove it.filterConfigNodeThroughStatus(NodeStatus... status) Filter ConfigNodes through the specified NodeStatus.filterDataNodeThroughStatus(NodeStatus... status) Filter DataNodes through the specified NodeStatus.flushOnSpecificDN(TFlushReq req, Map<Integer, TDataNodeLocation> dataNodeLocationMap) Get TDataNodeConfiguration.intGet the DataNodeLocation of the DataNode which has the lowest loadScore.getLowestLoadDataNode(Set<Integer> nodes) Get the DataNodeLocation which has the lowest loadScore within input.getRegisteredAINode(int aiNodeId) getRegisteredDataNode(int dataNodeId) Only leader use this interface.intOnly leader use this interface.Only leader use this interface.intOnly leader use this interface.Get system configurations.Kill read on DataNode.merge()Register AINode.Register DataNode.removeAINode(RemoveAINodePlan removeAINodePlan) Remove AINodes.removeDataNode(RemoveDataNodePlan removeDataNodePlan) Removes the specified DataNodes.setDataNodeStatus(TSetDataNodeStatusReq setDataNodeStatusReq) setSystemStatus(String status) showConfiguration(int nodeId) updateConfigNodeIfNecessary(int configNodeId, TNodeVersionInfo versionInfo)
-
Field Details
-
HEARTBEAT_INTERVAL
public static final long HEARTBEAT_INTERVAL -
nodeInfo
-
-
Constructor Details
-
NodeManager
-
-
Method Details
-
getSystemConfiguration
Get system configurations.- Returns:
- ConfigurationResp. The TSStatus will be set to SUCCESS_STATUS.
-
registerDataNode
Register DataNode.- Parameters:
req- TDataNodeRegisterReq- Returns:
- DataNodeConfigurationDataSet. The
TSStatuswill be set toTSStatusCode.SUCCESS_STATUSwhen register success.
-
updateDataNodeIfNecessary
-
removeDataNode
Removes the specified DataNodes.- Parameters:
removeDataNodePlan- the plan detailing which DataNodes to remove- Returns:
- DataNodeToStatusResp, where the TSStatus will be SUCCEED_STATUS if the request is accepted, or DATANODE_NOT_EXIST if any DataNode does not exist.
-
registerConfigNode
-
updateConfigNodeIfNecessary
-
getRegisteredAINodeInfoList
-
getRegisteredAINodes
- Returns:
- All registered AINodes
-
getRegisteredAINode
-
registerAINode
Register AINode. Use synchronized to make sure- Parameters:
req- TAINodeRegisterReq- Returns:
- AINodeConfigurationDataSet. The
TSStatuswill be set toTSStatusCode.SUCCESS_STATUSwhen register success.
-
removeAINode
Remove AINodes.- Parameters:
removeAINodePlan- removeDataNodePlan
-
updateAINodeIfNecessary
-
getAINodeConfiguration
-
getDataNodeConfiguration
Get TDataNodeConfiguration.- Parameters:
req- GetDataNodeConfigurationPlan- Returns:
- The specific DataNode's configuration or all DataNodes' configuration if dataNodeId in GetDataNodeConfigurationPlan is -1
-
getRegisteredNodeCount
public int getRegisteredNodeCount()Only leader use this interface.- Returns:
- The number of registered Nodes
-
getRegisteredDataNodeCount
public int getRegisteredDataNodeCount()Only leader use this interface.- Returns:
- The number of registered DataNodes
-
getRegisteredDataNodes
Only leader use this interface.- Returns:
- All registered DataNodes
-
getRegisteredDataNode
Only leader use this interface.Notice: The result will be an empty TDataNodeConfiguration if the specified DataNode doesn't register
- Parameters:
dataNodeId- The specified DataNode's index- Returns:
- The specified registered DataNode
-
getRegisteredDataNodeLocations
-
getRegisteredConfigNodeLocations
-
getRegisteredDataNodeInfoList
-
getDataNodeCpuCoreCount
public int getDataNodeCpuCoreCount() -
getRegisteredConfigNodes
-
getNodeVersionInfo
-
getRegisteredConfigNodeInfoList
-
applyConfigNode
Only leader use this interface, record the new ConfigNode's information.- Parameters:
configNodeLocation- The new ConfigNode.versionInfo- The new ConfigNode's versionInfo.
-
checkConfigNodeBeforeRemove
Only leader use this interface, check the ConfigNode before remove it.- Parameters:
removeConfigNodePlan- RemoveConfigNodePlan
-
merge
-
flush
-
flushOnSpecificDN
-
clearCache
-
setConfiguration
-
startRpairData
-
stopRepairData
-
submitLoadConfigurationTask
-
showConfiguration
-
setSystemStatus
-
setDataNodeStatus
-
killQuery
Kill read on DataNode.- Parameters:
queryId- the id of specific read need to be killed, it will be NULL if kill all queriesdataNodeId- the DataNode obtains target read, -1 means we will kill all queries on all DataNodes
-
filterConfigNodeThroughStatus
Filter ConfigNodes through the specified NodeStatus.- Parameters:
status- The specified NodeStatus- Returns:
- Filtered ConfigNodes with the specified NodeStatus
-
filterDataNodeThroughStatus
Filter DataNodes through the specified NodeStatus.- Parameters:
status- The specified NodeStatus- Returns:
- Filtered DataNodes with the specified NodeStatus
-
getLowestLoadDataNode
Get the DataNodeLocation of the DataNode which has the lowest loadScore.- Returns:
- TDataNodeLocation with the lowest loadScore
-
getLowestLoadDataNode
Get the DataNodeLocation which has the lowest loadScore within input.- Returns:
- TDataNodeLocation with the lowest loadScore
-