private void validatePipePluginUsageByPipeInternal(String pluginName) {
    Iterable<PipeMeta> pipeMetas = getPipeMetaList();
    for (PipeMeta pipeMeta : pipeMetas) {
      PipeParameters extractorParameters = pipeMeta.getStaticMeta().getExtractorParameters();
      final String extractorPluginName =
          extractorParameters.getStringOrDefault(
              Arrays.asList(PipeExtractorConstant.EXTRACTOR_KEY, PipeExtractorConstant.SOURCE_KEY),
              BuiltinPipePlugin.IOTDB_EXTRACTOR.getPipePluginName());
      if (pluginName.equals(extractorPluginName)) {
        String exceptionMessage =
            String.format(
                "PipePlugin '%s' is already used by Pipe '%s' as a source.",
                pluginName, pipeMeta.getStaticMeta().getPipeName());
        throw new PipeException(exceptionMessage);
      }

      PipeParameters processorParameters = pipeMeta.getStaticMeta().getProcessorParameters();
      final String processorPluginName =
          processorParameters.getString(PipeProcessorConstant.PROCESSOR_KEY);
      if (pluginName.equals(processorPluginName)) {
        String exceptionMessage =
            String.format(
                "PipePlugin '%s' is already used by Pipe '%s' as a processor.",
                pluginName, pipeMeta.getStaticMeta().getPipeName());
        throw new PipeException(exceptionMessage);
      }

      PipeParameters connectorParameters = pipeMeta.getStaticMeta().getConnectorParameters();
      final String connectorPluginName =
          connectorParameters.getStringOrDefault(
              Arrays.asList(PipeConnectorConstant.CONNECTOR_KEY, PipeConnectorConstant.SINK_KEY),
              IOTDB_THRIFT_CONNECTOR.getPipePluginName());
      if (pluginName.equals(connectorPluginName)) {
        String exceptionMessage =
            String.format(
                "PipePlugin '%s' is already used by Pipe '%s' as a sink.",
                pluginName, pipeMeta.getStaticMeta().getPipeName());
        throw new PipeException(exceptionMessage);
      }
    }
  }
Caller should ensure that the method is called in the lock {@link #acquireWriteLock}.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/pipe/PipeTaskInfo.java