Marcosrico commented on code in PR #2336:
URL: https://github.com/apache/helix/pull/2336#discussion_r1066181731
##########
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);
+ }
+
+ public static Op create(String path, byte[] data,
MetaClientInterface.EntryMode createMode) {
+ return new Create(path, data, createMode);
+ }
+
+ public static Op delete(String path, int version) {
+ return new Op.Delete(path, version);
+ }
+
+ public static Op set(String path, byte[] data, int version) {
+ return new Set(path, data, version);
+ }
+
+ public static Op check(String path, int version) {
+ return new Check(path, version);
+ }
+
+ public int getType() {
+ return this.type;
+ }
Review Comment:
I agree, will change from int to enum. 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]