zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject [24/51] [partial] zookeeper git commit: ZOOKEEPER-3032: MAVEN MIGRATION - branch-3.5 - zookeeper-server
Date Wed, 24 Oct 2018 09:31:19 GMT
http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-contrib/zookeeper-contrib-fatjar/build.xml
----------------------------------------------------------------------
diff --git a/zookeeper-contrib/zookeeper-contrib-fatjar/build.xml b/zookeeper-contrib/zookeeper-contrib-fatjar/build.xml
index 9d510e4..279cb22 100644
--- a/zookeeper-contrib/zookeeper-contrib-fatjar/build.xml
+++ b/zookeeper-contrib/zookeeper-contrib-fatjar/build.xml
@@ -47,7 +47,7 @@
       <fileset dir="${zk.root}/build/test/classes"/>
       <zipgroupfileset dir="${zk.root}/build/lib" includes="*.jar" />
       <zipgroupfileset dir="${zk.root}/build/test/lib" includes="*.jar" />
-      <zipgroupfileset dir="${zk.root}/zookeeper-common/src/main/resources/lib" includes="*.jar"
/>
+      <zipgroupfileset dir="${zk.root}/zookeeper-server/src/main/resources/lib" includes="*.jar"
/>
     </jar>
   </target>
 

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-contrib/zookeeper-contrib-rest/build.xml
----------------------------------------------------------------------
diff --git a/zookeeper-contrib/zookeeper-contrib-rest/build.xml b/zookeeper-contrib/zookeeper-contrib-rest/build.xml
index 2c86228..3a347de 100644
--- a/zookeeper-contrib/zookeeper-contrib-rest/build.xml
+++ b/zookeeper-contrib/zookeeper-contrib-rest/build.xml
@@ -164,7 +164,7 @@
         <fileset dir="${build.dir}/lib" includes="*.jar"/>
         <fileset dir="${zk.root}/build" includes="zookeeper-*.jar"/>
         <pathelement path="${zk.root}/src/contrib/${name}/conf" />
-        <fileset dir="${zk.root}/zookeeper-common/src/main/resources/lib">
+        <fileset dir="${zk.root}/zookeeper-server/src/main/resources/lib">
           <include name="**/*.jar" />
         </fileset>
       </classpath>
@@ -179,7 +179,7 @@
         <tarfileset file="${build.dir}/zookeeper-*-rest.jar" />
         <tarfileset dir="${zk.root}/build" includes="zookeeper-*.jar" prefix="lib" />
         <tarfileset dir="${zk.root}/src/contrib/${name}/conf" prefix="conf" />
-        <tarfileset dir="${zk.root}/zookeeper-common/src/main/resources/lib" prefix="lib"
includes="**/*.jar" />
+        <tarfileset dir="${zk.root}/zookeeper-server/src/main/resources/lib" prefix="lib"
includes="**/*.jar" />
         <tarfileset file="${zk.root}/src/contrib/${name}/rest.sh" />
       </param.listofitems>
     </macro_tar>

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-contrib/zookeeper-contrib-rest/src/test/zkServer.sh
----------------------------------------------------------------------
diff --git a/zookeeper-contrib/zookeeper-contrib-rest/src/test/zkServer.sh b/zookeeper-contrib/zookeeper-contrib-rest/src/test/zkServer.sh
index 6299279..4279d34 100755
--- a/zookeeper-contrib/zookeeper-contrib-rest/src/test/zkServer.sh
+++ b/zookeeper-contrib/zookeeper-contrib-rest/src/test/zkServer.sh
@@ -62,7 +62,7 @@ do
     CLASSPATH="$CLASSPATH:$i"
 done
 
-for i in "${zk_base}"/zookeeper-common/src/main/resource/lib/*.jar
+for i in "${zk_base}"/zookeeper-server/src/main/resource/lib/*.jar
 do
     CLASSPATH="$CLASSPATH:$i"
 done

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/zkServer.sh
----------------------------------------------------------------------
diff --git a/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/zkServer.sh b/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/zkServer.sh
index 35b348e..74ead8c 100755
--- a/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/zkServer.sh
+++ b/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/zkServer.sh
@@ -47,7 +47,7 @@ do
     CLASSPATH="$CLASSPATH:$i"
 done
 
-for i in "${zk_base}"/zookeeper-common/src/main/resource/lib/*.jar
+for i in "${zk_base}"/zookeeper-server/src/main/resource/lib/*.jar
 do
     CLASSPATH="$CLASSPATH:$i"
 done

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-docs/src/documentation/content/xdocs/zookeeperReconfig.xml
----------------------------------------------------------------------
diff --git a/zookeeper-docs/src/documentation/content/xdocs/zookeeperReconfig.xml b/zookeeper-docs/src/documentation/content/xdocs/zookeeperReconfig.xml
index 802ed68..ae22951 100644
--- a/zookeeper-docs/src/documentation/content/xdocs/zookeeperReconfig.xml
+++ b/zookeeper-docs/src/documentation/content/xdocs/zookeeperReconfig.xml
@@ -681,7 +681,7 @@ String configStr = new String(config);
 System.out.println(configStr);]]></programlisting>
         <para>There is also an asynchronous API, and an API accepting comma
           separated Strings instead of List&lt;String&gt;. See
-          zookeeper-common/src/main/java/org/apache/zookeeper/ZooKeeper.java.</para>
+          zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java.</para>
       </section>
       <section id="sc_reconfig_nonincremental">
         <title>Non-incremental mode</title>
@@ -710,7 +710,7 @@ System.out.println(configStr);]]></programlisting>
         <para>There is also an asynchronous API, and an API accepting comma
           separated String containing the new members instead of
           List&lt;String&gt;. See
-          zookeeper-common/src/main/java/org/apache/zookeeper/ZooKeeper.java.</para>
+          zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java.</para>
       </section>
       <section id="sc_reconfig_conditional">
         <title>Conditional reconfig</title>

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-recipes/build-recipes.xml
----------------------------------------------------------------------
diff --git a/zookeeper-recipes/build-recipes.xml b/zookeeper-recipes/build-recipes.xml
index ba0f03b..45054b1 100644
--- a/zookeeper-recipes/build-recipes.xml
+++ b/zookeeper-recipes/build-recipes.xml
@@ -72,7 +72,7 @@
     <fileset dir="${zk.root}/build/test/lib">
       <include name="**/*.jar"/>
     </fileset>
-    <fileset dir="${zk.root}/zookeeper-common/src/main/resources/lib">
+    <fileset dir="${zk.root}/zookeeper-server/src/main/resources/lib">
       <include name="**/*.jar" />
     </fileset>
   </path>

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/tests/zkServer.sh
----------------------------------------------------------------------
diff --git a/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/tests/zkServer.sh b/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/tests/zkServer.sh
index b152380..4836612 100755
--- a/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/tests/zkServer.sh
+++ b/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/tests/zkServer.sh
@@ -51,7 +51,7 @@ do
     CLASSPATH="$CLASSPATH:$i"
 done
 
-for i in "${base_dir}"/zookeeper-common/src/main/resource/lib/*.jar
+for i in "${base_dir}"/zookeeper-server/src/main/resource/lib/*.jar
 do
     CLASSPATH="$CLASSPATH:$i"
 done

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/tests/zkServer.sh
----------------------------------------------------------------------
diff --git a/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/tests/zkServer.sh b/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/tests/zkServer.sh
index b152380..4836612 100755
--- a/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/tests/zkServer.sh
+++ b/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/tests/zkServer.sh
@@ -51,7 +51,7 @@ do
     CLASSPATH="$CLASSPATH:$i"
 done
 
-for i in "${base_dir}"/zookeeper-common/src/main/resource/lib/*.jar
+for i in "${base_dir}"/zookeeper-server/src/main/resource/lib/*.jar
 do
     CLASSPATH="$CLASSPATH:$i"
 done

http://git-wip-us.apache.org/repos/asf/zookeeper/blob/43d71c2e/zookeeper-server/src/main/java/org/apache/zookeeper/AsyncCallback.java
----------------------------------------------------------------------
diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/AsyncCallback.java b/zookeeper-server/src/main/java/org/apache/zookeeper/AsyncCallback.java
new file mode 100644
index 0000000..c5529d7
--- /dev/null
+++ b/zookeeper-server/src/main/java/org/apache/zookeeper/AsyncCallback.java
@@ -0,0 +1,331 @@
+/**
+ * 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.
+ */
+package org.apache.zookeeper;
+
+import java.util.List;
+
+import org.apache.yetus.audience.InterfaceAudience;
+import org.apache.zookeeper.data.ACL;
+import org.apache.zookeeper.data.Stat;
+
+/**
+ * Interface definitions of asynchronous callbacks.
+ * An asynchronous callback is deferred to invoke after a function returns.
+ * Asynchronous calls usually improve system efficiency on IO-related APIs.
+ * <p/>
+ * ZooKeeper provides asynchronous version as equivalent to synchronous APIs.
+ */
+@InterfaceAudience.Public
+public interface AsyncCallback {
+
+    /**
+     * This callback is used to retrieve the stat of the node.
+     */
+    @InterfaceAudience.Public
+    interface StatCallback 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}.
+         * <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>
+         * </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 stat {@link org.apache.zookeeper.data.Stat} object of
+         *             the node on given path.
+         */
+        public void processResult(int rc, String path, Object ctx, Stat stat);
+    }
+
+    /**
+     * This callback is used to retrieve the data and stat of the node.
+     */
+    @InterfaceAudience.Public
+    interface DataCallback extends AsyncCallback {
+        /**
+         * Process the result of asynchronous calls.
+         * <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}.
+         * <ul>
+         * <li>
+         * {@link org.apache.zookeeper.KeeperException.Code#NONODE}
+         * - The node on given path doesn't exist for some API calls.
+         * </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 data The {@link org.apache.zookeeper.server.DataNode#data}
+         *             of the node.
+         * @param stat {@link org.apache.zookeeper.data.Stat} object of
+         *             the node on given path.
+         */
+        public void processResult(int rc, String path, Object ctx, byte data[],
+                Stat stat);
+    }
+
+    /**
+     * This callback is used to retrieve the ACL and stat of the node.
+     */
+    @InterfaceAudience.Public
+    interface ACLCallback 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}.
+         * <ul>
+         * <li>
+         * {@link org.apache.zookeeper.KeeperException.Code#NONODE}
+         * - The node on given path doesn't exist for some API calls.
+         * </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 acl  ACL Id in
+         *             {@link org.apache.zookeeper.ZooDefs.Ids}.
+         * @param stat {@link org.apache.zookeeper.data.Stat} object of
+         *             the node on given path.
+         */
+        public void processResult(int rc, String path, Object ctx,
+                List<ACL> acl, Stat stat);
+    }
+
+    /**
+     * This callback is used to retrieve the children of the node.
+     */
+    @InterfaceAudience.Public
+    interface ChildrenCallback 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}.
+         * <ul>
+         * <li>
+         * {@link org.apache.zookeeper.KeeperException.Code#NONODE}
+         * - The node on given path doesn't exist for some API calls.
+         * </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 children An unordered array of children of the node on
+         *                 given path.
+         */
+        public void processResult(int rc, String path, Object ctx,
+                List<String> children);
+    }
+
+    /**
+     * This callback is used to retrieve the children and stat of the node.
+     */
+    @InterfaceAudience.Public
+    interface Children2Callback extends AsyncCallback {
+        /**
+         * Process the result of the asynchronous call.
+         * See {@link org.apache.zookeeper.AsyncCallback.ChildrenCallback}.
+         *
+         * @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 children An unordered array of children of the node on
+         *                 given path.
+         * @param stat     {@link org.apache.zookeeper.data.Stat} object of
+         *                 the node on given path.
+         */
+        public void processResult(int rc, String path, Object ctx,
+                List<String> children, Stat stat);
+    }
+
+    /**
+     * This callback is used to retrieve the name and stat of the node.
+     */
+    @InterfaceAudience.Public
+    interface Create2Callback extends AsyncCallback {
+        /**
+         * Process the result of the asynchronous call.
+         * See {@link org.apache.zookeeper.AsyncCallback.StringCallback}.
+         *
+         * @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 stat {@link org.apache.zookeeper.data.Stat} object of
+         *             the node on given path.
+         */
+        public void processResult(int rc, String path, Object ctx,
+        		String name, Stat stat);
+    }
+
+    /**
+     * This callback is used to retrieve the name of the node.
+     */
+    @InterfaceAudience.Public
+    interface StringCallback 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}.
+         * <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>
+         * </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.
+         */
+        public 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)}.
+     */
+    @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}.
+         * <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>
+         * </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.
+         */
+        public 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.
+     */
+    @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}.
+         * All opResults are
+         * {@link org.apache.zookeeper.OpResult.ErrorResult}.
+         * All operations will be rollback-ed even if operations
+         * before the failing one were successful.
+         *
+         * @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 opResults The list of results.
+         *                  One result for each operation,
+         *                  and the order matches that of input.
+         */
+        public void processResult(int rc, String path, Object ctx,
+                List<OpResult> opResults);
+    }
+}


Mime
View raw message