private void closeAndRemoveProcessor() {
      processors.forEach(sp -> {
        if (sp.getLeft().equals(processor)) {
          sp.getLeft().stop();
          if (sp.getRight() != null) {
            sp.getRight().close();
          }
        }
      });
      processors.removeIf(pair -> pair.getLeft().equals(processor));
    }
Defines a specific implementation of {@link ProcessorLifecycleListener} for local {@link StreamProcessor}s.
samza-core/src/main/java/org/apache/samza/runtime/LocalApplicationRunner.java