zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] anmolnar commented on a change in pull request #959: ZOOKEEPER-3402: Add multiRead operation
Date Sat, 22 Jun 2019 21:35:39 GMT
anmolnar commented on a change in pull request #959: ZOOKEEPER-3402: Add multiRead operation
URL: https://github.com/apache/zookeeper/pull/959#discussion_r296457953
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java
 ##########
 @@ -1893,25 +1895,41 @@ private Op withRootPrefix(Op op) {
         return op;
     }
 
-    protected void multiInternal(MultiTransactionRecord request, MultiCallback cb, Object
ctx) {
+    protected void multiInternal(MultiOperationRecord request, MultiCallback cb, Object ctx)
+            throws IllegalArgumentException {
         RequestHeader h = new RequestHeader();
-        h.setType(ZooDefs.OpCode.multi);
+        switch (request.getOpKind()) {
+            case TRANSACTION: h.setType(ZooDefs.OpCode.multi); break;
+            case READ: h.setType(ZooDefs.OpCode.multiRead); break;
+            default:
+                throw new IllegalArgumentException("Invalid kind of op");
 
 Review comment:
   Please rephrase: "Unsupported OpKind: " + request.getOpKind()
   (or use string formatter)

----------------------------------------------------------------
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


With regards,
Apache Git Services

Mime
View raw message