eolivelli commented on a change in pull request #1306: ZOOKEEPER-3415: Convert 
internal logic to use streams
URL: https://github.com/apache/zookeeper/pull/1306#discussion_r404605921
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java
 ##########
 @@ -1175,30 +1174,33 @@ void killSession(long session, long zxid, Set<String> 
paths2DeleteLocal,
     }
 
     void deleteNodes(long session, long zxid, Iterable<String> paths2Delete) {
-        for (String path : paths2Delete) {
-            boolean deleted = false;
-            String sessionHex = "0x" + Long.toHexString(session);
-            try {
-                deleteNode(path, zxid);
-                deleted = true;
-                LOG.debug("Deleting ephemeral node {} for session {}", path, 
sessionHex);
-            } catch (NoNodeException e) {
-                LOG.warn(
-                    "Ignoring NoNodeException for path {} while removing 
ephemeral for dead session {}",
-                        path, sessionHex);
-            }
-            if (ZKAuditProvider.isAuditEnabled()) {
-                if (deleted) {
-                    ZKAuditProvider.log(ZKAuditProvider.getZKUser(),
-                            AuditConstants.OP_DEL_EZNODE_EXP, path, null, null,
-                            sessionHex, null, Result.SUCCESS);
-                } else {
-                    ZKAuditProvider.log(ZKAuditProvider.getZKUser(),
-                            AuditConstants.OP_DEL_EZNODE_EXP, path, null, null,
-                            sessionHex, null, Result.FAILURE);
+
+        StreamSupport.stream(paths2Delete.spliterator(),false)
 
 Review comment:
   what's the benefit of this change ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to