mcgilman commented on code in PR #10665:
URL: https://github.com/apache/nifi/pull/10665#discussion_r2632722807
##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/flow/FlowControllerFlowContextFactory.java:
##########
@@ -32,6 +32,7 @@
import org.apache.nifi.flow.VersionedParameterContext;
Review Comment:
This is no longer used.
##########
nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiClientUtil.java:
##########
@@ -397,6 +397,27 @@ public void waitForConnectorValidationStatus(final String
connectorId, final Str
}
}
+ public void waitForConnectorStopped(final String connectorId) throws
NiFiClientException, IOException, InterruptedException {
+ waitForConnectorState(connectorId, ConnectorState.STOPPED);
+ }
+
+ public void waitForConnectorState(final String connectorId, final
ConnectorState desiredState) throws InterruptedException, NiFiClientException,
IOException {
+ int iteration = 0;
+ while (true) {
Review Comment:
This could hang of the condition is never met. Is this expected for these
system tests? Assuming so, this comment can be ignored.
##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/flow/FlowControllerFlowContextFactory.java:
##########
@@ -96,15 +97,18 @@ private void copyGroupContents(final ProcessGroup
sourceGroup, final ProcessGrou
.build();
final VersionedComponentFlowMapper flowMapper = new
VersionedComponentFlowMapper(flowController.getExtensionManager(),
flowMappingOptions);
- final Map<String, VersionedParameterContext> parameterContexts =
flowMapper.mapParameterContexts(sourceGroup, true, Map.of());
final InstantiatedVersionedProcessGroup versionedGroup =
flowMapper.mapProcessGroup(sourceGroup,
flowController.getControllerServiceProvider(),
flowController.getFlowManager(), true);
final VersionedExternalFlow versionedExternalFlow = new
VersionedExternalFlow();
versionedExternalFlow.setFlowContents(versionedGroup);
versionedExternalFlow.setExternalControllerServices(Map.of());
versionedExternalFlow.setParameterProviders(Map.of());
- versionedExternalFlow.setParameterContexts(parameterContexts);
+ versionedExternalFlow.setParameterContexts(Map.of());
destinationGroup.updateFlow(versionedExternalFlow, componentIdSeed,
false, true, true);
+
+ final String duplicateContextId =
UUID.nameUUIDFromBytes((destinationGroup.getIdentifier() +
"-param-context").getBytes(StandardCharsets.UTF_8)).toString();
+ final ParameterContext duplicateParameterContext =
flowController.getFlowManager().duplicateParameterContext(duplicateContextId,
sourceGroup.getParameterContext());
Review Comment:
`sourceGroup.getParameterContext()` indicates that it may return null.
`duplicateParameterContext` would throw a NPE if `null` is passed in. Guessing
in practice it won't be null but that what `getParameterContext` currently
indicates so we may want to handle it here.
--
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]