Marcosrico commented on code in PR #2343:
URL: https://github.com/apache/helix/pull/2343#discussion_r1081380987
##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClient.java:
##########
@@ -414,4 +414,130 @@ private static EntryMode convertZkEntryMode(long
ephemeralOwner) {
throw new IllegalArgumentException(zkEphemeralType + " is not
supported.");
}
}
+
+
+ @Override
+ public List<OpResult> transactionOP(Iterable<Op> iterable) throws
KeeperException {
+ // Convert list of MetaClient Ops to Zk Ops
+ List<org.apache.zookeeper.Op> zkOps = metaClientOpToZk(iterable);
+ // Execute Zk transactional support
+ List<org.apache.zookeeper.OpResult> zkResult = _zkClient.multi(zkOps);
+ // Convert list of Zk OpResults to MetaClient OpResults
+ return zkOpResultToMetaClient(zkResult);
+ }
+
+ /**
+ * Helper function for transactionOp. Converts MetaClient Op's into Zk Ops
to execute
+ * zk transactional support.
+ * @param ops
+ * @return
+ */
+ public List<org.apache.zookeeper.Op> metaClientOpToZk(Iterable<Op> ops)
throws KeeperException {
Review Comment:
The `CreateMode.fromFlag()` method throws KeeperException. I can catch it
in the method, however, I don't believe it would fall under IllegalArgument
exception and would need to throw a different one. This would show in the
method signature so I left it at this. Please let me know what the best
practices are for this, thanks!
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]