You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/12/15 19:53:53 UTC

[GitHub] [zookeeper] ztzg commented on a change in pull request #1559: ZOOKEEPER-4026: Complete support for Stat objects (and create2) in multi requests

ztzg commented on a change in pull request #1559:
URL: https://github.com/apache/zookeeper/pull/1559#discussion_r543642732



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/MultiOperationRecord.java
##########
@@ -126,7 +127,10 @@ public void deserialize(InputArchive archive, String tag) throws IOException {
                 case ZooDefs.OpCode.createContainer:
                     CreateRequest cr = new CreateRequest();
                     cr.deserialize(archive, tag);
-                    add(Op.create(cr.getPath(), cr.getData(), cr.getAcl(), cr.getFlags()));
+                    EnumSet<Op.CreateFlags> createFlags = h.getType() == ZooDefs.OpCode.create2
+                        ? EnumSet.of(Op.CreateFlags.WANT_STAT)

Review comment:
       Done.
   
   Adding that odd case to the visible API felt a bit awkward, so I have attached it to the `MultiOperationRecord` implementation.  (Of course, the "odd case"-ness is debatable since we only have a single flag :)  Let me know if you'd prefer to have it in the enum.  (In which case I would also appreciate a suggestion for a non-clashing name!)
   
   I have also wrapped both `EnumSet`s with `Collections.unmodifiableSet`, as the former are in fact mutable.




----------------------------------------------------------------
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:
users@infra.apache.org