markap14 commented on a change in pull request #5634:
URL: https://github.com/apache/nifi/pull/5634#discussion_r781527490



##########
File path: 
nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/stateless/flow/StandardStatelessFlowCurrent.java
##########
@@ -57,23 +58,22 @@ private StandardStatelessFlowCurrent(final Builder builder) 
{
         this.processContextFactory = builder.processContextFactory;
     }
 
-    public Connectable getCurrentComponent() {
-        return currentComponent;
-    }
-
     @Override
     public void triggerFlow() {
         try {
             boolean completionReached = false;
             while (!completionReached) {
+                tracker.shelveReadyComponents();

Review comment:
       I see. The key here being that in this approach the getNextReady() would 
return the last element in the list, rather than the List of all ready 
components. I was missing that distinction at first. I think you're right - 
this should work essentially the same as the solution that I put in this PR, 
but your method is cleaner. Simpler. And possibly more efficient, as well.
   Will update the PR to go this route. Thanks! I'll probably avoid creating 
the new ArrayList and returning the last element, though, and instead just 
iterate over the Set to get the last element - just to avoid that intermediate 
ArrayList. But otherwise I think your solution is really good. Nice job!




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to