java.lang.Object
org.apache.iotdb.confignode.persistence.cq.CQInfo
All Implemented Interfaces:
SnapshotProcessor

@ThreadSafe public class CQInfo extends Object implements SnapshotProcessor
  • Constructor Details

    • CQInfo

      public CQInfo()
  • Method Details

    • addCQ

      public TSStatus addCQ(AddCQPlan plan)
      Add a new CQ only if there was no mapping for this cqId, otherwise ignore this operation.
      Returns:
      SUCCESS_STATUS if there was no mapping for this cqId, otherwise CQ_AlREADY_EXIST
    • dropCQ

      public TSStatus dropCQ(DropCQPlan plan)
      Drop the CQ whose ID is same as cqId in plan.
      Returns:
      SUCCESS_STATUS if there is CQ whose ID and md5 is same as cqId in plan, otherwise NO_SUCH_CQ.
    • showCQ

      public ShowCQResp showCQ()
    • activeCQ

      public TSStatus activeCQ(ActiveCQPlan plan)
      Change the state of cq to ACTIVE.
      Returns:
      Optional.empty() if there is no such cq, otherwise previous state of this cq.
    • updateCQLastExecutionTime

      public TSStatus updateCQLastExecutionTime(UpdateCQLastExecTimePlan plan)
      Update the last execution time of the corresponding CQ.
      Returns:
      SUCCESS_STATUS if successfully updated, or NO_SUCH_CQ if 1. the CQ doesn't exist; or 2. md5 is different. or CQ_UPDATE_LAST_EXEC_TIME_FAILED 3. original lastExecutionTime >= current lastExecutionTime;
    • processTakeSnapshot

      public boolean processTakeSnapshot(File snapshotDir) throws org.apache.thrift.TException, IOException
      Specified by:
      processTakeSnapshot in interface SnapshotProcessor
      Throws:
      org.apache.thrift.TException
      IOException
    • processLoadSnapshot

      public void processLoadSnapshot(File snapshotDir) throws org.apache.thrift.TException, IOException
      Specified by:
      processLoadSnapshot in interface SnapshotProcessor
      Throws:
      org.apache.thrift.TException
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object