Class ConfigNodeProcedureEnv

java.lang.Object
org.apache.iotdb.confignode.procedure.env.ConfigNodeProcedureEnv

public class ConfigNodeProcedureEnv extends Object
  • Constructor Details

  • Method Details

    • getConfigManager

      public ConfigManager getConfigManager()
    • deleteDatabaseConfig

      public TSStatus deleteDatabaseConfig(String name, boolean isGeneratedByPipe)
      Delete ConfigNode cache, includes ClusterSchemaInfo and PartitionInfo.
      Parameters:
      name - database name
      isGeneratedByPipe - 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/rollback
      deleteSgName - 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 - IOE
      org.apache.thrift.TException - Thrift IOE
    • verifySucceed

      public boolean verifySucceed(TSStatus... status)
    • 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

      public void addConfigNodePeer(TConfigNodeLocation configNodeLocation) throws AddPeerException
      Leader will add the new ConfigNode Peer into ConfigRegion.
      Parameters:
      configNodeLocation - The new ConfigNode
      Throws:
      AddPeerException - When addPeer doesn't success
    • removeConfigNodePeer

      public void removeConfigNodePeer(TConfigNodeLocation tConfigNodeLocation) throws ProcedureException
      Remove peer in Leader node.
      Parameters:
      tConfigNodeLocation - node is removed
      Throws:
      ProcedureException - if failed status
    • deleteConfigNodePeer

      public void deleteConfigNodePeer(TConfigNodeLocation removedConfigNode) throws ProcedureException
      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

      public void applyConfigNode(TConfigNodeLocation configNodeLocation, TNodeVersionInfo versionInfo)
      Leader will record the new ConfigNode's information.
      Parameters:
      configNodeLocation - The new ConfigNode
      versionInfo - The new ConfigNode's versionInfo
    • notifyRegisterSuccess

      public void notifyRegisterSuccess(TConfigNodeLocation configNodeLocation)
      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

      public void markDataNodeAsRemovingAndBroadcast(TDataNodeLocation dataNodeLocation)
      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 the CreateRegionGroupsPlan.
      Returns:
      Those RegionReplicas that failed to create
    • notifyRegionMigrationToAllDataNodes

      public List<TSStatus> notifyRegionMigrationToAllDataNodes(TConsensusGroupId consensusGroupId, boolean isStart)
    • persistRegionGroup

      public void persistRegionGroup(CreateRegionGroupsPlan createRegionGroupsPlan)
    • 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

      public List<TRegionReplicaSet> getAllReplicaSets(String storageGroup)
    • createTriggerOnDataNodes

      public List<TSStatus> createTriggerOnDataNodes(TriggerInformation triggerInformation, org.apache.tsfile.utils.Binary jarFile) throws IOException
      Throws:
      IOException
    • dropTriggerOnDataNodes

      public List<TSStatus> dropTriggerOnDataNodes(String triggerName, boolean needToDeleteJarFile)
    • activeTriggerOnDataNodes

      public List<TSStatus> activeTriggerOnDataNodes(String triggerName)
    • inactiveTriggerOnDataNodes

      public List<TSStatus> inactiveTriggerOnDataNodes(String triggerName)
    • createPipePluginOnDataNodes

      public List<TSStatus> createPipePluginOnDataNodes(PipePluginMeta pipePluginMeta, byte[] jarFile) throws IOException
      Throws:
      IOException
    • dropPipePluginOnDataNodes

      public List<TSStatus> dropPipePluginOnDataNodes(String pipePluginName, boolean needToDeleteJarFile)
    • pushAllPipeMetaToDataNodes

      public Map<Integer,TPushPipeMetaResp> pushAllPipeMetaToDataNodes(List<ByteBuffer> pipeMetaBinaryList)
    • pushSinglePipeMetaToDataNodes

      public Map<Integer,TPushPipeMetaResp> pushSinglePipeMetaToDataNodes(ByteBuffer pipeMetaBinary)
    • dropSinglePipeOnDataNodes

      public Map<Integer,TPushPipeMetaResp> dropSinglePipeOnDataNodes(String pipeNameToDrop)
    • pushMultiPipeMetaToDataNodes

      public Map<Integer,TPushPipeMetaResp> pushMultiPipeMetaToDataNodes(List<ByteBuffer> pipeMetaBinaryList)
    • dropMultiPipeOnDataNodes

      public Map<Integer,TPushPipeMetaResp> dropMultiPipeOnDataNodes(List<String> pipeNamesToDrop)
    • pushAllTopicMetaToDataNodes

      public Map<Integer,TPushTopicMetaResp> pushAllTopicMetaToDataNodes(List<ByteBuffer> topicMetaBinaryList)
    • pushSingleTopicOnDataNode

      public List<TSStatus> pushSingleTopicOnDataNode(ByteBuffer topicMeta)
    • dropSingleTopicOnDataNode

      public List<TSStatus> dropSingleTopicOnDataNode(String topicNameToDrop)
    • pushMultiTopicMetaToDataNodes

      public Map<Integer,TPushTopicMetaResp> pushMultiTopicMetaToDataNodes(List<ByteBuffer> topicMetaBinaryList)
    • dropMultiTopicOnDataNodes

      public Map<Integer,TPushTopicMetaResp> dropMultiTopicOnDataNodes(List<String> topicNamesToDrop)
    • pushAllConsumerGroupMetaToDataNodes

      public Map<Integer,TPushConsumerGroupMetaResp> pushAllConsumerGroupMetaToDataNodes(List<ByteBuffer> consumerGroupMetaBinaryList)
    • pushSingleConsumerGroupOnDataNode

      public List<TSStatus> pushSingleConsumerGroupOnDataNode(ByteBuffer consumerGroupMeta)
    • dropSingleConsumerGroupOnDataNode

      public List<TSStatus> dropSingleConsumerGroupOnDataNode(String consumerGroupNameToDrop)
    • getNodeLock

      public LockQueue getNodeLock()
    • getScheduler

      public ProcedureScheduler getScheduler()
    • getSchedulerLock

      public ReentrantLock getSchedulerLock()
    • getSubmitRegionMigrateLock

      public ReentrantLock getSubmitRegionMigrateLock()
    • getRegionMaintainHandler

      public RegionMaintainHandler getRegionMaintainHandler()
    • getRemoveDataNodeHandler

      public RemoveDataNodeHandler getRemoveDataNodeHandler()