Class TriggerManager
java.lang.Object
org.apache.iotdb.confignode.manager.TriggerManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a trigger in cluster.getLocationOfStatefulTrigger(String triggerName) getTriggerTable(boolean onlyStateful) transferTrigger(List<TDataNodeLocation> newUnknownDataNodeList, Map<Integer, TDataNodeLocation> dataNodeLocationMap) Step1: Mark Stateful Triggers on UnknownDataNodes asTTriggerState.TRANSFERRING.updateTriggerLocation(String triggerName, TDataNodeLocation dataNodeLocation, Map<Integer, TDataNodeLocation> dataNodeLocationMap)
-
Constructor Details
-
TriggerManager
-
-
Method Details
-
getTriggerInfo
-
createTrigger
Create a trigger in cluster.If TriggerType is STATELESS, we should create TriggerInstance on all DataNodes, the DataNodeLocation in TriggerInformation will be null.
If TriggerType is STATEFUL, we should create TriggerInstance on the DataNode with the lowest load, and DataNodeLocation of this DataNode will be saved.
All DataNodes will add TriggerInformation of this trigger in local TriggerTable.
- Parameters:
req- the createTrigger request- Returns:
- status of create this trigger
-
dropTrigger
-
getTriggerTable
-
getLocationOfStatefulTrigger
-
getTriggerJar
-
transferTrigger
public TSStatus transferTrigger(List<TDataNodeLocation> newUnknownDataNodeList, Map<Integer, TDataNodeLocation> dataNodeLocationMap) Step1: Mark Stateful Triggers on UnknownDataNodes asTTriggerState.TRANSFERRING.Step2: Get all Transferring Triggers marked in Step1.
Step3: For each trigger gotten in Step2, find the DataNode with the lowest load, then transfer the Stateful Trigger to it and update this information on all DataNodes.
Step4: Update the newest location on ConfigNodes.
- Parameters:
dataNodeLocationMap- The DataNodes withNodeStatus.RunningState- Returns:
- result of transferTrigger
-
updateTriggerLocation
public List<TSStatus> updateTriggerLocation(String triggerName, TDataNodeLocation dataNodeLocation, Map<Integer, TDataNodeLocation> dataNodeLocationMap)
-