Marcosrico commented on code in PR #2343:
URL: https://github.com/apache/helix/pull/2343#discussion_r1082869761


##########
meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/util/ZkMetaClientUtil.java:
##########
@@ -0,0 +1,156 @@
+package org.apache.helix.metaclient.impl.zk.util;
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+import org.apache.helix.metaclient.api.OpResult;
+import org.apache.helix.metaclient.constants.*;
+import org.apache.helix.zookeeper.zkclient.exception.*;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.KeeperException;
+import org.apache.zookeeper.Op;
+import org.apache.zookeeper.ZooDefs;
+import org.apache.zookeeper.data.ACL;
+import org.apache.zookeeper.server.EphemeralType;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.function.Function;
+
+public class ZkMetaClientUtil {
+  //Default ACL value until metaClient Op has ACL of its own.
+  private static final List<ACL> DEFAULT_ACL = 
Collections.unmodifiableList(ZooDefs.Ids.OPEN_ACL_UNSAFE);
+
+  private ZkMetaClientUtil(){
+  }
+
+  /**
+   * Helper function for transactionOp. Converts MetaClient Op's into Zk Ops 
to execute
+   * zk transactional support.
+   * @param ops
+   * @return
+   */
+  public static List<Op> 
metaClientOpToZk(Iterable<org.apache.helix.metaclient.api.Op> ops) {
+    Map<org.apache.helix.metaclient.api.Op.Type, 
Function<org.apache.helix.metaclient.api.Op, Op>> opMap = new HashMap<>();

Review Comment:
   Sounds good thank you for the review. I updated the methods with a lazy and 
thread safe implementation of the maps, please let me know if it looks good, 
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]

Reply via email to