Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-14176 Add runstate information to C2 FlowInfo #9651

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class ProcessorStatus implements Serializable {
private long processingNanos;
private int activeThreadCount;
private int terminatedThreadCount;
private String runState;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for calling this runState as opposed to runStatus as named in the source Processor Status object?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not particularly, and I think we wanna go with runStatus instead. We did indeed implement it as runStatus in c++
apache/nifi-minifi-cpp@07b9641#diff-00076823b84623f3ab4d37455b5d6943cf6becc21da552be650affcae6344abdR39

To be honest, I only created this draft PR as a discussion starter, so we can see what would be the natural way to implement this in minifi java so we can implement the same thing in minifi c++.

But it turns out the C2 command to start stop components is only present in the C++ agents so this seems to be putting the cart before the horse in the case of the java agent. I will close this, and we can add this field when we implement the start/stop C2 command.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the background @martinzink, sounds good for now.


@Schema(description = "The id of the processor")
public String getId() {
Expand Down Expand Up @@ -145,4 +146,13 @@ public int getTerminatedThreadCount() {
public void setTerminatedThreadCount(int terminatedThreadCount) {
this.terminatedThreadCount = terminatedThreadCount;
}

@Schema(description = "The state of the processor")
public String getRunState() {
return runState;
}

public void setRunState(String runState) {
this.runState = runState;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ private ProcessorStatus convertProcessorStatus(org.apache.nifi.controller.status
result.setProcessingNanos(processorStatus.getProcessingNanos());
result.setActiveThreadCount(processorStatus.getActiveThreadCount());
result.setTerminatedThreadCount(processorStatus.getTerminatedThreadCount());
result.setRunState(processorStatus.getRunStatus().toString());
return result;
}
}
Loading