zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] TisonKun commented on a change in pull request #1070: ZOOKEEPER-3528: Revisit AsyncCallback javadoc
Date Sat, 31 Aug 2019 08:40:44 GMT
TisonKun commented on a change in pull request #1070: ZOOKEEPER-3528: Revisit AsyncCallback
javadoc
URL: https://github.com/apache/zookeeper/pull/1070#discussion_r319716692
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/AsyncCallback.java
 ##########
 @@ -241,130 +232,110 @@
 
         /**
          * Process the result of the asynchronous call.
-         * <p>
-         * On success, rc is
-         * {@link org.apache.zookeeper.KeeperException.Code#OK}.
-         * <p>
-         * On failure, rc is set to the corresponding failure code in
-         * {@link org.apache.zookeeper.KeeperException}.
+         *
+         * <p>On success, rc is {@link KeeperException.Code#OK}.
+         *
+         * <p>On failure, rc is set to the corresponding failure code in {@link KeeperException}.
          * <ul>
-         * <li>
-         * {@link org.apache.zookeeper.KeeperException.Code#NODEEXISTS}
-         * - The node on give path already exists for some API calls.
-         * </li>
-         * <li>
-         * {@link org.apache.zookeeper.KeeperException.Code#NONODE}
-         * - The node on given path doesn't exist for some API calls.
-         * </li>
-         * <li>
-         * {@link
-         * org.apache.zookeeper.KeeperException.Code#NOCHILDRENFOREPHEMERALS}
-         * - an ephemeral node cannot have children. There is discussion in
-         * community. It might be changed in the future.
-         * </li>
+         *  <li>{@link KeeperException.Code#NODEEXISTS}
+         *             - The node on give path already exists for some API calls.</li>
+         *  <li>{@link KeeperException.Code#NONODE}
+         *             - The node on given path doesn't exist for some API calls.</li>
+         *  <li>{@link KeeperException.Code#NOCHILDRENFOREPHEMERALS}
+         *             - An ephemeral node cannot have children. There is discussion in
+         *             community. It might be changed in the future.</li>
          * </ul>
          *
          * @param rc   The return code or the result of the call.
          * @param path The path that we passed to asynchronous calls.
-         * @param ctx  Whatever context object that we passed to
-         *             asynchronous calls.
-         * @param name The name of the Znode that was created.
-         *             On success, <i>name</i> and <i>path</i> are
usually
-         *             equal, unless a sequential node has been created.
+         * @param ctx  Whatever context object that we passed to asynchronous calls.
+         * @param name The name of the znode that was created. On success, <i>name</i>
+         *             and <i>path</i> are usually equal, unless a sequential
node has
+         *             been created.
+         *
+         * @see ZooKeeper#create(String, byte[], List, CreateMode, StringCallback, Object)
          */
         void processResult(int rc, String path, Object ctx, String name);
 
     }
 
     /**
-     * This callback doesn't retrieve anything from the node. It is useful
-     * for some APIs that doesn't want anything sent back, e.g. {@link
-     * org.apache.zookeeper.ZooKeeper#sync(String,
-     * org.apache.zookeeper.AsyncCallback.VoidCallback, Object)}.
+     * This callback doesn't retrieve anything from the node. It is useful for some APIs
+     * that doesn't want anything sent back, e.g. {@link ZooKeeper#sync(String, VoidCallback,
Object)}.
      */
     @InterfaceAudience.Public
     interface VoidCallback extends AsyncCallback {
 
         /**
          * Process the result of the asynchronous call.
-         * <p>
-         * On success, rc is
-         * {@link org.apache.zookeeper.KeeperException.Code#OK}.
-         * <p>
-         * On failure, rc is set to the corresponding failure code in
-         * {@link org.apache.zookeeper.KeeperException}.
+         *
+         * <p>On success, rc is {@link KeeperException.Code#OK}.
+         *
+         * <p>On failure, rc is set to the corresponding failure code in {@link KeeperException}.
          * <ul>
-         * <li>
-         * {@link org.apache.zookeeper.KeeperException.Code#NONODE}
-         * - The node on given path doesn't exist for some API calls.
-         * </li>
-         * <li>
-         * {@link org.apache.zookeeper.KeeperException.Code#BADVERSION}
-         * - The given version doesn't match the node's version
-         * for some API calls.
-         * </li>
-         * <li>
-         * {@link org.apache.zookeeper.KeeperException.Code#NOTEMPTY}
-         * - the node has children and some API calls cannnot succeed,
-         * e.g. {@link
-         * org.apache.zookeeper.ZooKeeper#delete(String, int,
-         * org.apache.zookeeper.AsyncCallback.VoidCallback, Object)}.
-         * </li>
+         *  <li>{@link KeeperException.Code#NONODE}
+         *             - The node on given path doesn't exist for some API calls.</li>
+         *  <li>{@link KeeperException.Code#BADVERSION}
+         *             - The given version doesn't match the node's version for some API
calls.</li>
+         *  <li>{@link KeeperException.Code#NOTEMPTY}
+         *             - the node has children and some API calls cannot succeed, e.g.
+         *             {@link ZooKeeper#delete(String, int, VoidCallback, Object)}.</li>
          * </ul>
          *
          * @param rc   The return code or the result of the call.
          * @param path The path that we passed to asynchronous calls.
-         * @param ctx  Whatever context object that we passed to
-         *             asynchronous calls.
+         * @param ctx  Whatever context object that we passed to asynchronous calls.
+         *
+         * @see ZooKeeper#delete(String, int, VoidCallback, Object)
+         * @see ZooKeeper#removeAllWatches(String, Watcher.WatcherType, boolean, VoidCallback,
Object)
+         * @see ZooKeeper#removeWatches(String, Watcher, Watcher.WatcherType, boolean, VoidCallback,
Object)
+         * @see ZooKeeper#sync(String, VoidCallback, Object)
+         *
          */
         void processResult(int rc, String path, Object ctx);
 
     }
 
     /**
-     * This callback is used to process the multiple results from
-     * a single multi call.
-     * See {@link org.apache.zookeeper.ZooKeeper#multi} for more information.
+     * This callback is used to process the multiple results from a single multi call.
      */
     @InterfaceAudience.Public
     interface MultiCallback extends AsyncCallback {
 
         /**
          * Process the result of the asynchronous call.
-         * <p>
-         * On success, rc is
-         * {@link org.apache.zookeeper.KeeperException.Code#OK}.
-         * All opResults are
-         * non-{@link org.apache.zookeeper.OpResult.ErrorResult},
-         *
-         * <p>
-         * On failure, rc is a failure code in
-         * {@link org.apache.zookeeper.KeeperException.Code}.
-         * Either opResults is null, or all opResults are
-         * {@link org.apache.zookeeper.OpResult.ErrorResult}.
-         * All operations will be rolled back even if operations
-         * before the failing one were successful.
+         *
+         * <p>On success, rc is {@link KeeperException.Code#OK}. All {@code opResults}
are
+         * non-{@link OpResult.ErrorResult}.
+         *
+         * <p>On failure, rc is a failure code in {@link KeeperException.Code}. Either
+         * {@code opResults} is null, or all {@code opResults} are {@link OpResult.ErrorResult}.
 
 Review comment:
   `all {@code opResults} are {@link OpResult.ErrorResult}.` @breed IIRC ops before the failing
one were successful OpResult?

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


With regards,
Apache Git Services

Mime
View raw message