Lehel44 commented on a change in pull request #4798:
URL: https://github.com/apache/nifi/pull/4798#discussion_r572946455
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
##########
@@ -352,6 +352,47 @@ public void onTaskComplete() {
return future;
}
+ /**
+ * Runs the given {@link Processor} once by invoking its
+ * {@link ProcessorNode#runOnce(ScheduledExecutorService, long, long,
Supplier, SchedulingAgentCallback)}
+ * method.
+ *
+ * @see ProcessorNode#runOnce(ScheduledExecutorService, long, long,
Supplier, SchedulingAgentCallback)
+ */
+ @Override
+ public Future<Void> runProcessorOnce(ProcessorNode procNode, final
Callable<Future<Void>> stopCallback) {
+ final LifecycleState lifecycleState =
getLifecycleState(requireNonNull(procNode), true);
+
+ final Supplier<ProcessContext> processContextFactory = () -> new
StandardProcessContext(procNode, getControllerServiceProvider(),
+ this.encryptor, getStateManager(procNode.getIdentifier()),
lifecycleState::isTerminated, flowController);
+
+ final CompletableFuture<Void> future = new CompletableFuture<>();
Review comment:
I think this could be extracted to another method because it is
duplicated at 324-329
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]