public synchronized void create() {
    if (status != null) {
      if (status == PipeStatus.RUNNING) {
        throw new PipeException(MESSAGE_PIPE_TASK_STAGE_HAS_BEEN_STARTED);
      }
      if (status == PipeStatus.DROPPED) {
        throw new PipeException(MESSAGE_PIPE_TASK_STAGE_HAS_BEEN_DROPPED);
      }
      // status == PipeStatus.STOPPED
      if (hasBeenExternallyStopped) {
        throw new PipeException(MESSAGE_PIPE_TASK_STAGE_HAS_BEEN_STOPPED);
      }
      // Otherwise, do nothing to allow retry strategy
      return;
    }

    // Status == null, register the subtask
    createSubtask();

    status = PipeStatus.STOPPED;
  }
Create a {@link PipeTaskStage}.

@throws PipeException if failed to create a {@link PipeTaskStage}.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/stage/PipeTaskStage.java