public TGetTriggerTableResp getTriggerTable(boolean onlyStateful) {
    try {
      return ((TriggerTableResp)
              configManager.getConsensusManager().read(new GetTriggerTablePlan(onlyStateful)))
          .convertToThriftResponse();
    } catch (IOException | ConsensusException e) {
      LOGGER.error("Fail to get TriggerTable", e);
      return new TGetTriggerTableResp(
          new TSStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode())
              .setMessage(e.getMessage()),
          Collections.emptyList());
    }
  }
Create a trigger in cluster.

<p>If TriggerType is STATELESS, we should create TriggerInstance on all DataNodes, the
DataNodeLocation in TriggerInformation will be null.

<p>If TriggerType is STATEFUL, we should create TriggerInstance on the DataNode with the lowest
load, and DataNodeLocation of this DataNode will be saved.

<p>All DataNodes will add TriggerInformation of this trigger in local TriggerTable.

@param req the createTrigger request
@return status of create this trigger
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/TriggerManager.java