pvillard31 commented on code in PR #86:
URL: https://github.com/apache/nifi-api/pull/86#discussion_r3243261447
##########
src/main/java/org/apache/nifi/components/connector/Connector.java:
##########
@@ -78,6 +78,17 @@ public interface Connector {
*/
VersionedExternalFlow getInitialFlow();
+ /**
+ * Returns the Connector's authoritative view of the Active flow based on
its current configuration. This is the flow
+ * that the Connector believes should be installed into the Active Flow
Context. It is invoked when ending
+ * Troubleshooting mode in order to restore the flow that the Connector
expects, discarding any user edits made while
+ * in Troubleshooting.
+ *
+ * @param activeFlowContext the active flow context
+ * @return the Connector's authoritative view of the flow
+ */
+ VersionedExternalFlow getActiveFlow(FlowContext activeFlowContext);
Review Comment:
Since `getInitialFlow()` is parameterless and the new
`getActiveFlow(FlowContext)` is described as returning the Connector's view
"based on its current configuration", could the Javadoc spell out what the
`activeFlowContext` parameter is actually for (e.g., is it required only for
symmetry with `start`/`stop`/`validate`, or is there state on it that the
Connector is expected to read)?
##########
src/main/java/org/apache/nifi/flow/VersionedConnector.java:
##########
@@ -83,4 +84,20 @@ public Bundle getBundle() {
public void setBundle(final Bundle bundle) {
this.bundle = bundle;
}
+
+ /**
+ * Returns the contents of the Connector's Managed Process Group. This
field is populated only when the Connector is
+ * in Troubleshooting mode at the time the flow is persisted, so that any
user modifications made while in Troubleshooting
+ * survive a restart. For any other Connector state, this field is {@code
null} and the Managed Process Group's contents
+ * are reconstructed from the configuration steps upon restore.
+ *
+ * @return the persisted contents of the Managed Process Group, or {@code
null} if the Connector was not in Troubleshooting
+ */
+ public VersionedProcessGroup getManagedProcessGroup() {
Review Comment:
Could the Javadoc on `getManagedProcessGroup()` also state how the framework
treats a deserialized `VersionedConnector` whose `scheduledState !=
TROUBLESHOOTING` but whose `managedProcessGroup` is non-null — is the field
ignored, does it win over the configuration steps on restore, or is it
considered malformed?
--
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]