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

    https://github.com/apache/nifi/pull/2065#discussion_r132818810
  
    --- Diff: 
nifi-toolkit/nifi-toolkit-zookeeper-migrator/src/main/java/org/apache/nifi/toolkit/zkmigrator/ZooKeeperMigrator.java
 ---
    @@ -269,15 +269,23 @@ private String ensureNodeExists(ZooKeeper zooKeeper, 
String path, CreateMode cre
             }
         }
     
    -    private DataStatAclNode transformNode(DataStatAclNode node, AuthMode 
destinationAuthMode) {
    -        // For the NiFi use case, all nodes will be migrated to 
CREATOR_ALL_ACL
    +    private DataStatAclNode transformNode(DataStatAclNode node, AuthMode 
destinationAuthMode, boolean useExistingACL) {
    +        // If useExistingACL is false, for the NiFi use cases, all nodes 
will be migrated to CREATOR_ALL_ACL
             final DataStatAclNode migratedNode = new 
DataStatAclNode(node.getPath(), node.getData(), node.getStat(),
    -                destinationAuthMode.equals(AuthMode.OPEN) ? 
ZooDefs.Ids.OPEN_ACL_UNSAFE : ZooDefs.Ids.CREATOR_ALL_ACL,
    +                determineNodeACL(node,destinationAuthMode,useExistingACL),
                     node.getEphemeralOwner());
             LOGGER.info("transformed original node {} to {}", node, 
migratedNode);
             return migratedNode;
         }
     
    +    private List<ACL> determineNodeACL(DataStatAclNode node, AuthMode 
destinationAuthMode, boolean useExistingACL){
    --- End diff --
    
    Rather than having this method get invoked from transformNode, can you do 
this as a stage in the completable future before transformNode is invoked?  I'd 
like to keep all the method coordination controlled by the CompletableFuture 
stages rather than having methods invoke each other.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to