use of org.apache.nifi.registry.variable.MutableVariableRegistry in project nifi by apache.
the class StandardProcessGroup method getUpdatedVariables.
private Set<String> getUpdatedVariables(final Map<String, String> newVariableValues) {
final Set<String> updatedVariableNames = new HashSet<>();
final MutableVariableRegistry registry = getVariableRegistry();
for (final Map.Entry<String, String> entry : newVariableValues.entrySet()) {
final String varName = entry.getKey();
final String newValue = entry.getValue();
final String curValue = registry.getVariableValue(varName);
if (!Objects.equals(newValue, curValue)) {
updatedVariableNames.add(varName);
}
}
return updatedVariableNames;
}
use of org.apache.nifi.registry.variable.MutableVariableRegistry in project nifi by apache.
the class TestStandardControllerServiceProvider method createProcessor.
private ProcessorNode createProcessor(final StandardProcessScheduler scheduler, final ControllerServiceProvider serviceProvider) {
final ReloadComponent reloadComponent = Mockito.mock(ReloadComponent.class);
final LoggableComponent<Processor> dummyProcessor = new LoggableComponent<>(new DummyProcessor(), systemBundle.getBundleDetails().getCoordinate(), null);
final ProcessorNode procNode = new StandardProcessorNode(dummyProcessor, UUID.randomUUID().toString(), new StandardValidationContextFactory(serviceProvider, null), scheduler, serviceProvider, niFiProperties, new StandardComponentVariableRegistry(VariableRegistry.EMPTY_REGISTRY), reloadComponent);
final ProcessGroup group = new StandardProcessGroup(UUID.randomUUID().toString(), serviceProvider, scheduler, null, null, Mockito.mock(FlowController.class), new MutableVariableRegistry(variableRegistry));
group.addProcessor(procNode);
procNode.setProcessGroup(group);
return procNode;
}
Aggregations