类 TriggerManager
- java.lang.Object
-
- org.apache.iotdb.confignode.manager.TriggerManager
-
public class TriggerManager extends java.lang.Object
-
-
构造器概要
构造器 构造器 说明 TriggerManager(ConfigManager configManager, TriggerInfo triggerInfo)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 org.apache.iotdb.common.rpc.thrift.TSStatuscreateTrigger(org.apache.iotdb.confignode.rpc.thrift.TCreateTriggerReq req)Create a trigger in cluster.org.apache.iotdb.common.rpc.thrift.TSStatusdropTrigger(org.apache.iotdb.confignode.rpc.thrift.TDropTriggerReq req)org.apache.iotdb.confignode.rpc.thrift.TGetLocationForTriggerRespgetLocationOfStatefulTrigger(java.lang.String triggerName)TriggerInfogetTriggerInfo()org.apache.iotdb.confignode.rpc.thrift.TGetJarInListRespgetTriggerJar(org.apache.iotdb.confignode.rpc.thrift.TGetJarInListReq req)org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableRespgetTriggerTable(boolean onlyStateful)org.apache.iotdb.common.rpc.thrift.TSStatustransferTrigger(java.util.List<org.apache.iotdb.common.rpc.thrift.TDataNodeLocation> newUnknownDataNodeList, java.util.Map<java.lang.Integer,org.apache.iotdb.common.rpc.thrift.TDataNodeLocation> dataNodeLocationMap)Step1: Mark Stateful Triggers on UnknownDataNodes asTTriggerState.TRANSFERRING.java.util.List<org.apache.iotdb.common.rpc.thrift.TSStatus>updateTriggerLocation(java.lang.String triggerName, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation dataNodeLocation, java.util.Map<java.lang.Integer,org.apache.iotdb.common.rpc.thrift.TDataNodeLocation> dataNodeLocationMap)
-
-
-
构造器详细资料
-
TriggerManager
public TriggerManager(ConfigManager configManager, TriggerInfo triggerInfo)
-
-
方法详细资料
-
getTriggerInfo
public TriggerInfo getTriggerInfo()
-
createTrigger
public org.apache.iotdb.common.rpc.thrift.TSStatus createTrigger(org.apache.iotdb.confignode.rpc.thrift.TCreateTriggerReq req)
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.
- 参数:
req- the createTrigger request- 返回:
- status of create this trigger
-
dropTrigger
public org.apache.iotdb.common.rpc.thrift.TSStatus dropTrigger(org.apache.iotdb.confignode.rpc.thrift.TDropTriggerReq req)
-
getTriggerTable
public org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableResp getTriggerTable(boolean onlyStateful)
-
getLocationOfStatefulTrigger
public org.apache.iotdb.confignode.rpc.thrift.TGetLocationForTriggerResp getLocationOfStatefulTrigger(java.lang.String triggerName)
-
getTriggerJar
public org.apache.iotdb.confignode.rpc.thrift.TGetJarInListResp getTriggerJar(org.apache.iotdb.confignode.rpc.thrift.TGetJarInListReq req)
-
transferTrigger
public org.apache.iotdb.common.rpc.thrift.TSStatus transferTrigger(java.util.List<org.apache.iotdb.common.rpc.thrift.TDataNodeLocation> newUnknownDataNodeList, java.util.Map<java.lang.Integer,org.apache.iotdb.common.rpc.thrift.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.
- 参数:
dataNodeLocationMap- The DataNodes withNodeStatus.RunningState- 返回:
- result of transferTrigger
-
updateTriggerLocation
public java.util.List<org.apache.iotdb.common.rpc.thrift.TSStatus> updateTriggerLocation(java.lang.String triggerName, org.apache.iotdb.common.rpc.thrift.TDataNodeLocation dataNodeLocation, java.util.Map<java.lang.Integer,org.apache.iotdb.common.rpc.thrift.TDataNodeLocation> dataNodeLocationMap)
-
-