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


##########
meta-client/src/main/java/org/apache/helix/metaclient/api/Op.java:
##########
@@ -23,16 +23,96 @@
  *  Represents a single operation in a multi-operation transaction.  Each 
operation can be a create, set,
  *  version check or delete operation.
  */
-public class Op {
+public abstract class Op {
+  private int type;
+  private String path;
+
+  private Op(int type, String path) {
+    this.type = type;
+    this.path = path;
+  }
+  public static Op create(String path, byte[] data) {
+    return new Create(path, data);

Review Comment:
   There might be a slight circular call though it is not cyclic. Op creates a 
Create object which calls its super's (Op) constructor to set the type and 
path. The implementation of the Op (and OpResult) objects are based on 
zkclient's implementation of such. It'll be easier for users to adopt 
metaclient if api resembles that of zkclient.



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