You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/10/02 00:16:50 UTC

[GitHub] [helix] jiajunwang opened a new pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

jiajunwang opened a new pull request #1429:
URL: https://github.com/apache/helix/pull/1429


   ### Issues
   
   - [X] My PR addresses the following Helix issues and references them in the PR description:
   
   Resolves #1428 
   
   ### Description
   
   - [X] Here are some details about my PR, including screenshots of any UI changes:
   
   The Helix ZkClient multi ops interfaces can be used in the same way as the native Zookeeper multi ops method. But the users are required to construct Helix MultiOp Objects for the additional Helix support such as monitoring, validation, and auto compress, etc.
   
   ### Tests
   
   - [X] The following tests are written for this issue:
   
   TestRawZkClient.testMultiOps 
   
   - [X] The following is the result of the "mvn test" command on the appropriate module:
   
   [INFO] Tests run: 47, Failures: 0, Errors: 0, Skipped: 0
   [INFO] 
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   
   ### Documentation (Optional)
   
   - In case of new functionality, my PR adds documentation in the following wiki page:
   
   (Link the GitHub wiki you added)
   
   ### Commits
   
   - My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Code Quality
   
   - My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang commented on a change in pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #1429:
URL: https://github.com/apache/helix/pull/1429#discussion_r509711435



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/RealmAwareZkClient.java
##########
@@ -261,8 +261,11 @@ void asyncSetData(final String path, Object datat, final int version,
 
   long getCreationTime(String path);
 
+  @Deprecated
   List<OpResult> multi(final Iterable<Op> ops);

Review comment:
       This operation does not fit the Helix ZkClient design since,
   1. there is no retry until connecting support.
   2. there is no metric support.
   
   Keep supporting it, then we need to take it as a very special case. Currently, there is no large scale usage, so the metrics and caller logic looks fine. Otherwise, we will see issues here and there.
   So my take is that we want to replace it with the new multiops API with full support.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #1429:
URL: https://github.com/apache/helix/pull/1429#discussion_r498984635



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/MultiOp.java
##########
@@ -0,0 +1,144 @@
+package org.apache.helix.zookeeper.api.client;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.Op;
+import org.apache.zookeeper.ZooDefs;
+import org.apache.zookeeper.data.ACL;
+
+
+/**
+ * A wrapper class of org.apache.zookeeper.Op to support Helix interfaces and monitoring
+ * functionality.

Review comment:
       Where do we have the "Helix interfaces and monitoring functionality"?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #1429:
URL: https://github.com/apache/helix/pull/1429#discussion_r498984635



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/MultiOp.java
##########
@@ -0,0 +1,144 @@
+package org.apache.helix.zookeeper.api.client;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.Op;
+import org.apache.zookeeper.ZooDefs;
+import org.apache.zookeeper.data.ACL;
+
+
+/**
+ * A wrapper class of org.apache.zookeeper.Op to support Helix interfaces and monitoring
+ * functionality.

Review comment:
       Where do (or are we going to have) we have the "Helix interfaces and monitoring functionality"?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang commented on pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on pull request #1429:
URL: https://github.com/apache/helix/pull/1429#issuecomment-702978607


   Thanks for reviewing, @narendly.
   I'm still doing more prototype work. Until I'm convinced that it will work end to end, I will temporarily suspend this PR's work. Let me close it for now to avoid confusion. I will re-open it later with some API design.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #1429:
URL: https://github.com/apache/helix/pull/1429#discussion_r498984070



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/MultiOp.java
##########
@@ -0,0 +1,144 @@
+package org.apache.helix.zookeeper.api.client;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.Op;
+import org.apache.zookeeper.ZooDefs;
+import org.apache.zookeeper.data.ACL;
+
+
+/**
+ * A wrapper class of org.apache.zookeeper.Op to support Helix interfaces and monitoring
+ * functionality.
+ */
+public abstract class MultiOp {
+  private final String _path;
+
+  private MultiOp(String path) {
+    _path = path;
+  }
+
+  /**
+   * @return the target path of the operation.
+   */
+  public String getPath() {
+    return _path;
+  }
+
+  /**
+   * Build a new org.apache.zookeeper.Op object for Zookeeper.multi call.
+   * @param serializer
+   * @return org.apache.zookeeper.Op object corresponding to the MultiOp object.
+   */
+  public abstract Op buildZkOp(PathBasedZkSerializer serializer);

Review comment:
       Will ZkSerializer be supported?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang commented on a change in pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #1429:
URL: https://github.com/apache/helix/pull/1429#discussion_r509713581



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/MultiOp.java
##########
@@ -0,0 +1,144 @@
+package org.apache.helix.zookeeper.api.client;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.Op;
+import org.apache.zookeeper.ZooDefs;
+import org.apache.zookeeper.data.ACL;
+
+
+/**
+ * A wrapper class of org.apache.zookeeper.Op to support Helix interfaces and monitoring
+ * functionality.

Review comment:
       Will be in my complete version. But that will still be a POC.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang commented on a change in pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #1429:
URL: https://github.com/apache/helix/pull/1429#discussion_r509711435



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/RealmAwareZkClient.java
##########
@@ -261,8 +261,11 @@ void asyncSetData(final String path, Object datat, final int version,
 
   long getCreationTime(String path);
 
+  @Deprecated
   List<OpResult> multi(final Iterable<Op> ops);

Review comment:
       This operation does not fit the Helix ZkClient design since,
   1. there is no retry until connecting support.
   2. there is no metric support.
   Keep supporting it, then we need to take it as a very special case. Currently, there is no large scale usage, so the metrics and caller logic looks fine. Otherwise, we will see issues here and there.
   So my take is that we want to replace it with the new multiops API with full support.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] narendly commented on a change in pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
narendly commented on a change in pull request #1429:
URL: https://github.com/apache/helix/pull/1429#discussion_r498982918



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/RealmAwareZkClient.java
##########
@@ -261,8 +261,11 @@ void asyncSetData(final String path, Object datat, final int version,
 
   long getCreationTime(String path);
 
+  @Deprecated
   List<OpResult> multi(final Iterable<Op> ops);

Review comment:
       Is deprecating this is a necessity here? zookeeper-api is supposed to be a general-purpose client library as well (not just tailored for Helix usage), so I don't see the need for it quite yet. My opinion is that we should continue to maintain the interface defined in the original 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang closed pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
jiajunwang closed pull request #1429:
URL: https://github.com/apache/helix/pull/1429


   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] jiajunwang commented on a change in pull request #1429: Add Zookeeper multi ops support in the Helix ZkClient.

Posted by GitBox <gi...@apache.org>.
jiajunwang commented on a change in pull request #1429:
URL: https://github.com/apache/helix/pull/1429#discussion_r509713256



##########
File path: zookeeper-api/src/main/java/org/apache/helix/zookeeper/api/client/MultiOp.java
##########
@@ -0,0 +1,144 @@
+package org.apache.helix.zookeeper.api.client;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.helix.zookeeper.zkclient.serialize.PathBasedZkSerializer;
+import org.apache.zookeeper.CreateMode;
+import org.apache.zookeeper.Op;
+import org.apache.zookeeper.ZooDefs;
+import org.apache.zookeeper.data.ACL;
+
+
+/**
+ * A wrapper class of org.apache.zookeeper.Op to support Helix interfaces and monitoring
+ * functionality.
+ */
+public abstract class MultiOp {
+  private final String _path;
+
+  private MultiOp(String path) {
+    _path = path;
+  }
+
+  /**
+   * @return the target path of the operation.
+   */
+  public String getPath() {
+    return _path;
+  }
+
+  /**
+   * Build a new org.apache.zookeeper.Op object for Zookeeper.multi call.
+   * @param serializer
+   * @return org.apache.zookeeper.Op object corresponding to the MultiOp object.
+   */
+  public abstract Op buildZkOp(PathBasedZkSerializer serializer);

Review comment:
       I don't see any issues with the interfaces.
   There is one thing I take as a TODO. If the requested paths are located on different realms, then we won't be able to do it. We may want to check and fail such a request.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org