public void dropTrigger(String triggerName, boolean needToDeleteJar) throws IOException {
    try {
      acquireLock();
      TriggerInformation triggerInformation = triggerTable.removeTriggerInformation(triggerName);
      TriggerExecutor executor = executorMap.remove(triggerName);
      if (executor != null) {
        executor.onDrop();
      }
      if (triggerInformation == null) {
        return;
      }
      patternTreeMap.delete(triggerInformation.getPathPattern(), triggerName);

      // if it is needed to delete jar file of the trigger, delete both jar file and md5
      if (needToDeleteJar) {
        TriggerExecutableManager.getInstance()
            .removeFileUnderLibRoot(triggerInformation.getJarName());
        TriggerExecutableManager.getInstance().removeFileUnderTemporaryRoot(triggerName + ".txt");
      }
    } catch (TriggerExecutionException ignored) {
      // Drop trigger can success even onDrop throw an exception for now
    } finally {
      releaseLock();
    }
  }
Maintain a PatternTree: PathPattern -> List<String> triggerNames Return the triggerNames of
triggers whose PathPatterns match the given one.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/trigger/service/TriggerManagementService.java