public TSStatus addCQ(AddCQPlan plan) {
    TSStatus res = new TSStatus();
    String cqId = plan.getReq().cqId;
    lock.writeLock().lock();
    try {
      if (cqMap.containsKey(cqId)) {
        res.code = TSStatusCode.CQ_ALREADY_EXIST.getStatusCode();
        res.message = String.format("CQ %s has already been created.", cqId);
      } else {
        CQEntry cqEntry =
            new CQEntry(
                plan.getReq(),
                plan.getMd5(),
                plan.getFirstExecutionTime() - plan.getReq().everyInterval);
        cqMap.put(cqId, cqEntry);
        res.code = TSStatusCode.SUCCESS_STATUS.getStatusCode();
      }
      return res;
    } finally {
      lock.writeLock().unlock();
    }
  }
Add a new CQ only if there was no mapping for <tt>this cqId</tt>, otherwise ignore this
operation.

@return SUCCESS_STATUS if there was no mapping for <tt>this cqId</tt>, otherwise
    CQ_AlREADY_EXIST
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/cq/CQInfo.java