[ 
https://issues.apache.org/jira/browse/NIFI-4224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16118890#comment-16118890
 ] 

ASF GitHub Bot commented on NIFI-4224:
--------------------------------------

Github user mcgilman commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2051#discussion_r131985519
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardProcessGroupDAO.java
 ---
    @@ -99,29 +116,69 @@ public void verifyScheduleComponents(final String 
groupId, final ScheduledState
         }
     
         @Override
    -    public void scheduleComponents(final String groupId, final 
ScheduledState state, final Set<String> componentIds) {
    +    public void verifyActivateControllerServices(final String groupId, 
final ControllerServiceState state, final Set<String> serviceIds) {
    +        final ProcessGroup group = locateProcessGroup(flowController, 
groupId);
    +
    +        group.findAllControllerServices().stream()
    +            .filter(service -> 
serviceIds.contains(service.getIdentifier()))
    +            .forEach(service -> {
    +                if (state == ControllerServiceState.ENABLED) {
    +                    service.verifyCanEnable();
    +                } else {
    +                    service.verifyCanDisable();
    +                }
    +            });
    +    }
    +
    +    @Override
    +    public CompletableFuture<Void> scheduleComponents(final String 
groupId, final ScheduledState state, final Set<String> componentIds) {
             final ProcessGroup group = locateProcessGroup(flowController, 
groupId);
     
    +        CompletableFuture<Void> future = 
CompletableFuture.completedFuture(null);
    +
             for (final String componentId : componentIds) {
                 final Connectable connectable = 
group.findLocalConnectable(componentId);
                 if (ScheduledState.RUNNING.equals(state)) {
                     if 
(ConnectableType.PROCESSOR.equals(connectable.getConnectableType())) {
    -                    
connectable.getProcessGroup().startProcessor((ProcessorNode) connectable);
    +                    final CompletableFuture<?> processorFuture = 
connectable.getProcessGroup().startProcessor((ProcessorNode) connectable);
    +                    future = CompletableFuture.allOf(future, 
processorFuture);
                     } else if 
(ConnectableType.INPUT_PORT.equals(connectable.getConnectableType())) {
                         connectable.getProcessGroup().startInputPort((Port) 
connectable);
                     } else if 
(ConnectableType.OUTPUT_PORT.equals(connectable.getConnectableType())) {
                         connectable.getProcessGroup().startOutputPort((Port) 
connectable);
                     }
                 } else {
                     if 
(ConnectableType.PROCESSOR.equals(connectable.getConnectableType())) {
    -                    
connectable.getProcessGroup().stopProcessor((ProcessorNode) connectable);
    +                    final CompletableFuture<?> processorFuture = 
connectable.getProcessGroup().stopProcessor((ProcessorNode) connectable);
    +                    future = CompletableFuture.allOf(future, 
processorFuture);
                     } else if 
(ConnectableType.INPUT_PORT.equals(connectable.getConnectableType())) {
                         connectable.getProcessGroup().stopInputPort((Port) 
connectable);
                     } else if 
(ConnectableType.OUTPUT_PORT.equals(connectable.getConnectableType())) {
                         connectable.getProcessGroup().stopOutputPort((Port) 
connectable);
                     }
                 }
             }
    +
    +        return future;
    +    }
    +
    +    @Override
    +    public Future<Void> activateControllerServices(final String groupId, 
final ControllerServiceState state, final Set<String> serviceIds) {
    --- End diff --
    
    Assuming this action needs to be recorded in the Flow History, the 
`ProcessGroupAuditor` will need to account for this method invocation.


> Add Variable Registry at Process Group level
> --------------------------------------------
>
>                 Key: NIFI-4224
>                 URL: https://issues.apache.org/jira/browse/NIFI-4224
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>
> Currently, NiFi exposes a variable registry that is configurable by adding 
> the name of a properties file to nifi.properties and then treating the 
> referenced properties file as key/value pairs for the variable registry. 
> This, however, is very limiting, as it provides a global scope for all 
> variables, and it requires a restart of NiFi in order to pick up any updates 
> to the file. We should expose a Process Group-level Variable Registry.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to