类 TriggerManager


  • public class TriggerManager
    extends java.lang.Object
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      org.apache.iotdb.common.rpc.thrift.TSStatus createTrigger​(org.apache.iotdb.confignode.rpc.thrift.TCreateTriggerReq req)
      Create a trigger in cluster.
      org.apache.iotdb.common.rpc.thrift.TSStatus dropTrigger​(org.apache.iotdb.confignode.rpc.thrift.TDropTriggerReq req)  
      org.apache.iotdb.confignode.rpc.thrift.TGetLocationForTriggerResp getLocationOfStatefulTrigger​(java.lang.String triggerName)  
      TriggerInfo getTriggerInfo()  
      org.apache.iotdb.confignode.rpc.thrift.TGetJarInListResp getTriggerJar​(org.apache.iotdb.confignode.rpc.thrift.TGetJarInListReq req)  
      org.apache.iotdb.confignode.rpc.thrift.TGetTriggerTableResp getTriggerTable​(boolean onlyStateful)  
      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 as TTriggerState.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)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 方法详细资料

      • 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 as TTriggerState.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 with NodeStatus.Running State
        返回:
        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)