Class ConfigNodeProcedureEnv
java.lang.Object
org.apache.iotdb.confignode.procedure.env.ConfigNodeProcedureEnv
-
Constructor Summary
ConstructorsConstructorDescriptionConfigNodeProcedureEnv(ConfigManager configManager, ProcedureScheduler scheduler) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateRegionGroup(Map<String, Map<TConsensusGroupId, Map<Integer, RegionHeartbeatSample>>> activateRegionGroupMap) Force activating RegionGroup by setting status to Running, therefore the ConfigNode-leader can select leader for it and use it to allocate new PartitionsactiveTriggerOnDataNodes(String triggerName) voidaddConfigNodePeer(TConfigNodeLocation configNodeLocation) Leader will add the new ConfigNode Peer into ConfigRegion.voidaddConsensusGroup(TConfigNodeLocation tConfigNodeLocation) Let the remotely new ConfigNode build the ConsensusGroup.voidapplyConfigNode(TConfigNodeLocation configNodeLocation, TNodeVersionInfo versionInfo) Leader will record the new ConfigNode's information.voidcreateConfigNodeHeartbeatCache(int nodeId) Create a new ConfigNodeHeartbeatCachecreatePipePluginOnDataNodes(PipePluginMeta pipePluginMeta, byte[] jarFile) createTriggerOnDataNodes(TriggerInformation triggerInformation, org.apache.tsfile.utils.Binary jarFile) voiddeleteConfigNodePeer(TConfigNodeLocation removedConfigNode) Remove Consensus Group in removed node.deleteDatabaseConfig(String name, boolean isGeneratedByPipe) Delete ConfigNode cache, includesClusterSchemaInfoandPartitionInfo.doRegionCreation(TConsensusGroupType consensusGroupType, CreateRegionGroupsPlan createRegionGroupsPlan) Do region creations and broadcast theCreateRegionGroupsPlan.dropMultiPipeOnDataNodes(List<String> pipeNamesToDrop) dropMultiTopicOnDataNodes(List<String> topicNamesToDrop) dropPipePluginOnDataNodes(String pipePluginName, boolean needToDeleteJarFile) dropSingleConsumerGroupOnDataNode(String consumerGroupNameToDrop) dropSinglePipeOnDataNodes(String pipeNameToDrop) dropSingleTopicOnDataNode(String topicNameToDrop) dropTriggerOnDataNodes(String triggerName, boolean needToDeleteJarFile) getAllReplicaSets(String storageGroup) inactiveTriggerOnDataNodes(String triggerName) booleaninvalidateCache(String storageGroupName) voidmarkDataNodeAsRemovingAndBroadcast(TDataNodeLocation dataNodeLocation) Mark the given datanode as removing status to avoid read or write request routing to this node.notifyRegionMigrationToAllDataNodes(TConsensusGroupId consensusGroupId, boolean isStart) voidnotifyRegisterSuccess(TConfigNodeLocation configNodeLocation) Leader will notify the new ConfigNode that registration success.voidpersistRegionGroup(CreateRegionGroupsPlan createRegionGroupsPlan) voidpreDeleteDatabase(PreDeleteDatabasePlan.PreDeleteType preDeleteType, String deleteSgName) Pre delete a database.pushAllConsumerGroupMetaToDataNodes(List<ByteBuffer> consumerGroupMetaBinaryList) pushAllPipeMetaToDataNodes(List<ByteBuffer> pipeMetaBinaryList) pushAllTopicMetaToDataNodes(List<ByteBuffer> topicMetaBinaryList) pushMultiPipeMetaToDataNodes(List<ByteBuffer> pipeMetaBinaryList) pushMultiTopicMetaToDataNodes(List<ByteBuffer> topicMetaBinaryList) pushSingleConsumerGroupOnDataNode(ByteBuffer consumerGroupMeta) pushSinglePipeMetaToDataNodes(ByteBuffer pipeMetaBinary) pushSingleTopicOnDataNode(ByteBuffer topicMeta) voidremoveConfigNodePeer(TConfigNodeLocation tConfigNodeLocation) Remove peer in Leader node.voidstopAndClearConfigNode(TConfigNodeLocation tConfigNodeLocation) Stop ConfigNode and remove heartbeatCache.booleanverifySucceed(TSStatus... status)
-
Constructor Details
-
ConfigNodeProcedureEnv
-
-
Method Details
-
getConfigManager
-
deleteDatabaseConfig
Delete ConfigNode cache, includesClusterSchemaInfoandPartitionInfo.- Parameters:
name- database nameisGeneratedByPipe- whether the deletion is triggered by pipe request- Returns:
- tsStatus
-
preDeleteDatabase
public void preDeleteDatabase(PreDeleteDatabasePlan.PreDeleteType preDeleteType, String deleteSgName) Pre delete a database.- Parameters:
preDeleteType- execute/rollbackdeleteSgName- database name
-
invalidateCache
public boolean invalidateCache(String storageGroupName) throws IOException, org.apache.thrift.TException - Parameters:
storageGroupName- database name- Returns:
- ALL SUCCESS OR NOT
- Throws:
IOException- IOEorg.apache.thrift.TException- Thrift IOE
-
verifySucceed
-
addConsensusGroup
public void addConsensusGroup(TConfigNodeLocation tConfigNodeLocation) throws AddConsensusGroupException Let the remotely new ConfigNode build the ConsensusGroup.Actually, the parameter of this method can be empty, adding new raft peer to exist group should invoke createPeer(groupId, emptyList).
- Parameters:
tConfigNodeLocation- New ConfigNode's location- Throws:
AddConsensusGroupException
-
addConfigNodePeer
Leader will add the new ConfigNode Peer into ConfigRegion.- Parameters:
configNodeLocation- The new ConfigNode- Throws:
AddPeerException- When addPeer doesn't success
-
removeConfigNodePeer
Remove peer in Leader node.- Parameters:
tConfigNodeLocation- node is removed- Throws:
ProcedureException- if failed status
-
deleteConfigNodePeer
Remove Consensus Group in removed node.- Parameters:
removedConfigNode- config node location- Throws:
ProcedureException- if failed status
-
stopAndClearConfigNode
public void stopAndClearConfigNode(TConfigNodeLocation tConfigNodeLocation) throws ProcedureException Stop ConfigNode and remove heartbeatCache.- Parameters:
tConfigNodeLocation- config node location- Throws:
ProcedureException- if failed status
-
applyConfigNode
Leader will record the new ConfigNode's information.- Parameters:
configNodeLocation- The new ConfigNodeversionInfo- The new ConfigNode's versionInfo
-
notifyRegisterSuccess
Leader will notify the new ConfigNode that registration success.- Parameters:
configNodeLocation- The new ConfigNode
-
createConfigNodeHeartbeatCache
public void createConfigNodeHeartbeatCache(int nodeId) Create a new ConfigNodeHeartbeatCache- Parameters:
nodeId- the index of the new ConfigNode
-
markDataNodeAsRemovingAndBroadcast
Mark the given datanode as removing status to avoid read or write request routing to this node.- Parameters:
dataNodeLocation- the datanode to be marked as removing status
-
doRegionCreation
public Map<TConsensusGroupId,TRegionReplicaSet> doRegionCreation(TConsensusGroupType consensusGroupType, CreateRegionGroupsPlan createRegionGroupsPlan) Do region creations and broadcast theCreateRegionGroupsPlan.- Returns:
- Those RegionReplicas that failed to create
-
notifyRegionMigrationToAllDataNodes
public List<TSStatus> notifyRegionMigrationToAllDataNodes(TConsensusGroupId consensusGroupId, boolean isStart) -
persistRegionGroup
-
activateRegionGroup
public void activateRegionGroup(Map<String, Map<TConsensusGroupId, Map<Integer, RegionHeartbeatSample>>> activateRegionGroupMap) Force activating RegionGroup by setting status to Running, therefore the ConfigNode-leader can select leader for it and use it to allocate new Partitions- Parameters:
activateRegionGroupMap- Map<Database, Map<RegionGroupId, Map<DataNodeId, activate heartbeat sample>>>
-
getAllReplicaSets
-
createTriggerOnDataNodes
public List<TSStatus> createTriggerOnDataNodes(TriggerInformation triggerInformation, org.apache.tsfile.utils.Binary jarFile) throws IOException - Throws:
IOException
-
dropTriggerOnDataNodes
-
activeTriggerOnDataNodes
-
inactiveTriggerOnDataNodes
-
createPipePluginOnDataNodes
public List<TSStatus> createPipePluginOnDataNodes(PipePluginMeta pipePluginMeta, byte[] jarFile) throws IOException - Throws:
IOException
-
dropPipePluginOnDataNodes
-
pushAllPipeMetaToDataNodes
public Map<Integer,TPushPipeMetaResp> pushAllPipeMetaToDataNodes(List<ByteBuffer> pipeMetaBinaryList) -
pushSinglePipeMetaToDataNodes
-
dropSinglePipeOnDataNodes
-
pushMultiPipeMetaToDataNodes
public Map<Integer,TPushPipeMetaResp> pushMultiPipeMetaToDataNodes(List<ByteBuffer> pipeMetaBinaryList) -
dropMultiPipeOnDataNodes
-
pushAllTopicMetaToDataNodes
public Map<Integer,TPushTopicMetaResp> pushAllTopicMetaToDataNodes(List<ByteBuffer> topicMetaBinaryList) -
pushSingleTopicOnDataNode
-
dropSingleTopicOnDataNode
-
pushMultiTopicMetaToDataNodes
public Map<Integer,TPushTopicMetaResp> pushMultiTopicMetaToDataNodes(List<ByteBuffer> topicMetaBinaryList) -
dropMultiTopicOnDataNodes
-
pushAllConsumerGroupMetaToDataNodes
public Map<Integer,TPushConsumerGroupMetaResp> pushAllConsumerGroupMetaToDataNodes(List<ByteBuffer> consumerGroupMetaBinaryList) -
pushSingleConsumerGroupOnDataNode
-
dropSingleConsumerGroupOnDataNode
-
getNodeLock
-
getScheduler
-
getSchedulerLock
-
getSubmitRegionMigrateLock
-
getRegionMaintainHandler
-
getRemoveDataNodeHandler
-