diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000000..9689b824124 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,49 @@ +# +# 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. +# + +[default.extend-words] +# abbr +"aroun" = "aroun" +"delet" = "delet" +"dout" = "dout" +"fied" = "fied" +"fle" = "fle" +"fo" = "fo" +"hte" = "hte" +"nd" = "nd" +"nwe" = "nwe" +"pn" = "pn" +"strack" = "strack" +"thr" = "thr" +"ths" = "ths" +"wew" = "wew" +# keyword fp +"atend" = "atend" +"chec" = "chec" +"clos" = "clos" +"erro" = "erro" +"infor" = "infor" +"locahost" = "locahost" +"leafs" = "leafs" +"sceen" = "sceen" + +[files] +extend-exclude = [ + "zookeeper-server/src/test/java/org/apache/zookeeper/common/CertificatesToPlayWith.java", +] diff --git a/owaspSuppressions.xml b/owaspSuppressions.xml index 9a18c5fb2bc..873f38df370 100644 --- a/owaspSuppressions.xml +++ b/owaspSuppressions.xml @@ -48,7 +48,7 @@ CVE-2019-3826 diff --git a/zookeeper-client/zookeeper-client-c/ChangeLog b/zookeeper-client/zookeeper-client-c/ChangeLog index c85a6c0ad86..92b96f9f1e9 100644 --- a/zookeeper-client/zookeeper-client-c/ChangeLog +++ b/zookeeper-client/zookeeper-client-c/ChangeLog @@ -1,13 +1,13 @@ Release 2.1.1 2008-04-30 Andrew Kornev - * changed the distributino package name to "c-client-src" + * changed the distributions package name to "c-client-src" Release 2.1.0 2008-04-30 Andrew Kornev * added the client latency diagnostics; the client prints a warning when the - reponse latency exceeds 20ms + response latency exceeds 20ms * modified logging format to report the znode path for which the zookeeper operation is called @@ -31,12 +31,12 @@ Release 1.1.3 * get_xid() is not thread-safe (xid initialization race condition in the multi-threaded mode). - * the I/O thread doesn’t automatically terminate on AUTH_FAILURE and + * the I/O thread doesn't automatically terminate on AUTH_FAILURE and SESSION_EXPIRED events. * all session events should be processed on the completion thread. - * PING operation doesn’t atomically enqueue the completion and + * PING operation doesn�t atomically enqueue the completion and send buffers like other operations do. * corrected zookeeper_init() doxygen docs. diff --git a/zookeeper-client/zookeeper-client-c/LICENSE b/zookeeper-client/zookeeper-client-c/LICENSE index 7df01ad5534..c3e546da36c 100644 --- a/zookeeper-client/zookeeper-client-c/LICENSE +++ b/zookeeper-client/zookeeper-client-c/LICENSE @@ -285,7 +285,7 @@ * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions + * the following conditions are adhered to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms @@ -310,7 +310,7 @@ * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library + * The word 'cryptographic' can be left out if the routines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: @@ -328,7 +328,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * The licence and distribution terms for any publically available version or + * The licence and distribution terms for any publicly available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] diff --git a/zookeeper-client/zookeeper-client-c/acinclude.m4 b/zookeeper-client/zookeeper-client-c/acinclude.m4 index 9734f215649..55061709180 100644 --- a/zookeeper-client/zookeeper-client-c/acinclude.m4 +++ b/zookeeper-client/zookeeper-client-c/acinclude.m4 @@ -10,7 +10,7 @@ # DX_???_FEATURE(ON|OFF) - control the default setting of a Doxygen feature. # Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics, # 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI' -# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF', +# for generating a separate .chi file by the .chm file, and 'MAN', 'RTF', # 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment # variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide' # paper size. @@ -239,8 +239,8 @@ DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) -# Seperate CHI file generation. -DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file], +# Separate CHI file generation. +DX_ARG_ABLE(chi, [generate doxygen separate compressed HTML help index file], [DX_CHECK_DEPEND(chm, 1)], [DX_CLEAR_DEPEND(chm, 1)], [], diff --git a/zookeeper-client/zookeeper-client-c/include/zookeeper.h b/zookeeper-client/zookeeper-client-c/include/zookeeper.h index 7d889f60557..044250a3098 100644 --- a/zookeeper-client/zookeeper-client-c/include/zookeeper.h +++ b/zookeeper-client/zookeeper-client-c/include/zookeeper.h @@ -108,7 +108,7 @@ enum ZOO_ERRORS { ZBADARGUMENTS = -8, /*!< Invalid arguments */ ZINVALIDSTATE = -9, /*!< Invliad zhandle state */ ZNEWCONFIGNOQUORUM = -13, /*!< No quorum of new config is connected and - up-to-date with the leader of last commmitted + up-to-date with the leader of last committed config - try invoking reconfiguration after new servers are connected and synced */ ZRECONFIGINPROGRESS = -14, /*!< Reconfiguration requested while another @@ -697,7 +697,7 @@ ZOOAPI sasl_callback_t *zoo_sasl_make_basic_callbacks(const char *user, * \return ZOK on success or one of the following errcodes on failure: * ZBADARGUMENTS - invalid input parameters * ZINVALIDSTATE - zhandle state is either ZOO_SESSION_EXPIRED_STATE or ZOO_AUTH_FAILED_STATE - * ZSYSTEMERROR -- a system (OS) error occured; it's worth checking errno to get details + * ZSYSTEMERROR -- a system (OS) error occurred; it's worth checking errno to get details */ ZOOAPI int zoo_set_servers(zhandle_t *zh, const char *hosts); @@ -1779,7 +1779,7 @@ typedef enum { * \param wtype the watcher type to be removed * \param watcher the watcher to be removed, if null all watches for that * path (and watcher type) will be removed - * \param watcherCtx the contex associated with the watcher to be removed + * \param watcherCtx the context associated with the watcher to be removed * \param local whether the watches will be removed locally even if there is * no server connection * \return the return code for the function call. @@ -1789,7 +1789,7 @@ typedef enum { * or ZOO_AUTH_FAILED_STATE * ZBADARGUMENTS - invalid input parameters * ZMARSHALLINGERROR - failed to marshall a request; possibly, out of memory - * ZSYSTEMERROR - a system error occured + * ZSYSTEMERROR - a system error occurred */ ZOOAPI int zoo_aremove_watches(zhandle_t *zh, const char *path, ZooWatcherType wtype, watcher_fn watcher, void *watcherCtx, int local, @@ -1810,7 +1810,7 @@ ZOOAPI int zoo_aremove_watches(zhandle_t *zh, const char *path, * or ZOO_AUTH_FAILED_STATE * ZBADARGUMENTS - invalid input parameters * ZMARSHALLINGERROR - failed to marshall a request; possibly, out of memory - * ZSYSTEMERROR - a system error occured + * ZSYSTEMERROR - a system error occurred */ ZOOAPI int zoo_remove_all_watches(zhandle_t *zh, const char *path, ZooWatcherType wtype, int local); @@ -1830,7 +1830,7 @@ ZOOAPI int zoo_remove_all_watches(zhandle_t *zh, const char *path, * or ZOO_AUTH_FAILED_STATE * ZBADARGUMENTS - invalid input parameters * ZMARSHALLINGERROR - failed to marshall a request; possibly, out of memory - * ZSYSTEMERROR - a system error occured + * ZSYSTEMERROR - a system error occurred */ ZOOAPI int zoo_aremove_all_watches(zhandle_t *zh, const char *path, ZooWatcherType wtype, int local, void_completion_t *completion, @@ -2434,7 +2434,7 @@ ZOOAPI int zoo_multi(zhandle_t *zh, int count, const zoo_op_t *ops, zoo_op_resul * \param wtype the watcher type to be removed * \param watcher the watcher to be removed, if null all watches for that * path (and watcher type) will be removed - * \param watcherCtx the contex associated with the watcher to be removed + * \param watcherCtx the context associated with the watcher to be removed * \param local whether the watches will be removed locally even if there is * no server connection * \return the return code for the function call. @@ -2444,7 +2444,7 @@ ZOOAPI int zoo_multi(zhandle_t *zh, int count, const zoo_op_t *ops, zoo_op_resul * or ZOO_AUTH_FAILED_STATE * ZBADARGUMENTS - invalid input parameters * ZMARSHALLINGERROR - failed to marshall a request; possibly, out of memory - * ZSYSTEMERROR - a system error occured + * ZSYSTEMERROR - a system error occurred */ ZOOAPI int zoo_remove_watches(zhandle_t *zh, const char *path, ZooWatcherType wtype, watcher_fn watcher, void *watcherCtx, int local); diff --git a/zookeeper-client/zookeeper-client-c/src/addrvec.h b/zookeeper-client/zookeeper-client-c/src/addrvec.h index a12642908bb..2a9a8ad9117 100644 --- a/zookeeper-client/zookeeper-client-c/src/addrvec.h +++ b/zookeeper-client/zookeeper-client-c/src/addrvec.h @@ -74,7 +74,7 @@ int addrvec_grow(addrvec_t *avec, uint32_t grow_amount); int addrvec_grow_default(addrvec_t *avec); /** - * Check if an addrvec contains the specificed sockaddr_storage value. + * Check if an addrvec contains the specified sockaddr_storage value. * \returns 1 if it contains the value and 0 otherwise. */ int addrvec_contains(const addrvec_t *avec, const struct sockaddr_storage *addr); diff --git a/zookeeper-client/zookeeper-client-c/src/hashtable/hashtable.c b/zookeeper-client/zookeeper-client-c/src/hashtable/hashtable.c index caa5f6ccc03..bc94a59599b 100644 --- a/zookeeper-client/zookeeper-client-c/src/hashtable/hashtable.c +++ b/zookeeper-client/zookeeper-client-c/src/hashtable/hashtable.c @@ -70,7 +70,7 @@ hash(struct hashtable *h, void *k) static int hashtable_expand(struct hashtable *h) { - /* Double the size of the table to accomodate more entries */ + /* Double the size of the table to accommodate more entries */ struct entry **newtable; struct entry *e; struct entry **pE; diff --git a/zookeeper-client/zookeeper-client-c/src/mt_adaptor.c b/zookeeper-client/zookeeper-client-c/src/mt_adaptor.c index 7292843c326..4e6e1b6bf29 100644 --- a/zookeeper-client/zookeeper-client-c/src/mt_adaptor.c +++ b/zookeeper-client/zookeeper-client-c/src/mt_adaptor.c @@ -121,7 +121,7 @@ int handle_error(zhandle_t* zh, SOCKET sock, char* message) return -1; } -//--create socket pair for interupting selects. +//--create socket pair for interrupting selects. int create_socket_pair(zhandle_t* zh, SOCKET fds[2]) { struct sockaddr_in inaddr; diff --git a/zookeeper-client/zookeeper-client-c/src/recordio.c b/zookeeper-client/zookeeper-client-c/src/recordio.c index 77fae28785f..52036f94e7a 100644 --- a/zookeeper-client/zookeeper-client-c/src/recordio.c +++ b/zookeeper-client/zookeeper-client-c/src/recordio.c @@ -145,7 +145,7 @@ int oa_serialize_buffer(struct oarchive *oa, const char *name, return rc; // this means a buffer of NUll // with size of -1. This is - // waht we use in java serialization for NULL + // what we use in java serialization for NULL if (b->len == -1) { return rc; } diff --git a/zookeeper-client/zookeeper-client-c/src/winport.c b/zookeeper-client/zookeeper-client-c/src/winport.c index d40614c9131..8d8698ee6c5 100644 --- a/zookeeper-client/zookeeper-client-c/src/winport.c +++ b/zookeeper-client/zookeeper-client-c/src/winport.c @@ -83,7 +83,7 @@ int pthread_detach(pthread_t _thread) } void pthread_mutexattr_init(pthread_mutexattr_t* ignore){} -void pthread_mutexattr_settype(pthread_mutexattr_t* ingore_attr, int ignore){} +void pthread_mutexattr_settype(pthread_mutexattr_t* ignore_attr, int ignore){} void pthread_mutexattr_destroy(pthread_mutexattr_t* ignore_attr){} int diff --git a/zookeeper-client/zookeeper-client-c/src/winport.h b/zookeeper-client/zookeeper-client-c/src/winport.h index d216f7fd30d..e8f10ba046b 100644 --- a/zookeeper-client/zookeeper-client-c/src/winport.h +++ b/zookeeper-client/zookeeper-client-c/src/winport.h @@ -80,7 +80,7 @@ int pthread_join(pthread_t _thread, void** ignore); int pthread_detach(pthread_t _thread); void pthread_mutexattr_init(pthread_mutexattr_t* ignore); -void pthread_mutexattr_settype(pthread_mutexattr_t* ingore_attr, int ignore); +void pthread_mutexattr_settype(pthread_mutexattr_t* ignore_attr, int ignore); void pthread_mutexattr_destroy(pthread_mutexattr_t* ignore_attr); diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c b/zookeeper-client/zookeeper-client-c/src/zookeeper.c index 3c64efbb658..a19144b5028 100644 --- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c +++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c @@ -1571,7 +1571,7 @@ static int get_next_server_in_reconfig(zhandle_t *zh) /** * Cycle through our server list to the correct 'next' server. The 'next' server * to connect to depends upon whether we're in a 'reconfig' mode or not. Reconfig - * mode means we've upated the server list and are now trying to find a server + * mode means we've updated the server list and are now trying to find a server * to connect to. Once we get connected, we are no longer in the reconfig mode. * Similarly, if we try to connect to all the servers in the new configuration * and failed, reconfig mode is set to false. @@ -1622,7 +1622,7 @@ const char* zoo_get_current_server(zhandle_t* zh) } /** - * deallocated the free_path only its beeen allocated + * deallocated the free_path only its been allocated * and not equal to path */ void free_duplicate_path(const char *free_path, const char* path) { @@ -5008,7 +5008,7 @@ const char* zerror(int c) case ZINVALIDSTATE: return "invalid zhandle state"; case ZNEWCONFIGNOQUORUM: - return "no quorum of new config is connected and up-to-date with the leader of last commmitted config - try invoking reconfiguration after new servers are connected and synced"; + return "no quorum of new config is connected and up-to-date with the leader of last committed config - try invoking reconfiguration after new servers are connected and synced"; case ZRECONFIGINPROGRESS: return "Another reconfiguration is in progress -- concurrent reconfigs not supported (yet)"; case ZAPIERROR: diff --git a/zookeeper-client/zookeeper-client-c/tests/TestClient.cc b/zookeeper-client/zookeeper-client-c/tests/TestClient.cc index 80e4c928a51..8c79c01b038 100644 --- a/zookeeper-client/zookeeper-client-c/tests/TestClient.cc +++ b/zookeeper-client/zookeeper-client-c/tests/TestClient.cc @@ -1005,7 +1005,7 @@ class Zookeeper_simpleSystem : public CPPUNIT_NS::TestFixture void testChroot() { // the c client async callbacks do // not callback with the path, so - // we dont need to test taht for now + // we dont need to test that for now // we should fix that though soon! watchctx_t ctx, ctx_ch; zhandle_t *zk, *zk_ch; diff --git a/zookeeper-client/zookeeper-client-c/tests/TestOperations.cc b/zookeeper-client/zookeeper-client-c/tests/TestOperations.cc index a36af8417e4..534c7599c1f 100644 --- a/zookeeper-client/zookeeper-client-c/tests/TestOperations.cc +++ b/zookeeper-client/zookeeper-client-c/tests/TestOperations.cc @@ -582,7 +582,7 @@ class Zookeeper_operations : public CPPUNIT_NS::TestFixture CPPUNIT_ASSERT_EQUAL((int)ZCLOSING,res2.rc_); } - // ZOOKEEPER-2891: Invalid processing of zookeeper_close for mutli-request + // ZOOKEEPER-2891: Invalid processing of zookeeper_close for multi-request // while there is a multi request waiting for being processed // call zookeeper_close() from the main event loop // assert the completion callback is called with status ZCLOSING @@ -626,7 +626,7 @@ class Zookeeper_operations : public CPPUNIT_NS::TestFixture CPPUNIT_ASSERT_EQUAL((int)ZCLOSING,res1.rc_); } - // ZOOKEEPER-2891: Invalid processing of zookeeper_close for mutli-request + // ZOOKEEPER-2891: Invalid processing of zookeeper_close for multi-request // send some request #1 (not a multi request) // then, while there is a multi request #2 waiting for being processed // call zookeeper_close() from the completion callback of request #1 diff --git a/zookeeper-client/zookeeper-client-c/tests/TestWatchers.cc b/zookeeper-client/zookeeper-client-c/tests/TestWatchers.cc index 0a269341c57..7947d6f1396 100644 --- a/zookeeper-client/zookeeper-client-c/tests/TestWatchers.cc +++ b/zookeeper-client/zookeeper-client-c/tests/TestWatchers.cc @@ -456,7 +456,7 @@ class Zookeeper_watchers : public CPPUNIT_NS::TestFixture zh=zookeeper_init("localhost:2121",activeWatcher,10000,TEST_CLIENT_ID, &watcher,0); CPPUNIT_ASSERT(zh!=0); - // wait till watcher proccessing has completed (the connection + // wait till watcher processing has completed (the connection // established event) CPPUNIT_ASSERT(ensureCondition( deliveryTracker.isWatcherProcessingCompleted(),1000)<1000); diff --git a/zookeeper-client/zookeeper-client-c/tests/ThreadingUtil.h b/zookeeper-client/zookeeper-client-c/tests/ThreadingUtil.h index 9165412bc8b..45791fd2f59 100644 --- a/zookeeper-client/zookeeper-client-c/tests/ThreadingUtil.h +++ b/zookeeper-client/zookeeper-client-c/tests/ThreadingUtil.h @@ -38,7 +38,7 @@ class AtomicInt{ public: explicit AtomicInt(int32_t init=0):v_(init){} AtomicInt(const AtomicInt& other):v_(other){} - // assigment + // assignment AtomicInt& operator=(const AtomicInt& lhs){ atomic_fetch_store(&v_,lhs); return *this; diff --git a/zookeeper-client/zookeeper-client-c/tests/ZKMocks.h b/zookeeper-client/zookeeper-client-c/tests/ZKMocks.h index a091f2fe8ca..d53a41628e7 100644 --- a/zookeeper-client/zookeeper-client-c/tests/ZKMocks.h +++ b/zookeeper-client/zookeeper-client-c/tests/ZKMocks.h @@ -443,7 +443,7 @@ class ZookeeperServer: public Mock_socket void returnSessionExpired(){ sessionExpired=true; } // this is a one shot trigger that gets reset back to false - // next recv call will return 0 length, thus simulating a connecton loss + // next recv call will return 0 length, thus simulating a connection loss volatile bool connectionLost; void setConnectionLost() {connectionLost=true;} diff --git a/zookeeper-contrib/zookeeper-contrib-loggraph/README.md b/zookeeper-contrib/zookeeper-contrib-loggraph/README.md index aa845fc4b3b..a1b849a3349 100644 --- a/zookeeper-contrib/zookeeper-contrib-loggraph/README.md +++ b/zookeeper-contrib/zookeeper-contrib-loggraph/README.md @@ -44,7 +44,7 @@ To filter by time simply move the slider to the desired start time. The time win Content filtering uses a adhoc filtering language, using prefix notation. The language looks somewhat similar to lisp. A statement in the language takes the form (op arg arg ....). A statement resolves to a boolean value. Statements can be nested. ### 4.1 - Filter arguments -An argument can be a number, a string or a symbol. A number is any argument which starts with -, + or 0 to 9. If the number starts with 0x it is interpretted as hexadecimal. Otherwise it is interpretted as decimal. If the argument begins with a double-quote, (") it is interpretted as a string. Anything else is interpretted as a symbol. +An argument can be a number, a string or a symbol. A number is any argument which starts with -, + or 0 to 9. If the number starts with 0x it is interpreted as hexadecimal. Otherwise it is interpreted as decimal. If the argument begins with a double-quote, (") it is interpreted as a string. Anything else is interpreted as a symbol. ### 4.2 - Filter symbols The possible filter symbols are: diff --git a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/java/org/apache/zookeeper/graph/Log4JSource.java b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/java/org/apache/zookeeper/graph/Log4JSource.java index cbb65ea937a..b0071253d50 100644 --- a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/java/org/apache/zookeeper/graph/Log4JSource.java +++ b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/java/org/apache/zookeeper/graph/Log4JSource.java @@ -289,7 +289,7 @@ private void init() throws IOException { String line = in.readLine(); Matcher m = null; - // if we have read data from the file, and it matchs the timep pattern + // if we have read data from the file, and it matches the timep pattern if ((line != null) && (m = timep.matcher(line)).lookingAt()) { starttime = timestampFromText(dateformat, m.group(1)); } else { diff --git a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/g.raphael.js b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/g.raphael.js index 8e94c36cc07..6957da63053 100644 --- a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/g.raphael.js +++ b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/g.raphael.js @@ -58,7 +58,7 @@ }; Raphael.fn.g.finger = function (x, y, width, height, dir, ending, isPath) { - // dir 0 for horisontal and 1 for vertical + // dir 0 for horizontal and 1 for vertical if ((dir && !height) || (!dir && !width)) { return isPath ? "" : this.path(); } diff --git a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/loggraph.js b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/loggraph.js index 87bb7d89da2..51d47795a8a 100644 --- a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/loggraph.js +++ b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/loggraph.js @@ -99,7 +99,7 @@ LogGraph = function(canvas, status) { /*** - * TODO: refactor these to load the data first, before handing to a draw funciton. + * TODO: refactor these to load the data first, before handing to a draw function. * We shouldn't pass the async q into the drawing function */ this.showLogs = function() { diff --git a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/loggraph.server.js b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/loggraph.server.js index 0a74b5c24b8..0b63be7ac48 100644 --- a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/loggraph.server.js +++ b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/loggraph.server.js @@ -250,8 +250,8 @@ LogGraph.ServerGraph.message = function(graph, src, srctime, dst, zxid) { var ty = (this.src.y + this.dst.y)/2; var t = paper.text(tx, ty, this.name); - var gradiant = (this.dst.y - this.src.y)/(dstx - srcx); - var angle = Math.atan(gradiant) * 57.2958; + var gradient = (this.dst.y - this.src.y)/(dstx - srcx); + var angle = Math.atan(gradient) * 57.2958; t.rotate(angle, true); var arrowl = paper.path("M" + dstx + " " + this.dst.y + " L" + (dstx - 10) +" " + this.dst.y); diff --git a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/raphael.js b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/raphael.js index 3740d0f02ad..1c5c48050b1 100644 --- a/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/raphael.js +++ b/zookeeper-contrib/zookeeper-contrib-loggraph/src/main/resources/webapp/org/apache/zookeeper/graph/resources/raphael.js @@ -3018,9 +3018,9 @@ Raphael = (function () { }; break; case "path": - var pathes = path2curve(from[attr], to[attr]); - from[attr] = pathes[0]; - var toPath = pathes[1]; + var paths = path2curve(from[attr], to[attr]); + from[attr] = paths[0]; + var toPath = paths[1]; diff[attr] = []; for (var i = 0, ii = from[attr][length]; i < ii; i++) { diff[attr][i] = [0]; diff --git a/zookeeper-contrib/zookeeper-contrib-monitoring/cacti/README b/zookeeper-contrib/zookeeper-contrib-monitoring/cacti/README index 8188723e5e2..3beddb36e1a 100644 --- a/zookeeper-contrib/zookeeper-contrib-monitoring/cacti/README +++ b/zookeeper-contrib/zookeeper-contrib-monitoring/cacti/README @@ -29,7 +29,7 @@ WARNING: I have wrote these instructions while installing and configuring the pl WARNING: I'm going to make the assumption that you know how to work with Cacti and how to setup Data Input Methods for custom scripts. I'm also going to assume that you have already installed Cacti and everything works as expected. -You can extend the Cacti's data gathering functionality through external scripts. Cacti comes with a number of scripts out of the box wich are localted in the scripts/ directory. +You can extend the Cacti's data gathering functionality through external scripts. Cacti comes with a number of scripts out of the box which are located in the scripts/ directory. The check_zookeeper.py script can be used a custom data input method for Cacti. diff --git a/zookeeper-contrib/zookeeper-contrib-monitoring/check_zookeeper.py b/zookeeper-contrib/zookeeper-contrib-monitoring/check_zookeeper.py index 0a08e84a7cc..6badf190c11 100755 --- a/zookeeper-contrib/zookeeper-contrib-monitoring/check_zookeeper.py +++ b/zookeeper-contrib/zookeeper-contrib-monitoring/check_zookeeper.py @@ -19,7 +19,7 @@ Generic monitoring script that could be used with multiple platforms (Ganglia, Nagios, Cacti). It requires ZooKeeper 3.4.0 or greater. The script needs the 'mntr' 4letter word -command (patch ZOOKEEPER-744) that was now commited to the trunk. +command (patch ZOOKEEPER-744) that was now committed to the trunk. The script also works with ZooKeeper 3.3.x but in a limited way. """ diff --git a/zookeeper-contrib/zookeeper-contrib-monitoring/nagios/README.txt b/zookeeper-contrib/zookeeper-contrib-monitoring/nagios/README.txt index 317ae14869b..27a12566ffa 100644 --- a/zookeeper-contrib/zookeeper-contrib-monitoring/nagios/README.txt +++ b/zookeeper-contrib/zookeeper-contrib-monitoring/nagios/README.txt @@ -39,7 +39,7 @@ $ cp zookeeper.cfg /etc/nagios-plugins/config 4. Create a virtual host in Nagios used for monitoring the cluster as a whole -OR- Create a hostgroup named 'zookeeper-servers' and add all the zookeeper cluster nodes. -5. Define service checks like I have ilustrated bellow or just use the provided definitions. +5. Define service checks like I have illustrated bellow or just use the provided definitions. define service { use generic-service diff --git a/zookeeper-contrib/zookeeper-contrib-rest/SPEC.txt b/zookeeper-contrib/zookeeper-contrib-rest/SPEC.txt index 8c5f70175a6..3b25bb2df9a 100644 --- a/zookeeper-contrib/zookeeper-contrib-rest/SPEC.txt +++ b/zookeeper-contrib/zookeeper-contrib-rest/SPEC.txt @@ -39,7 +39,7 @@ that are easy and familiar to program against, and deployed as part of the language runtime. Thus, for simple CRUD clients, an HTTP gateway would be a less cumbersome interface than the ZooKeeper library. -This document describes a gatway for using HTTP to interact with a +This document describes a gateway for using HTTP to interact with a ZooKeeper repository. Binding ZooKeeper to HTTP @@ -72,7 +72,7 @@ best practice. Root ---- -The following examples assume that the ZooKeeper znode heirarchy is +The following examples assume that the ZooKeeper znode hierarchy is bound to the root of the HTTP servers namespace. This may not be the case in practice however, the gateway may bind to some prefix, for example the URL for accessing /a/b/c may be: @@ -128,14 +128,14 @@ a new session. If the session creation is successful, then a 201 code will be returned. -A session is just an UUID that you can pass around as a parameter and -the REST server will foward your request on the attached persistent +A session is just a UUID that you can pass around as a parameter and +the REST server will forward your request on the attached persistent connection. Keeping a session alive ----------------------- -To keep a session alive you must send hearbeat requests: +To keep a session alive you must send heartbeat requests: PUT /sessions/v1/ HTTP/1.1 diff --git a/zookeeper-contrib/zookeeper-contrib-rest/src/main/java/org/apache/zookeeper/server/jersey/resources/ZNodeResource.java b/zookeeper-contrib/zookeeper-contrib-rest/src/main/java/org/apache/zookeeper/server/jersey/resources/ZNodeResource.java index 77371eab53d..84eaca819e2 100644 --- a/zookeeper-contrib/zookeeper-contrib-rest/src/main/java/org/apache/zookeeper/server/jersey/resources/ZNodeResource.java +++ b/zookeeper-contrib/zookeeper-contrib-rest/src/main/java/org/apache/zookeeper/server/jersey/resources/ZNodeResource.java @@ -307,7 +307,7 @@ public Response createZNode( throw new WebApplicationException(Response.status( Response.Status.BAD_REQUEST).entity( new ZError(ui.getRequestUri().toString(), path - + " bad operaton " + op)).build()); + + " bad operation " + op)).build()); } if (setNull.equals("true")) { @@ -358,7 +358,7 @@ public Response createZNodeAsOctet(@PathParam("path") String path, throw new WebApplicationException(Response.status( Response.Status.BAD_REQUEST).entity( new ZError(ui.getRequestUri().toString(), path - + " bad operaton " + op)).build()); + + " bad operation " + op)).build()); } if (setNull.equals("true")) { diff --git a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/blockingqueue.h b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/blockingqueue.h index 4677290d7b6..aad10c29839 100644 --- a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/blockingqueue.h +++ b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/blockingqueue.h @@ -50,7 +50,7 @@ class BlockingQueue { * \brief Retrieves and removes the head of this queue, waiting if * \brief no elements are present in this queue. * - * @param timeout how long to wait until an element becomes availabe, + * @param timeout how long to wait until an element becomes available, * in milliseconds; if 0 then wait forever * @param timedOut if not NULL then set to true whether this function timed out * @return the element from the queue diff --git a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/doxygen.cfg b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/doxygen.cfg index 308b09450a4..da384f1b33a 100644 --- a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/doxygen.cfg +++ b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/doxygen.cfg @@ -401,7 +401,7 @@ SHOW_DIRECTORIES = YES # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the progam writes to standard output +# provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = diff --git a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/event.h b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/event.h index 936ecc60453..f218be6e7b6 100644 --- a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/event.h +++ b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/event.h @@ -183,7 +183,7 @@ class GenericEvent { * \brief Constructor. * * @param type the type of this event - * @param eventWarpper the wrapper around event's data + * @param eventWrapper the wrapper around event's data */ GenericEvent(int type, AbstractEventWrapper *eventWrapper) : m_type(type), m_eventWrapper(eventWrapper) { diff --git a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/thread.h b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/thread.h index 0ed12d7f645..c647a3d51ae 100644 --- a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/thread.h +++ b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/thread.h @@ -41,7 +41,7 @@ class Thread { void Create(void* ctx, ThreadFunc func); void Join() { - //avoid SEGFAULT because of unitialized mThread + //avoid SEGFAULT because of initialized mThread //in case Create(...) was never called if (_func != NULL) { pthread_join(mThread, 0); diff --git a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkadapter.cc b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkadapter.cc index 7f02fa33b72..55f72396829 100644 --- a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkadapter.cc +++ b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkadapter.cc @@ -505,7 +505,7 @@ ZooKeeperAdapter::verifyConnection() throw(ZooKeeperException) if (m_state != AS_CONNECTING) { LOG_TRACE( LOG, "yes. Checking if allowed to auto-reconnect..." ); - //...not in progres, so check if we can reconnect + //...not in progress, so check if we can reconnect if (!m_zkConfig.getAutoReconnect()) { //...too bad, disallowed :( LOG_TRACE( LOG, "no. Sorry." ); diff --git a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkadapter.h b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkadapter.h index 8d4d1d57f0a..13c12da32de 100644 --- a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkadapter.h +++ b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkadapter.h @@ -160,7 +160,7 @@ class ZooKeeperConfig const int m_leaseTimeout; /** - * True if this adapater should attempt to autoreconnect in case + * True if this adapter should attempt to autoreconnect in case * the current session has been dropped. */ const bool m_autoReconnect; @@ -616,7 +616,7 @@ class ZooKeeperAdapter /** * Returns the remaining connect timeout. The timeout resets - * to {@link #m_connectTimeout} on a successfull connection to the ZK. + * to {@link #m_connectTimeout} on a successfulconnection to the ZK. * * @return the remaining connect timeout, in milliseconds */ diff --git a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkfuse.cc b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkfuse.cc index 6a8216885fa..cfe552c349c 100644 --- a/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkfuse.cc +++ b/zookeeper-contrib/zookeeper-contrib-zkfuse/src/zkfuse.cc @@ -320,7 +320,7 @@ enum ZkFuseNameType { */ ZkFuseNameRegType = 1, /** - ZkFuse path is synthesized and identifies the chidlren part of a + ZkFuse path is synthesized and identifies the children part of a ZooKeeper node, i.e. Posix directory semantics is expected. */ ZkFuseNameDirType = 2 @@ -707,7 +707,7 @@ class ZkFuseHandleManager : boost::noncopyable ZkFuseHandleManagerFactory - factory for ZkFuseHandleManager. This is the only way to create a ZkFuseHandleManager instance. - to make sure that _thisWeakPtr of the instance is intialized + to make sure that _thisWeakPtr of the instance is initialized after the instance is created. */ class ZkFuseHandleManagerFactory @@ -1354,7 +1354,7 @@ class ZkFuseFile : boost::noncopyable */ uint32_t version; /** - Acces time in milliseconds. + Access time in milliseconds. */ uint64_t atime; /** @@ -1535,7 +1535,7 @@ class ZkFuseFile : boost::noncopyable /** Remove a ZkFuse directory. - If force is true, then the ZooKeeper node and its decendants + If force is true, then the ZooKeeper node and its descendants will be deleted. If force is false, then this method implements the semantics @@ -1614,7 +1614,7 @@ class ZkFuseFile : boost::noncopyable the ZooKeeper node has no data. - If the ZkFuse regular file represents the data part of the ZooKeeper node which is presented as a ZkFuse regular file, - the ZooKeeper node and its decendants are deleted. + the ZooKeeper node and its descendants are deleted. Returns -EISDIR if the ZkFuse regular file cannot be deleted because ZkFuse consider it to be a directory. @@ -1711,7 +1711,7 @@ class ZkFuseFile : boost::noncopyable Get attributes without accessing metadata. The atime and mtime returned does not take into consideration - overrides present in a matadata file. + overrides present in a metadata file. \return 0 if successful, otherwise negative errno. \param stbuf return attributes here. @@ -1836,7 +1836,7 @@ class ZkFuseFile : boost::noncopyable a client is trying to open the path. \see _refCount. Sets deleted to true. \see _deleted. Sets number of currently directory opens to zero. \see _openDirCount. - Invalidate cach for children information and data. + Invalidate cache for children information and data. \param manager the ZkFuseHandleManager instance who is creating this ZkFuseFile instance. @@ -2909,7 +2909,7 @@ class ZkFuseFile : boost::noncopyable /** Remove a ZkFuse directory. - If force is true, then the ZooKeeper node and its decendants + If force is true, then the ZooKeeper node and its descendants will be deleted. If force is false, then this method implements the semantics @@ -2956,7 +2956,7 @@ class ZkFuseFile : boost::noncopyable the ZooKeeper node has no data. - If the ZkFuse regular file represents the data part of the ZooKeeper node which is presented as a ZkFuse regular file, - the ZooKeeper node and its decendants are deleted. + the ZooKeeper node and its descendants are deleted. Returns -EISDIR if the ZkFuse regular file cannot be deleted because ZkFuse consider it to be a directory. @@ -3043,7 +3043,7 @@ ZkFuseHandleManager::allocate(const std::string & path, bool & newFile) /* Not really supposed to invoke the new ZkFuseFile instance * because this method is not supposed to invoke ZkFuseFile * methods that while holding _mutex. However, it is safe - * to do without casuing deadlock because these methods + * to do without causing deadlock because these methods * are known not to invoke other methods, especially one * that invoke this ZkFuseHandleManager instance. */ diff --git a/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/close_deadlock_test.py b/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/close_deadlock_test.py index 921d2cc4b05..b56d44eecce 100644 --- a/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/close_deadlock_test.py +++ b/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/close_deadlock_test.py @@ -26,7 +26,7 @@ class CloseDeadlockTest(zktestbase.TestBase): https://issues.apache.org/jira/browse/ZOOKEEPER-763 zookeeper.close blocks on waiting for all completions to - finish. Previously it was doing so while holding teh GIL, stopping + finish. Previously it was doing so while holding the GIL, stopping any completions from actually continuing. This test is a failure if it does not exit within a few seconds. diff --git a/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/create_test.py b/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/create_test.py index 8ab80f9565a..29f63a9ffb4 100755 --- a/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/create_test.py +++ b/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/create_test.py @@ -59,7 +59,7 @@ def test_sync_create_existing(self): def test_exception_paths(self): """ - Make sure common exceptions due to API misuse are correctly propogated + Make sure common exceptions due to API misuse are correctly propagated """ self.assertRaises(zookeeper.BadArgumentsException, zookeeper.create, diff --git a/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/get_set_test.py b/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/get_set_test.py index b77b3b22165..226e8c183ff 100755 --- a/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/get_set_test.py +++ b/zookeeper-contrib/zookeeper-contrib-zkpython/src/test/get_set_test.py @@ -70,7 +70,7 @@ def test_sync_getset(self): def test_stat_deleted_node(self): """ Test for a bug that surfaced when trying to build a - stat object from a non-existant node. + stat object from a non-existent node. """ self.ensureDeleted("/zk-python-test-deleteme") diff --git a/zookeeper-contrib/zookeeper-contrib-zktreeutil/README.txt b/zookeeper-contrib/zookeeper-contrib-zktreeutil/README.txt index 8250498bf57..6a7ef63dacb 100644 --- a/zookeeper-contrib/zookeeper-contrib-zktreeutil/README.txt +++ b/zookeeper-contrib/zookeeper-contrib-zktreeutil/README.txt @@ -26,7 +26,7 @@ UPDATE: Make the incremental changes into the live ZK-tree from saved XML, essen lly after running the diff. DUMP: Dumps the ZK-tree on the standard output device reading either from live ZK -server or XML file. Like export, ZK-subtree can be dumped with optionaly +server or XML file. Like export, ZK-subtree can be dumped with optionally providing the path to the ZK-subtree, and till a certain depth of the (sub)tree. The exported ZK data into XML file can be shortened by only keeping the static ZK diff --git a/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc b/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc index 199b1ed6976..c1f65916a37 100644 --- a/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc +++ b/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.cc @@ -500,7 +500,7 @@ namespace zktreeutil 0, buffer, &len, stat ); } while (rc != ZOK && rh.handleRC(rc)); - if (rc != ZOK) // checl return code + if (rc != ZOK) // check return code { std::cerr << "[zktreeutil] Error in fetching value of " << path << std::endl; throw ZooKeeperException( string("Unable to get data of node ") + path, rc ); diff --git a/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.h b/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.h index 91e63e0ac8f..ffefb28a7da 100644 --- a/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.h +++ b/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkAdaptor.h @@ -164,7 +164,7 @@ namespace zktreeutil const int m_leaseTimeout; /** - * True if this adapater should attempt to autoreconnect in case + * True if this adapter should attempt to autoreconnect in case * the current session has been dropped. */ const bool m_autoReconnect; diff --git a/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkTreeUtil.h b/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkTreeUtil.h index 2fac401f785..872bebecbdf 100644 --- a/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkTreeUtil.h +++ b/zookeeper-contrib/zookeeper-contrib-zktreeutil/src/ZkTreeUtil.h @@ -271,7 +271,7 @@ namespace zktreeutil private: ZkTreeNodeSptr zkRootSptr_; // ZK tree root node - bool loaded_; // Falg indicating whether ZK tree loaded into memory + bool loaded_; // Flag indicating whether ZK tree loaded into memory string sslParams_; // Comma separated parameters to initiate SSL connection }; } diff --git a/zookeeper-contrib/zookeeper-contrib-zooinspector/TODO b/zookeeper-contrib/zookeeper-contrib-zooinspector/TODO index 404d5c9c699..eb6e1a15042 100644 --- a/zookeeper-contrib/zookeeper-contrib-zooinspector/TODO +++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/TODO @@ -10,7 +10,7 @@ http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html -- Rename classes to avoid redundand "ZooInspector" prefix. +- Rename classes to avoid redundant "ZooInspector" prefix. - Ant build file has hard coded log4j dependency. (ZK will move to maven anyways...) diff --git a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/com/nitido/utils/toaster/Toaster.java b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/com/nitido/utils/toaster/Toaster.java index 2888caff998..126fd65c64c 100644 --- a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/com/nitido/utils/toaster/Toaster.java +++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/com/nitido/utils/toaster/Toaster.java @@ -142,7 +142,7 @@ class SingleToaster extends javax.swing.JWindow /*** - * Simple costructor that initialized components... + * Simple constructor that initialized components... */ public SingleToaster() { diff --git a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeSelectionListener.java b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeSelectionListener.java index a39edd55dc9..3f977b4c035 100644 --- a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeSelectionListener.java +++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeSelectionListener.java @@ -18,7 +18,7 @@ package org.apache.zookeeper.inspector.gui.nodeviewer; /** - * An interface to be implented by any component that needs notification when a new element + * An interface to be implement by any component that needs notification when a new element * is selected in the UI JTree representing the set of available ZNodes. */ public interface NodeSelectionListener { diff --git a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeViewerMetaData.java b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeViewerMetaData.java index 6a369c51d0e..4523740daf5 100644 --- a/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeViewerMetaData.java +++ b/zookeeper-contrib/zookeeper-contrib-zooinspector/src/main/java/org/apache/zookeeper/inspector/gui/nodeviewer/NodeViewerMetaData.java @@ -167,17 +167,17 @@ protected void done() { private String formatValByKeyType(String key, String value) { if(key==null) return value; - String formatedVal=value; + String formattedVal=value; switch (key){ case "Ephemeral Owner": try{ - formatedVal = String.format("0x%x", Long.parseLong(value)); + formattedVal = String.format("0x%x", Long.parseLong(value)); }catch (NumberFormatException e){ LoggerFactory.getLogger().warn("parse {}'s value {} to hex fail",key,value,e); } break; } - return formatedVal; + return formattedVal; } }; worker.execute(); diff --git a/zookeeper-docs/src/main/resources/markdown/releasenotes.md b/zookeeper-docs/src/main/resources/markdown/releasenotes.md index e32614df065..a27b6ffdd12 100644 --- a/zookeeper-docs/src/main/resources/markdown/releasenotes.md +++ b/zookeeper-docs/src/main/resources/markdown/releasenotes.md @@ -184,7 +184,7 @@ Version 2.2.1 code, documentation, binaries, etc... are still accessible on [Sou |[ZOOKEEPER-189](https://issues.apache.org/jira/browse/ZOOKEEPER-189)|forrest build not validated xml of input documents| |[ZOOKEEPER-188](https://issues.apache.org/jira/browse/ZOOKEEPER-188)|Check that election port is present for all servers| |[ZOOKEEPER-185](https://issues.apache.org/jira/browse/ZOOKEEPER-185)|Improved version of FLETest| -|[ZOOKEEPER-184](https://issues.apache.org/jira/browse/ZOOKEEPER-184)|tests: An explicit include derective is needed for the usage of memcpy functions| +|[ZOOKEEPER-184](https://issues.apache.org/jira/browse/ZOOKEEPER-184)|tests: An explicit include directive is needed for the usage of memcpy functions| |[ZOOKEEPER-183](https://issues.apache.org/jira/browse/ZOOKEEPER-183)|Array subscript is above array bounds in od_completion, src/cli.c.| |[ZOOKEEPER-182](https://issues.apache.org/jira/browse/ZOOKEEPER-182)|zookeeper_init accepts empty host-port string and returns valid pointer to zhandle_t.| |[ZOOKEEPER-17](https://issues.apache.org/jira/browse/ZOOKEEPER-17)|zookeeper_init doc needs clarification| @@ -228,7 +228,7 @@ Version 2.2.1 code, documentation, binaries, etc... are still accessible on [Sou |[ZOOKEEPER-56](https://issues.apache.org/jira/browse/ZOOKEEPER-56)|Add clover support to build.xml.| |[ZOOKEEPER-75](https://issues.apache.org/jira/browse/ZOOKEEPER-75)|register the ZooKeeper mailing lists with nabble.com| |[ZOOKEEPER-54](https://issues.apache.org/jira/browse/ZOOKEEPER-54)|remove sleeps in the tests.| -|[ZOOKEEPER-55](https://issues.apache.org/jira/browse/ZOOKEEPER-55)|build.xml failes to retrieve a release number from SVN and the ant target "dist" fails| +|[ZOOKEEPER-55](https://issues.apache.org/jira/browse/ZOOKEEPER-55)|build.xml fails to retrieve a release number from SVN and the ant target "dist" fails| |[ZOOKEEPER-89](https://issues.apache.org/jira/browse/ZOOKEEPER-89)|invoke WhenOwnerListener.whenNotOwner when the ZK connection fails| |[ZOOKEEPER-90](https://issues.apache.org/jira/browse/ZOOKEEPER-90)|invoke WhenOwnerListener.whenNotOwner when the ZK session expires and the znode is the leader| |[ZOOKEEPER-82](https://issues.apache.org/jira/browse/ZOOKEEPER-82)|Make the ZooKeeperServer more DI friendly.| diff --git a/zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md b/zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md index e571652e497..4b7fd0954f3 100644 --- a/zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md +++ b/zookeeper-docs/src/main/resources/markdown/zookeeperAdmin.md @@ -1211,7 +1211,7 @@ property, when available, is noted below. The default value is false. * *serializeLastProcessedZxid.enabled* - (Jave system property: **zookeeper.serializeLastProcessedZxid.enabled**) + (Java system property: **zookeeper.serializeLastProcessedZxid.enabled**) **New in 3.9.0:** If enabled, ZooKeeper serializes the lastProcessedZxid when snapshot and deserializes it when restore. Defaults to true. Needs to be enabled for performing snapshot and restore diff --git a/zookeeper-jute/src/main/java/org/apache/jute/compiler/JFile.java b/zookeeper-jute/src/main/java/org/apache/jute/compiler/JFile.java index 1d5ed4144fc..d5fb051dd3e 100644 --- a/zookeeper-jute/src/main/java/org/apache/jute/compiler/JFile.java +++ b/zookeeper-jute/src/main/java/org/apache/jute/compiler/JFile.java @@ -81,7 +81,7 @@ public void genCode(String language, File outputDirectory) outputDirectory); gen.genCode(); } else { - throw new IOException("Cannnot recognize language:" + language); + throw new IOException("Cannot recognize language:" + language); } } } diff --git a/zookeeper-jute/src/main/java/org/apache/jute/compiler/JRecord.java b/zookeeper-jute/src/main/java/org/apache/jute/compiler/JRecord.java index c26e249102f..618b4c50bb0 100644 --- a/zookeeper-jute/src/main/java/org/apache/jute/compiler/JRecord.java +++ b/zookeeper-jute/src/main/java/org/apache/jute/compiler/JRecord.java @@ -407,7 +407,7 @@ public void genJavaCode(File outputDirectory) throws IOException { if (!pkgdir.exists()) { // create the pkg directory if (!pkgdir.mkdirs()) { - throw new IOException("Cannnot create directory: " + pkgpath); + throw new IOException("Cannot create directory: " + pkgpath); } } else if (!pkgdir.isDirectory()) { throw new IOException(pkgpath + " is not a directory."); @@ -580,7 +580,7 @@ public void genCsharpCode(File outputDirectory) throws IOException { if (!outputDirectory.exists()) { // create the pkg directory if (!outputDirectory.mkdirs()) { - throw new IOException("Cannnot create directory: " + outputDirectory); + throw new IOException("Cannot create directory: " + outputDirectory); } } else if (!outputDirectory.isDirectory()) { throw new IOException(outputDirectory + " is not a directory."); diff --git a/zookeeper-jute/src/main/java/org/apache/jute/compiler/package.html b/zookeeper-jute/src/main/java/org/apache/jute/compiler/package.html index 03bdb1bbb01..7eb07105851 100644 --- a/zookeeper-jute/src/main/java/org/apache/jute/compiler/package.html +++ b/zookeeper-jute/src/main/java/org/apache/jute/compiler/package.html @@ -24,7 +24,7 @@ This package contains classes needed for code generation from the hadoop record compiler. CppGenerator and JavaGenerator are the main entry points from the parser. There are classes - corrsponding to every primitive type and compound type + corresponding to every primitive type and compound type included in Hadoop record I/O syntax. diff --git a/zookeeper-jute/src/main/java/org/apache/jute/package.html b/zookeeper-jute/src/main/java/org/apache/jute/package.html index f769b74c111..b00d97b18e5 100644 --- a/zookeeper-jute/src/main/java/org/apache/jute/package.html +++ b/zookeeper-jute/src/main/java/org/apache/jute/package.html @@ -29,7 +29,7 @@

Introduction

Software systems of any significant complexity require mechanisms for data interchange with the outside world. These interchanges typically involve the -marshaling and unmarshaling of logical units of data to and from data streams +marshaling and unmarshalling of logical units of data to and from data streams (files, network connections, memory buffers etc.). Applications usually have some code for serializing and deserializing the data types that they manipulate embedded in them. The work of serialization has several features that make @@ -49,7 +49,7 @@

Introduction

  • enabling the specification of simple serializable data types (records)
  • enabling the generation of code in multiple target languages for -marshaling and unmarshaling such types +marshaling and unmarshalling such types
  • providing target language specific support that will enable application programmers to incorporate generated code into their applications
@@ -397,7 +397,7 @@

C++

Each field within the record will cause the generation of a private member declaration of the appropriate type in the class declaration, and one or more -acccessor methods. The generated class will implement the serialize and +accessor methods. The generated class will implement the serialize and deserialize methods defined in hadoop::Record+. It will also implement the inspection methods type and signature from hadoop::Record. A default constructor and virtual destructor will also diff --git a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/main/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProvider.java b/zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/main/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProvider.java index af4bff9d218..574eaa2ce3b 100644 --- a/zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/main/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProvider.java +++ b/zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/main/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProvider.java @@ -437,7 +437,7 @@ public PrometheusGaugeWrapper(String name, Gauge gauge, io.prometheus.client.Gau } /** - * Call the callack and update Prometheus Gauge. This method is called + * Call the callback and update Prometheus Gauge. This method is called * when the server is polling for a value. */ private void sample() { diff --git a/zookeeper-recipes/README.txt b/zookeeper-recipes/README.txt index 856dae0417b..bc788741d63 100644 --- a/zookeeper-recipes/README.txt +++ b/zookeeper-recipes/README.txt @@ -19,7 +19,7 @@ Zookeeper is used (and can be used) for more than what we have listed in the doc 7) To run the c tests in all the recipes, - make sure the main zookeeper c libraries in -{top}/src/c/ are compiled. Run autoreconf -if;./configure; make. The libaries +{top}/src/c/ are compiled. Run autoreconf -if;./configure; make. The libraries will be installed in {top}/src/c/.libs. - run autoreconf if;./configure;make run-check in zookeeper-recipes/$recipename/src/c diff --git a/zookeeper-recipes/zookeeper-recipes-lock/README.txt b/zookeeper-recipes/zookeeper-recipes-lock/README.txt index 4ce629ee1e1..438de1bdbb9 100644 --- a/zookeeper-recipes/zookeeper-recipes-lock/README.txt +++ b/zookeeper-recipes/zookeeper-recipes-lock/README.txt @@ -19,7 +19,7 @@ mentioned in ../../docs/recipes.[html,pdf]. 2) To compile the lock java recipe you can just run ant jar from -this directory. For compiling the c libarary go to zookeeper-client/zookeeper-client-c and read +this directory. For compiling the c library go to zookeeper-client/zookeeper-client-c and read the INSTALLATION instructions. Please report any bugs on the jira diff --git a/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/acinclude.m4 b/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/acinclude.m4 index a4d405a8044..13cacbf81e1 100644 --- a/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/acinclude.m4 +++ b/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/acinclude.m4 @@ -10,7 +10,7 @@ # DX_???_FEATURE(ON|OFF) - control the default setting of a Doxygen feature. # Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics, # 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI' -# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF', +# for generating a separate .chi file by the .chm file, and 'MAN', 'RTF', # 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment # variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide' # paper size. @@ -239,8 +239,8 @@ DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) -# Seperate CHI file generation. -DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file], +# Separate CHI file generation. +DX_ARG_ABLE(chi, [generate doxygen separate compressed HTML help index file], [DX_CHECK_DEPEND(chm, 1)], [DX_CLEAR_DEPEND(chm, 1)], [], diff --git a/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/include/zoo_lock.h b/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/include/zoo_lock.h index 5c06bbf2ff2..a3c81123786 100644 --- a/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/include/zoo_lock.h +++ b/zookeeper-recipes/zookeeper-recipes-lock/src/main/c/include/zoo_lock.h @@ -27,7 +27,7 @@ extern "C" { /** * \brief the call back function called on status change of lock * - * the call back funtion is called with a rc of 0 if lock is acquired and + * the call back function is called with a rc of 0 if lock is acquired and * with an rc of 1 if the lock is released * \param rc the value to let us know if its locked or unlocked * \param cbdata the callback data that we passed when initializing @@ -124,7 +124,7 @@ ZOOAPI void zkr_lock_setcallback(zkr_lock_mutex_t *mutex, /** * \brief get the callback function for zookeeper mutex * - * this method gets the callback funtion for zookeeper mutex + * this method gets the callback function for zookeeper mutex * \param mutex the zookeeper mutex * \return the lock completion function */ diff --git a/zookeeper-recipes/zookeeper-recipes-lock/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java b/zookeeper-recipes/zookeeper-recipes-lock/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java index bcaaba30b34..aeba7eff295 100644 --- a/zookeeper-recipes/zookeeper-recipes-lock/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java +++ b/zookeeper-recipes/zookeeper-recipes-lock/src/main/java/org/apache/zookeeper/recipes/lock/WriteLock.java @@ -57,7 +57,7 @@ public class WriteLock extends ProtocolSupport { private LockZooKeeperOperation zop; /** - * zookeeper contructor for writelock. + * zookeeper constructor for writelock. * * @param zookeeper zookeeper client instance * @param dir the parent path you want to use for locking @@ -73,7 +73,7 @@ public WriteLock(ZooKeeper zookeeper, String dir, List acl) { } /** - * zookeeper contructor for writelock with callback. + * zookeeper constructor for writelock with callback. * * @param zookeeper the zookeeper client instance * @param dir the parent path you want to use for locking @@ -174,10 +174,10 @@ public void process(WatchedEvent event) { private class LockZooKeeperOperation implements ZooKeeperOperation { /** - * find if we have been created earler if not create our node. + * find if we have been created earlier if not create our node. * * @param prefix the prefix node - * @param zookeeper teh zookeeper client + * @param zookeeper the zookeeper client * @param dir the dir paretn * @throws KeeperException * @throws InterruptedException @@ -225,7 +225,7 @@ public boolean execute() throws KeeperException, InterruptedException { // lets force the recreation of the id id = null; } else { - // lets sort them explicitly (though they do seem to come back in order ususally :) + // lets sort them explicitly (though they do seem to come back in order usually :) SortedSet sortedNames = new TreeSet<>(); for (String name : names) { sortedNames.add(new ZNodeName(dir + "/" + name)); diff --git a/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/acinclude.m4 b/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/acinclude.m4 index a4d405a8044..13cacbf81e1 100644 --- a/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/acinclude.m4 +++ b/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/acinclude.m4 @@ -10,7 +10,7 @@ # DX_???_FEATURE(ON|OFF) - control the default setting of a Doxygen feature. # Supported features are 'DOXYGEN' itself, 'DOT' for generating graphics, # 'HTML' for plain HTML, 'CHM' for compressed HTML help (for MS users), 'CHI' -# for generating a seperate .chi file by the .chm file, and 'MAN', 'RTF', +# for generating a separate .chi file by the .chm file, and 'MAN', 'RTF', # 'XML', 'PDF' and 'PS' for the appropriate output formats. The environment # variable DOXYGEN_PAPER_SIZE may be specified to override the default 'a4wide' # paper size. @@ -239,8 +239,8 @@ DX_ARG_ABLE(chm, [generate doxygen compressed HTML help documentation], DX_ENV_APPEND(GENERATE_HTMLHELP, YES)], [DX_ENV_APPEND(GENERATE_HTMLHELP, NO)]) -# Seperate CHI file generation. -DX_ARG_ABLE(chi, [generate doxygen seperate compressed HTML help index file], +# Separate CHI file generation. +DX_ARG_ABLE(chi, [generate doxygen separate compressed HTML help index file], [DX_CHECK_DEPEND(chm, 1)], [DX_CLEAR_DEPEND(chm, 1)], [], diff --git a/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/src/zoo_queue.c b/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/src/zoo_queue.c index d7cc5707ec0..8bf3415291b 100644 --- a/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/src/zoo_queue.c +++ b/zookeeper-recipes/zookeeper-recipes-queue/src/main/c/src/zoo_queue.c @@ -249,7 +249,7 @@ ZOOAPI int zkr_queue_remove(zkr_queue_t *queue, char *buffer, int *buffer_len){ * * Whichever thread is last to call their required function disposes of the latch. * - * The latch may disposed if no threads will call the waiting, marking, or triggering functions using take_latch_destroy_syncrhonized(). + * The latch may disposed if no threads will call the waiting, marking, or triggering functions using take_latch_destroy_synchronized(). */ struct take_latch { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNIO.java b/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNIO.java index 3ecce4c8844..ea58b857e7d 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNIO.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNIO.java @@ -154,12 +154,12 @@ void doIO(Queue pendingQueue, ClientCnxn cnxn) throws InterruptedExcepti } } - private Packet findSendablePacket(LinkedBlockingDeque outgoingQueue, boolean tunneledAuthInProgres) { + private Packet findSendablePacket(LinkedBlockingDeque outgoingQueue, boolean tunneledAuthInProgress) { if (outgoingQueue.isEmpty()) { return null; } // If we've already starting sending the first packet, we better finish - if (outgoingQueue.getFirst().bb != null || !tunneledAuthInProgres) { + if (outgoingQueue.getFirst().bb != null || !tunneledAuthInProgress) { return outgoingQueue.getFirst(); } // Since client's authentication with server is in progress, diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java b/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java index 06826a672ed..0516892abfa 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java @@ -356,7 +356,7 @@ public enum Code implements CodeDeprecated { OPERATIONTIMEOUT(OperationTimeout), /** Invalid arguments */ BADARGUMENTS(BadArguments), - /** No quorum of new config is connected and up-to-date with the leader of last commmitted config - try + /** No quorum of new config is connected and up-to-date with the leader of last committed config - try * invoking reconfiguration after new servers are connected and synced */ NEWCONFIGNOQUORUM(NewConfigNoQuorum), /** Another reconfiguration is in progress -- concurrent reconfigs not supported (yet) */ diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java index e04984fa918..4096ec3a7e5 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java @@ -1357,7 +1357,7 @@ private String prependChroot(String clientPath) { * of the node by getChildren calls. *

* The maximum allowable size of the data array is 1 MB (1,048,576 bytes). - * Arrays larger than this will cause a KeeperExecption to be thrown. + * Arrays larger than this will cause a KeeperException to be thrown. * * @param path * the path for the node @@ -1439,7 +1439,7 @@ public String create( * of the node by getChildren calls. *

* The maximum allowable size of the data array is 1 MB (1,048,576 bytes). - * Arrays larger than this will cause a KeeperExecption to be thrown. + * Arrays larger than this will cause a KeeperException to be thrown. * * @param path * the path for the node @@ -2319,7 +2319,7 @@ public void getACL(final String path, Stat stat, ACLCallback cb, Object ctx) { * @return the stat of the node. * @throws InterruptedException If the server transaction is interrupted. * @throws KeeperException If the server signals an error with a non-zero error code. - * @throws org.apache.zookeeper.KeeperException.InvalidACLException If the acl is invalide. + * @throws org.apache.zookeeper.KeeperException.InvalidACLException If the acl is invalid. * @throws IllegalArgumentException if an invalid path is specified */ public Stat setACL(final String path, List acl, int aclVersion) throws KeeperException, InterruptedException { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java index ebe81001228..f78a6d47ce8 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeperMain.java @@ -311,15 +311,15 @@ void run() throws IOException, InterruptedException { // only use jline if it's in the classpath try { Class consoleC = Class.forName("jline.console.ConsoleReader"); - Class completorC = Class.forName("org.apache.zookeeper.JLineZNodeCompleter"); + Class completerC = Class.forName("org.apache.zookeeper.JLineZNodeCompleter"); System.out.println("JLine support is enabled"); Object console = consoleC.getConstructor().newInstance(); - Object completor = completorC.getConstructor(ZooKeeper.class).newInstance(zk); - Method addCompletor = consoleC.getMethod("addCompleter", Class.forName("jline.console.completer.Completer")); - addCompletor.invoke(console, completor); + Object completer = completerC.getConstructor(ZooKeeper.class).newInstance(zk); + Method addCompleter = consoleC.getMethod("addCompleter", Class.forName("jline.console.completer.Completer")); + addCompleter.invoke(console, completer); String line; Method readLine = consoleC.getMethod("readLine", String.class); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java b/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java index 8095a40c2e0..aa1bf44a54c 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/cli/CliWrapperException.java @@ -52,7 +52,7 @@ private static String getMessage(Throwable cause) { return "Another reconfiguration is in progress -- concurrent " + "reconfigs not supported (yet)"; } else if (keeperException instanceof KeeperException.NewConfigNoQuorum) { return "No quorum of new config is connected and " - + "up-to-date with the leader of last commmitted config - try invoking reconfiguration after " + + "up-to-date with the leader of last committed config - try invoking reconfiguration after " + "new servers are connected and synced"; } else if (keeperException instanceof KeeperException.QuotaExceededException) { return "Quota has exceeded : " + keeperException.getPath(); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java b/zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java index e2409921fa8..5d292819622 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/client/ConnectStringParser.java @@ -44,7 +44,7 @@ public final class ConnectStringParser { private final ArrayList serverAddresses = new ArrayList<>(); /** - * Parse host and port by spliting client connectString + * Parse host and port by splitting client connectString * with support for IPv6 literals * @throws IllegalArgumentException * for an invalid chroot path. diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/common/IOUtils.java b/zookeeper-server/src/main/java/org/apache/zookeeper/common/IOUtils.java index 6dc1ee90364..7267d5420df 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/common/IOUtils.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/common/IOUtils.java @@ -70,7 +70,7 @@ public static void cleanup(Logger log, Closeable... closeables) { * Copies from one stream to another. * * @param in - * InputStrem to read from + * InputStream to read from * @param out * OutputStream to write to * @param buffSize @@ -100,7 +100,7 @@ public static void copyBytes(InputStream in, OutputStream out, int buffSize, boo * Copies from one stream to another. * * @param in - * InputStrem to read from + * InputStream to read from * @param out * OutputStream to write to * @param buffSize diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Summary.java b/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Summary.java index f8280dabd22..0dddfd3d623 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Summary.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/Summary.java @@ -20,7 +20,7 @@ /** * Summaries track the size and number of events. - * They are able to publish minumum, maximum, average values, depending on the capabilities of the MetricsProvider. + * They are able to publish minimum, maximum, average values, depending on the capabilities of the MetricsProvider. */ public interface Summary { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/SummarySet.java b/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/SummarySet.java index 8386d185fa0..905402b318e 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/SummarySet.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/metrics/SummarySet.java @@ -20,7 +20,7 @@ /** * Summaries track the size and number of events. - * They are able to publish minumum, maximum, average values, depending on the capabilities of the MetricsProvider. + * They are able to publish minimum, maximum, average values, depending on the capabilities of the MetricsProvider. * A SummarySet is a set of {@link Summary}. */ public interface SummarySet { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java index 90be270e8e9..68b7279cc20 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/BlueThrottle.java @@ -204,7 +204,7 @@ private static void logWeighedThrottlingSetting() { logWeighedThrottlingSetting(); } - /* Varation of Integer.getInteger for real number properties */ + /* Variation of Integer.getInteger for real number properties */ private static double getDoubleProp(String name, double def) { String val = System.getProperty(name); if (val != null) { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ConnectionMXBean.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ConnectionMXBean.java index 7d4831311a7..817eb92e1d1 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ConnectionMXBean.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ConnectionMXBean.java @@ -48,7 +48,7 @@ public interface ConnectionMXBean { */ long getPacketsSent(); /** - * @return number of requets being processed + * @return number of requests being processed */ long getOutstandingRequests(); /** @@ -62,7 +62,7 @@ public interface ConnectionMXBean { */ void terminateSession(); /** - * Terminate thei client connection. The client will immediately attempt to + * Terminate the client connection. The client will immediately attempt to * reconnect with the same session id. */ void terminateConnection(); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ContainerManager.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ContainerManager.java index 5362b9790bc..2b8371fcc78 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ContainerManager.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ContainerManager.java @@ -52,7 +52,7 @@ public class ContainerManager { /** * @param zkDb the ZK database - * @param requestProcessor request processer - used to inject delete + * @param requestProcessor request processor - used to inject delete * container requests * @param checkIntervalMs how often to check containers in milliseconds * @param maxPerMinute the max containers to delete per second - avoids @@ -64,7 +64,7 @@ public ContainerManager(ZKDatabase zkDb, RequestProcessor requestProcessor, int /** * @param zkDb the ZK database - * @param requestProcessor request processer - used to inject delete + * @param requestProcessor request processor - used to inject delete * container requests * @param checkIntervalMs how often to check containers in milliseconds * @param maxPerMinute the max containers to delete per second - avoids diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ExpiryQueue.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ExpiryQueue.java index a147f3b7d30..cf176dc2cc1 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ExpiryQueue.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ExpiryQueue.java @@ -77,7 +77,7 @@ public Long remove(E elem) { * Adds or updates expiration time for element in queue, rounding the * timeout to the expiry interval bucketed used by this queue. * @param elem element to add/update - * @param timeout timout in milliseconds + * @param timeout timeout in milliseconds * @return time at which the element is now set to expire if * changed, or null if unchanged */ diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxnFactory.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxnFactory.java index 0372f46675a..800b76f2ac9 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxnFactory.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/NIOServerCnxnFactory.java @@ -192,7 +192,7 @@ public void run() { if (!reconfiguring) { NIOServerCnxnFactory.this.stop(); } - LOG.info("accept thread exitted run method"); + LOG.info("accept thread exited run method"); } } @@ -394,7 +394,7 @@ public void run() { // This will wake up the accept thread and the other selector // threads, and tell the worker thread pool to begin shutdown. NIOServerCnxnFactory.this.stop(); - LOG.info("selector thread exitted run method"); + LOG.info("selector thread exited run method"); } } @@ -543,7 +543,7 @@ public void cleanup() { private class ConnectionExpirerThread extends ZooKeeperThread { ConnectionExpirerThread() { - super("ConnnectionExpirer"); + super("ConnectionExpirer"); } public void run() { @@ -561,7 +561,7 @@ public void run() { } } catch (InterruptedException e) { - LOG.info("ConnnectionExpirerThread interrupted"); + LOG.info("ConnectionExpirerThread interrupted"); } } diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/PrepRequestProcessor.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/PrepRequestProcessor.java index bcbfbaad73c..4666db53ff3 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/PrepRequestProcessor.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/PrepRequestProcessor.java @@ -976,7 +976,7 @@ private void validateCreateRequest(String path, CreateMode createMode, Request r /** * This method checks out the acl making sure it isn't null or empty, * it has valid schemes and ids, and expanding any relative ids that - * depend on the requestor's authentication information. + * depend on the requester's authentication information. * * @param authInfo list of ACL IDs associated with the client connection * @param acls list of ACLs being assigned to the node (create or setACL operation) @@ -1004,7 +1004,7 @@ public static List fixupACL(String path, List authInfo, List acls) rv.add(a); } else if (id.getScheme().equals("auth")) { // This is the "auth" id, so we have to expand it to the - // authenticated ids of the requestor + // authenticated ids of the requester boolean authIdValid = false; for (Id cid : authInfo) { ServerAuthenticationProvider ap = ProviderRegistry.getServerProvider(cid.getScheme()); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ReferenceCountedACLCache.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ReferenceCountedACLCache.java index 91b9ca5dfc6..78977000ca2 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ReferenceCountedACLCache.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ReferenceCountedACLCache.java @@ -110,7 +110,7 @@ public void deserialize(InputArchive ia) throws IOException { List aclList = new ArrayList<>(); Index j = ia.startVector("acls"); if (j == null) { - throw new RuntimeException("Incorrent format of InputArchive when deserialize DataTree - missing acls"); + throw new RuntimeException("Incorrect format of InputArchive when deserialize DataTree - missing acls"); } while (!j.done()) { ACL acl = new ACL(); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java index 5fb84d5842e..c76767bfd55 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java @@ -36,7 +36,7 @@ * the connection layer always allows a connection to send at least one request * before disabling selection on that connection. Thus, in a scenario with 40000 * client connections, the total number of requests inflight may be as high as - * 40000 even if the globalOustandingLimit was set lower. + * 40000 even if the globalOutstandingLimit was set lower. * * The RequestThrottler addresses this issue by adding additional queueing. When * enabled, client connections no longer submit requests directly to the request diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ServerCnxnFactory.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ServerCnxnFactory.java index 88bf0cc1cbc..f9384a615a6 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ServerCnxnFactory.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ServerCnxnFactory.java @@ -130,7 +130,7 @@ public void startup(ZooKeeperServer zkServer) throws IOException, InterruptedExc startup(zkServer, true); } - // This method is to maintain compatiblity of startup(zks) and enable sharing of zks + // This method is to maintain compatibility of startup(zks) and enable sharing of zks // when we add secureCnxnFactory. public abstract void startup(ZooKeeperServer zkServer, boolean startServer) throws IOException, InterruptedException; diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java index 8468b522747..0dc1a86860e 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java @@ -258,7 +258,7 @@ public void shutdown() { this.join(); this.flush(); } catch (InterruptedException e) { - LOG.warn("Interrupted while wating for {} to finish", this); + LOG.warn("Interrupted while waiting for {} to finish", this); Thread.currentThread().interrupt(); } catch (IOException e) { LOG.warn("Got IO exception during shutdown"); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZKDatabase.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZKDatabase.java index d98c97f2c07..c1e0b4834a3 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZKDatabase.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZKDatabase.java @@ -468,7 +468,7 @@ public void setlastProcessedZxid(long zxid) { } /** - * the process txn on the data and perform digest comparision. + * the process txn on the data and perform digest comparison. * @param hdr the txnheader for the txn * @param txn the transaction that needs to be processed * @param digest the expected digest. A null value would skip the check @@ -666,7 +666,7 @@ public void serializeSnapshot(OutputArchive oa) throws IOException, InterruptedE /** * append to the underlying transaction log * @param si the request to append - * @return true if the append was succesfull and false if not + * @return true if the append was successful and false if not */ public boolean append(Request si) throws IOException { if (this.snapLog.append(si)) { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java index 19f1fac4536..61c7d4ac318 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java @@ -259,7 +259,7 @@ protected enum State { private static volatile int maxBatchSize; /** - * Starting size of read and write ByteArroyOuputBuffers. Default is 32 bytes. + * Starting size of read and write ByteArrayOutputBuffers. Default is 32 bytes. * Flag not used for small transfers like connectResponses. */ public static final String INT_BUFFER_STARTING_SIZE_BYTES = "zookeeper.intBufferStartingSizeBytes"; @@ -1829,7 +1829,7 @@ private void processSasl(RequestRecord request, ServerCnxn cnxn, RequestHeader r int error; if (authHelper.isSaslAuthRequired()) { LOG.warn( - "Closing client connection due to server requires client SASL authenticaiton," + "Closing client connection due to server requires client SASL authentication," + "but client SASL authentication has failed, or client is not configured with SASL " + "authentication."); error = Code.SESSIONCLOSEDREQUIRESASLAUTH.intValue(); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ExitHandler.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ExitHandler.java index e7f7ee37a2d..56b26488ed0 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ExitHandler.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ExitHandler.java @@ -21,7 +21,7 @@ /** * Behaviour of the server in case of internal error. * When you are running tests you will use {@link #LOG_ONLY}, - * but please take care of using {@link #EXIT} when runnning in production. + * but please take care of using {@link #EXIT} when running in production. */ public enum ExitHandler { /** diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ZooKeeperServerEmbedded.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ZooKeeperServerEmbedded.java index a99bdb4e7ae..6fcd7038504 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ZooKeeperServerEmbedded.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ZooKeeperServerEmbedded.java @@ -51,7 +51,7 @@ class ZookKeeperServerEmbeddedBuilder { /** * Base directory of the server. * The system will create a temporary configuration file inside this directory. - * Please remember that dynamic configuration files wil be saved into this directory by default. + * Please remember that dynamic configuration files will be saved into this directory by default. *

* If you do not set a 'dataDir' configuration entry the system will use a subdirectory of baseDir. * @param baseDir diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ZooKeeperServerEmbeddedImpl.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ZooKeeperServerEmbeddedImpl.java index ad41a3228e7..189c3b45a74 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ZooKeeperServerEmbeddedImpl.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/embedded/ZooKeeperServerEmbeddedImpl.java @@ -128,7 +128,7 @@ public void run() { try { maincluster.runFromConfig(config); maincluster.close(); - LOG.info("ZK server died. Requsting stop on JVM"); + LOG.info("ZK server died. Requesting stop on JVM"); if (!stopping) { ServiceUtils.requestSystemExit(ExitCode.EXECUTION_FINISHED.getValue()); } diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/SnapStream.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/SnapStream.java index 847b12c28ff..74cdebf3da0 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/SnapStream.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/persistence/SnapStream.java @@ -51,14 +51,14 @@ public class SnapStream { private static final Logger LOG = LoggerFactory.getLogger(SnapStream.class); - public static final String ZOOKEEPER_SHAPSHOT_STREAM_MODE = "zookeeper.snapshot.compression.method"; + public static final String ZOOKEEPER_SNAPSHOT_STREAM_MODE = "zookeeper.snapshot.compression.method"; private static StreamMode streamMode = StreamMode.fromString( - System.getProperty(ZOOKEEPER_SHAPSHOT_STREAM_MODE, + System.getProperty(ZOOKEEPER_SNAPSHOT_STREAM_MODE, StreamMode.DEFAULT_MODE.getName())); static { - LOG.info("{} = {}", ZOOKEEPER_SHAPSHOT_STREAM_MODE, streamMode); + LOG.info("{} = {}", ZOOKEEPER_SNAPSHOT_STREAM_MODE, streamMode); } public enum StreamMode { @@ -182,7 +182,7 @@ public static void checkSealIntegrity(CheckedInputStream is, InputArchive ia) th /** * Verifies that the file is a valid snapshot. Snapshot may be invalid if * it's incomplete as in a situation when the server dies while in the - * process of storing a snapshot. Any files that are improperly formated + * process of storing a snapshot. Any files that are improperly formatted * or corrupted are invalid. Any file that is not a snapshot is also an * invalid snapshot. * diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java index 83555a61644..4118aa143cd 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/FastLeaderElection.java @@ -1074,7 +1074,7 @@ public Vote lookForLeader() throws InterruptedException { * In ZOOKEEPER-3922, we separate the behaviors of FOLLOWING and LEADING. * To avoid the duplication of codes, we create a method called followingBehavior which was used to * shared by FOLLOWING and LEADING. This method returns a Vote. When the returned Vote is null, it follows - * the original idea to break swtich statement; otherwise, a valid returned Vote indicates, a leader + * the original idea to break switch statement; otherwise, a valid returned Vote indicates, a leader * is generated. * * The reason why we need to separate these behaviors is to make the algorithm runnable for 2-node diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java index 0b57bb1824a..23e60b6b8c0 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Leader.java @@ -873,7 +873,7 @@ void shutdown(String reason) { closeSockets(); } - // NIO should not accept conenctions + // NIO should not accept connections self.setZooKeeperServer(null); self.adminServer.setZooKeeperServer(null); self.closeAllConnections(); @@ -904,8 +904,8 @@ synchronized void closeSockets() { } /** In a reconfig operation, this method attempts to find the best leader for next configuration. - * If the current leader is a voter in the next configuartion, then it remains the leader. - * Otherwise, choose one of the new voters that acked the reconfiguartion, such that it is as + * If the current leader is a voter in the next configuration, then it remains the leader. + * Otherwise, choose one of the new voters that acked the reconfiguration, such that it is as * up-to-date as possible, i.e., acked as many outstanding proposals as possible. * * @param reconfigProposal @@ -982,7 +982,7 @@ public synchronized boolean tryToCommit(Proposal p, long zxid, SocketAddress fol // commit proposals in order if (zxid != lastCommitted + 1) { LOG.warn( - "Commiting zxid 0x{} from {} not first!", + "Committing zxid 0x{} from {} not first!", Long.toHexString(zxid), followerAddr); LOG.warn("First is 0x{}", Long.toHexString(lastCommitted + 1)); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java index e3bd13d1165..ef5a566cea0 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java @@ -295,7 +295,7 @@ protected long nanoTime() { /** * Overridable helper method to simply call sock.connect(). This can be - * overriden in tests to fake connection success/failure for connectToLeader. + * override in tests to fake connection success/failure for connectToLeader. */ protected void sockConnect(Socket sock, InetSocketAddress addr, int timeout) throws IOException { sock.connect(addr, timeout); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/ObserverZooKeeperServer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/ObserverZooKeeperServer.java index 30f759fb897..79aa10ca9de 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/ObserverZooKeeperServer.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/ObserverZooKeeperServer.java @@ -82,7 +82,7 @@ public void commitRequest(Request request) { /** * Set up the request processors for an Observer: - * firstProcesor->commitProcessor->finalProcessor + * firstProcessor->commitProcessor->finalProcessor */ @Override protected void setupRequestProcessors() { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java index aba7a294630..6c089465b18 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java @@ -862,7 +862,7 @@ public synchronized void setCurrentVote(Vote v) { * This class simply responds to requests for the current leader of this * node. *

- * The request contains just an xid generated by the requestor. + * The request contains just an xid generated by the requester. *

* The response has the xid, the id of this server, the id of the leader, * and the zxid of the leader. @@ -1036,7 +1036,7 @@ public synchronized ServerState getPeerState() { /** * Resolves hostname for a given server ID. * - * This method resolves hostname for a given server ID in both quorumVerifer + * This method resolves hostname for a given server ID in both quorumVerifier * and lastSeenQuorumVerifier. If the server ID matches the local server ID, * it also updates myAddrs. */ diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/util/OSMXBean.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/util/OSMXBean.java index 0ea41442235..49633046673 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/util/OSMXBean.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/util/OSMXBean.java @@ -84,7 +84,7 @@ private Long getOSUnixMXBeanMethod(String mBeanMethodName) { return (Long) mBeanMethod.invoke(unixos); } } catch (Exception e) { - LOG.warn("Not able to load class or method for com.sun.managment.UnixOperatingSystemMXBean.", e); + LOG.warn("Not able to load class or method for com.sun.management.UnixOperatingSystemMXBean.", e); } return null; } diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/util/RequestPathMetricsCollector.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/util/RequestPathMetricsCollector.java index 6163872510f..e8f41e02384 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/util/RequestPathMetricsCollector.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/util/RequestPathMetricsCollector.java @@ -83,7 +83,7 @@ public class RequestPathMetricsCollector { public static final String PATH_STATS_COLLECTOR_DELAY = "zookeeper.pathStats.delay"; public static final String PATH_STATS_TOP_PATH_MAX = "zookeeper.pathStats.topPathMax"; public static final String PATH_STATS_ENABLED = "zookeeper.pathStats.enabled"; - private static final String PATH_SEPERATOR = "/"; + private static final String PATH_SEPARATOR = "/"; private final Map immutableRequestsMap; private final ScheduledThreadPoolExecutor scheduledExecutor; @@ -155,9 +155,9 @@ static boolean isWriteOp(int requestType) { static String trimPathDepth(String path, int maxDepth) { int count = 0; StringBuilder sb = new StringBuilder(); - StringTokenizer pathTokenizer = new StringTokenizer(path, PATH_SEPERATOR); + StringTokenizer pathTokenizer = new StringTokenizer(path, PATH_SEPARATOR); while (pathTokenizer.hasMoreElements() && count++ < maxDepth) { - sb.append(PATH_SEPERATOR); + sb.append(PATH_SEPARATOR); sb.append(pathTokenizer.nextToken()); } path = sb.toString(); diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManager.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManager.java index d1c743104b1..014c944fc84 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManager.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManager.java @@ -137,7 +137,7 @@ public WatcherOrBitSet triggerWatch(String path, EventType type, long zxid, List } @Override - public WatcherOrBitSet triggerWatch(String path, EventType type, long zxid, List acl, WatcherOrBitSet supress) { + public WatcherOrBitSet triggerWatch(String path, EventType type, long zxid, List acl, WatcherOrBitSet suppress) { WatchedEvent e = new WatchedEvent(type, KeeperState.SyncConnected, path, zxid); Set watchers = new HashSet<>(); synchronized (this) { @@ -182,7 +182,7 @@ public WatcherOrBitSet triggerWatch(String path, EventType type, long zxid, List } for (Watcher w : watchers) { - if (supress != null && supress.contains(w)) { + if (suppress != null && suppress.contains(w)) { continue; } if (w instanceof ServerWatcher) { diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManagerOptimized.java b/zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManagerOptimized.java index 84cf2c73d13..d39e0971a35 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManagerOptimized.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManagerOptimized.java @@ -312,7 +312,7 @@ public WatchesSummary getWatchesSummary() { @Override public WatchesReport getWatches() { Map> id2paths = new HashMap<>(); - for (Entry> e : getWatcher2PathesMap().entrySet()) { + for (Entry> e : getWatcher2PathsMap().entrySet()) { Long id = ((ServerCnxn) e.getKey()).getSessionId(); Set paths = new HashSet<>(e.getValue()); id2paths.put(id, paths); @@ -349,7 +349,7 @@ public WatchesPathReport getWatchesByPath() { * May cause OOM if there are lots of watches, might better to forbid * it in this class. */ - public Map> getWatcher2PathesMap() { + public Map> getWatcher2PathsMap() { Map> watcher2paths = new HashMap<>(); for (Entry e : pathWatches.entrySet()) { String path = e.getKey(); @@ -390,7 +390,7 @@ public void dumpWatches(PrintWriter pwriter, boolean byPath) { } } } else { - for (Entry> e : getWatcher2PathesMap().entrySet()) { + for (Entry> e : getWatcher2PathsMap().entrySet()) { pwriter.print("0x"); pwriter.println(Long.toHexString(((ServerCnxn) e.getKey()).getSessionId())); for (String path : e.getValue()) { diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/ClientCnxnSocketFragilityTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/ClientCnxnSocketFragilityTest.java index 608bc01c4c8..54426f0b6e2 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/ClientCnxnSocketFragilityTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/ClientCnxnSocketFragilityTest.java @@ -316,7 +316,7 @@ void waitUntilHitUnsafeRegion() { @Override protected void onConnecting(InetSocketAddress addr) { if (closing) { - LOG.info("Attempt to connnecting {} {} {}", addr, closing, state); + LOG.info("Attempt to connecting {} {} {}", addr, closing, state); ///////// Unsafe Region //////// // Slow down and zoom out the unsafe point to make risk // The unsafe point is that startConnect happens after sendThread.close diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/GetAllChildrenNumberTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/GetAllChildrenNumberTest.java index f84ded0b5e8..39b0c5c348b 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/GetAllChildrenNumberTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/GetAllChildrenNumberTest.java @@ -91,12 +91,12 @@ public void testGetAllChildrenNumberAsync() throws IOException, KeeperException, } } - private void generatePaths(int persistantCnt, int ephemeralCnt) throws KeeperException, InterruptedException { + private void generatePaths(int persistentCnt, int ephemeralCnt) throws KeeperException, InterruptedException { zk.create(BASE, BASE.getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); zk.create(BASE_EXT, BASE_EXT.getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); - for (int p = 0; p < persistantCnt; p++) { + for (int p = 0; p < persistentCnt; p++) { String base = BASE + "/" + p; zk.create(base, base.getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); for (int e = 0; e < ephemeralCnt; e++) { diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/GetEphemeralsTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/GetEphemeralsTest.java index 6591cf3ce05..aefa0bba55b 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/GetEphemeralsTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/GetEphemeralsTest.java @@ -174,10 +174,10 @@ public void testGetEphemeralsErrors() throws KeeperException { } } - private String[] generatePaths(int persistantCnt, int ephemeralCnt) throws KeeperException, InterruptedException { + private String[] generatePaths(int persistentCnt, int ephemeralCnt) throws KeeperException, InterruptedException { - final String[] expected = new String[persistantCnt * ephemeralCnt]; - for (int p = 0; p < persistantCnt; p++) { + final String[] expected = new String[persistentCnt * ephemeralCnt]; + for (int p = 0; p < persistentCnt; p++) { String base = BASE + p; zk.create(base, base.getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); for (int e = 0; e < ephemeralCnt; e++) { diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/JaasConfiguration.java b/zookeeper-server/src/test/java/org/apache/zookeeper/JaasConfiguration.java index 22d8d6efdeb..199a83150da 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/JaasConfiguration.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/JaasConfiguration.java @@ -31,7 +31,7 @@ * Example: * jaas = new JaasConfiguration(); * jaas.addSection("Server", "org.apache.zookeeper.server.auth.DigestLoginModule", - * "username", "passowrd"); + * "username", "password"); */ public class JaasConfiguration extends javax.security.auth.login.Configuration { diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/PortAssignment.java b/zookeeper-server/src/test/java/org/apache/zookeeper/PortAssignment.java index 87c0562d5c7..fb28344c1d5 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/PortAssignment.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/PortAssignment.java @@ -107,7 +107,7 @@ public static synchronized int unique() { * uses these 2 pieces of information to split the available ports into * disjoint ranges. Each JUnit process only assigns ports from its own range * in order to prevent bind errors during concurrent test runs. If any of - * this information is unavailable or unparseable, then the default behavior + * this information is unavailable or unparsable, then the default behavior * is for this process to use the entire available port range. This is * expected when running tests outside of Ant. * diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/ZooKeeperTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/ZooKeeperTest.java index 186d7b6eb22..10b11688404 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/ZooKeeperTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/ZooKeeperTest.java @@ -292,7 +292,7 @@ public void testParseWithMultipleQuotes() throws Exception { } @Test - public void testNonexistantCommand() throws Exception { + public void testNonexistentCommand() throws Exception { testInvalidCommand("cret -s /node1", 127); } @@ -363,7 +363,7 @@ public void testCreateNodeWithoutData() throws Exception { } @Test - public void testACLWithExtraAgruments() throws Exception { + public void testACLWithExtraArguments() throws Exception { final ZooKeeper zk = createClient(); ZooKeeperMain zkMain = new ZooKeeperMain(zk); // create persistent sequential node @@ -397,7 +397,7 @@ public void testDelete() throws Exception { } @Test - public void testDeleteNonexistantNode() throws Exception { + public void testDeleteNonexistentNode() throws Exception { testInvalidCommand("delete /blahblahblah", 1); } @@ -614,7 +614,7 @@ public void testLsrLeafCommand() throws Exception { } @Test - public void testLsrNonexistantZnodeCommand() throws Exception { + public void testLsrNonexistentZnodeCommand() throws Exception { final ZooKeeper zk = createClient(); ZooKeeperMain zkMain = new ZooKeeperMain(zk); @@ -678,7 +678,7 @@ public void testClientReconnectWithZKClientConfig() throws Exception { aHostProvider, clientConfig); watcher.waitForConnected(CONNECTION_TIMEOUT); - assertEquals(zk.getSessionId(), newZKClient.getSessionId(), "Old client session id and new clinet session id must be same"); + assertEquals(zk.getSessionId(), newZKClient.getSessionId(), "Old client session id and new client session id must be same"); } finally { zk.close(); newZKClient.close(); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java index 588a91939e4..e88be706316 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/client/ZKClientConfigTest.java @@ -149,7 +149,7 @@ public void testIntegerRetrievalFromProperty() { // property is set but can not be parsed to int, we should get the // NumberFormatException - conf.setProperty(ZKConfig.JUTE_MAXBUFFER, "InvlaidIntValue123"); + conf.setProperty(ZKConfig.JUTE_MAXBUFFER, "InvalidIntValue123"); try { result = conf.getInt(ZKConfig.JUTE_MAXBUFFER, defaultValue); fail("NumberFormatException is expected"); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKTrustManagerTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKTrustManagerTest.java index 7b4e8783ee3..138e45e2e1d 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKTrustManagerTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKTrustManagerTest.java @@ -125,7 +125,7 @@ public Object answer(InvocationOnMock invocationOnMock) throws Throwable { }); } - private X509Certificate[] createSelfSignedCertifcateChain(String ipAddress, String hostname) throws Exception { + private X509Certificate[] createSelfSignedCertificateChain(String ipAddress, String hostname) throws Exception { X500NameBuilder nameBuilder = new X500NameBuilder(BCStyle.INSTANCE); nameBuilder.addRDN(BCStyle.CN, "NOT_LOCALHOST"); Date notBefore = new Date(); @@ -163,7 +163,7 @@ public void testServerHostnameVerificationWithHostnameVerificationDisabled() thr ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, false, false, hostnameVerifier); - X509Certificate[] certificateChain = createSelfSignedCertifcateChain(IP_ADDRESS, HOSTNAME); + X509Certificate[] certificateChain = createSelfSignedCertificateChain(IP_ADDRESS, HOSTNAME); zkTrustManager.checkServerTrusted(certificateChain, null, mockSocket); verify(mockSocket, times(0)).getInetAddress(); assertTrue(hostnameVerifier.hosts.isEmpty()); @@ -177,7 +177,7 @@ public void testServerHostnameVerificationWithHostnameVerificationDisabledAndCli ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, false, true, hostnameVerifier); - X509Certificate[] certificateChain = createSelfSignedCertifcateChain(IP_ADDRESS, HOSTNAME); + X509Certificate[] certificateChain = createSelfSignedCertificateChain(IP_ADDRESS, HOSTNAME); zkTrustManager.checkServerTrusted(certificateChain, null, mockSocket); verify(mockSocket, times(0)).getInetAddress(); @@ -192,7 +192,7 @@ public void testServerHostnameVerificationWithIPAddress() throws Exception { ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, true, false, hostnameVerifier); - X509Certificate[] certificateChain = createSelfSignedCertifcateChain(IP_ADDRESS, null); + X509Certificate[] certificateChain = createSelfSignedCertificateChain(IP_ADDRESS, null); zkTrustManager.checkServerTrusted(certificateChain, null, mockSocket); verify(mockSocket, times(1)).getInetAddress(); @@ -207,7 +207,7 @@ public void testServerHostnameVerificationWithHostname() throws Exception { ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, true, false, hostnameVerifier); - X509Certificate[] certificateChain = createSelfSignedCertifcateChain(null, HOSTNAME); + X509Certificate[] certificateChain = createSelfSignedCertificateChain(null, HOSTNAME); zkTrustManager.checkServerTrusted(certificateChain, null, mockSocket); verify(mockSocket, times(1)).getInetAddress(); @@ -222,7 +222,7 @@ public void testClientHostnameVerificationWithHostnameVerificationDisabled() thr ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, false, true, hostnameVerifier); - X509Certificate[] certificateChain = createSelfSignedCertifcateChain(null, HOSTNAME); + X509Certificate[] certificateChain = createSelfSignedCertificateChain(null, HOSTNAME); zkTrustManager.checkClientTrusted(certificateChain, null, mockSocket); verify(mockSocket, times(1)).getInetAddress(); @@ -237,7 +237,7 @@ public void testClientHostnameVerificationWithClientHostnameVerificationDisabled ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, true, false, hostnameVerifier); - X509Certificate[] certificateChain = createSelfSignedCertifcateChain(null, HOSTNAME); + X509Certificate[] certificateChain = createSelfSignedCertificateChain(null, HOSTNAME); zkTrustManager.checkClientTrusted(certificateChain, null, mockSocket); verify(mockSocket, times(0)).getInetAddress(); @@ -252,7 +252,7 @@ public void testClientHostnameVerificationWithIPAddress() throws Exception { ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, true, true, hostnameVerifier); - X509Certificate[] certificateChain = createSelfSignedCertifcateChain(IP_ADDRESS, null); + X509Certificate[] certificateChain = createSelfSignedCertificateChain(IP_ADDRESS, null); zkTrustManager.checkClientTrusted(certificateChain, null, mockSocket); verify(mockSocket, times(1)).getInetAddress(); @@ -267,7 +267,7 @@ public void testClientHostnameVerificationWithHostname() throws Exception { ZKTrustManager zkTrustManager = new ZKTrustManager(mockX509ExtendedTrustManager, true, true, hostnameVerifier); - X509Certificate[] certificateChain = createSelfSignedCertifcateChain(null, HOSTNAME); + X509Certificate[] certificateChain = createSelfSignedCertificateChain(null, HOSTNAME); zkTrustManager.checkClientTrusted(certificateChain, null, mockSocket); verify(mockSocket, times(1)).getInetAddress(); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ClientSSLReloadTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ClientSSLReloadTest.java index c0c35c69579..c7e3c8d22e7 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ClientSSLReloadTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ClientSSLReloadTest.java @@ -102,13 +102,13 @@ public void teardown() throws Exception { * 3) ZK client will connect to the server on the secure client port using keyStoreFile1 and trustStoreFile1. * 4) Update the keyStoreFile1 and trustStoreFile1 files in the filesystem with keyStoreFile2 and trustStoreFile2. * 5) Till FileChangeWatcher thread is triggered & SSLContext options are reset, ZK client should continue to connect. - * In Junit tests, FileChangeWatcher thread is not triggered immediately upon certifcate update in the filesystem. - * 6) Once the certficates are reloaded by the server, ZK client connect will fail. + * In Junit tests, FileChangeWatcher thread is not triggered immediately upon certificate update in the filesystem. + * 6) Once the certificates are reloaded by the server, ZK client connect will fail. * 7) Next, create a new ZK client with updated keystore & truststore paths (keyStoreFile2 and trustStoreFile2). * 8) Server should accept the connection on the secure client port. */ @Test - public void certficateReloadTest() throws Exception { + public void certificateReloadTest() throws Exception { final Properties configZookeeper = getServerConfig(); try (ZooKeeperServerEmbedded zkServer = ZooKeeperServerEmbedded diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataNodeTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataNodeTest.java index c123f69f007..ceb9efa25de 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataNodeTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataNodeTest.java @@ -27,7 +27,7 @@ public class DataNodeTest { @Test - public void testGetChildrenShouldReturnEmptySetWhenThereAreNoChidren() { + public void testGetChildrenShouldReturnEmptySetWhenThereAreNoChildren() { // create DataNode and call getChildren DataNode dataNode = new DataNode(); Set children = dataNode.getChildren(); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java index 07a69f14f01..13276d855c5 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/DataTreeTest.java @@ -260,7 +260,7 @@ public void testPathTrieClearOnDeserialize() throws Exception { /* ZOOKEEPER-3531 - org.apache.zookeeper.server.DataTree#serialize calls the aclCache.serialize when doing * dataree serialization, however, org.apache.zookeeper.server.ReferenceCountedACLCache#serialize - * could get stuck at OutputArchieve.writeInt due to potential network/disk issues. + * could get stuck at OutputArchive.writeInt due to potential network/disk issues. * This can cause the system experiences hanging issues similar to ZooKeeper-2201. * This test verifies the fix that we should not hold ACL cache during dumping aclcache to snapshots */ diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/PurgeTxnTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/PurgeTxnTest.java index 299cdaa6495..1e02adab86c 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/PurgeTxnTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/PurgeTxnTest.java @@ -116,7 +116,7 @@ public void testPurge() throws Exception { /** * Tests purge when logs are rolling or a new snapshot is created, then - * these newer files should alse be excluded in the current cycle. + * these newer files should also be excluded in the current cycle. * * For frequent snapshotting, configured SnapCount to 30. There are three * threads which will create 1000 znodes each and simultaneously do purge diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java index 0a76cb363c0..5655e8b677d 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerMainTest.java @@ -210,7 +210,7 @@ public void commit() throws IOException { try { // do create operation, so that injected IOException is thrown zk.create("/foo2", "foobar".getBytes(), Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); - fail("IOException is expected as error is injected in transaction log commit funtionality"); + fail("IOException is expected as error is injected in transaction log commit functionality"); } catch (Exception e) { // do nothing } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java index 91e5e903ce2..e80c4a3166a 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperServerStartupTest.java @@ -186,11 +186,11 @@ public void run() { try { servcnxnf.startup(zks); } catch (IOException e) { - LOG.error("Unexcepted exception during server startup", e); + LOG.error("Unexpected exception during server startup", e); // Ignoring exception. If there is an ioexception // then one of the following assertion will fail } catch (InterruptedException e) { - LOG.error("Unexcepted exception during server startup", e); + LOG.error("Unexpected exception during server startup", e); // Ignoring exception. If there is an interrupted exception // then one of the following assertion will fail } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java index 6cf1e2147b9..fea351f45f1 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/ZooKeeperThreadTest.java @@ -52,7 +52,7 @@ public MyCriticalThread(String threadName) { super(threadName, new ZooKeeperServerListener() { @Override - public void notifyStopping(String threadName, int erroCode) { + public void notifyStopping(String threadName, int errorCode) { } }); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnLogTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnLogTest.java index f3c2dfee2a0..d547e34f439 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnLogTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnLogTest.java @@ -291,7 +291,7 @@ public void testLogSizeLimit(@TempDir File tmpDir) throws Exception { for (long i = 0; i < txnCount; i++) { Stat stat = new Stat(); byte[] data = db.getData("/node-" + i, stat, null); - assertArrayEquals(bytes, data, "Missmatch data"); + assertArrayEquals(bytes, data, "Mismatch data"); assertTrue(zxids.contains(stat.getMzxid()), "Unknown zxid "); } } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/SnapStreamTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/SnapStreamTest.java index f56dcfab296..9a5992fa3d3 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/SnapStreamTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/SnapStreamTest.java @@ -39,7 +39,7 @@ public class SnapStreamTest { @AfterEach public void tearDown() { - System.clearProperty(SnapStream.ZOOKEEPER_SHAPSHOT_STREAM_MODE); + System.clearProperty(SnapStream.ZOOKEEPER_SNAPSHOT_STREAM_MODE); SnapStream.setStreamMode(StreamMode.DEFAULT_MODE); } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CnxManagerTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CnxManagerTest.java index 920c1391cc7..f4160b3c28f 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CnxManagerTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CnxManagerTest.java @@ -309,14 +309,14 @@ public void testCnxManagerListenerThreadConfigurableRetry() throws Exception { final QuorumPeer peer = new QuorumPeer(unresolvablePeers, ClientBase.createTmpDir(), ClientBase.createTmpDir(), 2181, 3, myid, 1000, 2, 2, 2); final QuorumCnxManager cnxManager = peer.createCnxnManager(); final QuorumCnxManager.Listener listener = cnxManager.listener; - final AtomicBoolean errorHappend = new AtomicBoolean(false); - listener.setSocketBindErrorHandler(() -> errorHappend.set(true)); + final AtomicBoolean errorHappened = new AtomicBoolean(false); + listener.setSocketBindErrorHandler(() -> errorHappened.set(true)); listener.start(); // listener thread should stop and throws error which notify QuorumPeer about error. // QuorumPeer should start shutdown process listener.join(15000); // set wait time, if listener contains bug and thread not stops. assertFalse(listener.isAlive()); - assertTrue(errorHappend.get()); + assertTrue(errorHappened.get()); assertFalse(listener.isAlive(), QuorumPeer.class.getSimpleName() + " not stopped after " + "listener thread death"); } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java index 21970f3ea4d..5f5449d240e 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorConcurrencyTest.java @@ -169,7 +169,7 @@ public void committedAndUncommittedOfTheSameSessionRaceTest() throws Exception { * i.e., 5 sessions, each has different amount or read requests, followed by * single write and afterwards single read. The idea is to check that all of * the reads that can be processed concurrently do so, and that none of the - * uncommited requests, followed by the reads are processed. + * uncommitted requests, followed by the reads are processed. */ @Test public void processAsMuchUncommittedRequestsAsPossibleTest() throws Exception { @@ -224,7 +224,7 @@ public void processAsMuchUncommittedRequestsAsPossibleTest() throws Exception { */ @Test public void processAllFollowingUncommittedAfterFirstCommitTest() throws Exception { - final String path = "/testUncommittedFollowingCommited"; + final String path = "/testUncommittedFollowingCommitted"; Set shouldBeInPending = new HashSet<>(); Set shouldBeProcessedAfterPending = new HashSet<>(); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorMetricsTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorMetricsTest.java index bfa3fb78613..f4ba976de3a 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorMetricsTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/CommitProcessorMetricsTest.java @@ -186,9 +186,9 @@ private void checkMetrics(String metricName, long min, long max, double avg, lon assertEquals(sum, values.get("sum_" + metricName), "expected sum is: " + sum); } - private void checkTimeMetric(long actual, long lBoundrary, long hBoundrary) { - assertThat(actual, greaterThanOrEqualTo(lBoundrary)); - assertThat(actual, lessThanOrEqualTo(hBoundrary)); + private void checkTimeMetric(long actual, long lBoundary, long hBoundary) { + assertThat(actual, greaterThanOrEqualTo(lBoundary)); + assertThat(actual, lessThanOrEqualTo(hBoundary)); } private Request createReadRequest(long sessionId, int xid) { @@ -386,7 +386,7 @@ public void testConcurrentRequestProcessingInCommitProcessor() throws Exception commitProcessor.processRequest(createReadRequest(1L, 4)); requestScheduled.await(5, TimeUnit.SECONDS); - //add a commit request to trigger waitForEmptyPool, which will record number of requests being proccessed + //add a commit request to trigger waitForEmptyPool, which will record number of requests being processed poolEmptied = new CountDownLatch(1); commitProcessor.commit(createWriteRequest(1L, 1)); poolEmptied.await(5, TimeUnit.SECONDS); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java index 73ad201c109..d7bb1a0679d 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java @@ -177,7 +177,7 @@ public void process(String path) { } /** - * It's possibel during SNAP sync, the parent is serialized before the + * It's possible during SNAP sync, the parent is serialized before the * child get deleted during sending the snapshot over. * * In which case, we need to make sure the pzxid get correctly updated diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerHandlerTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerHandlerTest.java index 43202716d2b..e38c82ea9f7 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerHandlerTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerHandlerTest.java @@ -198,7 +198,7 @@ void assertZxidEquals(long expected, long value) { } /** - * Test cases when leader has empty commitedLog + * Test cases when leader has empty committedLog */ @Test public void testEmptyCommittedLog() throws Exception { @@ -327,7 +327,7 @@ public void testTxnLog() throws Exception { public void testTxnLogProposalIteratorClosure() throws Exception { long peerZxid; - // CommmitedLog is empty, we will use txnlog up to lastProcessZxid + // CommittedLog is empty, we will use txnlog up to lastProcessZxid db = new MockZKDatabase(null) { @Override public Iterator getProposalsFromTxnLog(long peerZxid, long limit) { @@ -346,13 +346,13 @@ public Iterator getProposalsFromTxnLog(long peerZxid, long limit) { } /** - * Test cases when txnlog is enabled and commitedLog is empty + * Test cases when txnlog is enabled and committedLog is empty */ @Test public void testTxnLogOnly() throws Exception { long peerZxid; - // CommmitedLog is empty, we will use txnlog up to lastProcessZxid + // CommittedLog is empty, we will use txnlog up to lastProcessZxid db.lastProcessedZxid = 7; db.txnLog.add(createProposal(2)); db.txnLog.add(createProposal(3)); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumDigestTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumDigestTest.java index 1ffc74f0d46..dd219e1643b 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumDigestTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumDigestTest.java @@ -179,11 +179,11 @@ public void testDigestMismatchesWhenTxnLost() throws Exception { // start the follower and observer to have a diff sync startServers(targets); - long misMatchCount = getMismatchDigestCount(); - assertNotEquals(0L, misMatchCount); + long mismatchCount = getMismatchDigestCount(); + assertNotEquals(0L, mismatchCount); triggerOps(leader, "/p2"); - assertNotEquals(misMatchCount, getMismatchDigestCount()); + assertNotEquals(mismatchCount, getMismatchDigestCount()); } private void stopServers(List sids) throws InterruptedException { diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java index 407a9d1a58b..6ad5a4b93e8 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java @@ -194,7 +194,7 @@ public void testParseBoolean() throws IOException, ConfigException { zkProp.setProperty("localSessionsEnabled", "yes"); try { quorumPeerConfig.parseProperties(zkProp); - fail("Must throw exception as 'yes' is not accpetable for parseBoolean!"); + fail("Must throw exception as 'yes' is not acceptable for parseBoolean!"); } catch (ConfigException e) { // expected } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java index 1cb2a2b8efa..6c0f4f926dd 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java @@ -309,7 +309,7 @@ public void testHighestZxidJoinLate() throws Exception { assertEquals(output[0], 1, "Expecting old value 1 since 2 isn't committed yet"); - // Do some other update, so we bump the maxCommttedZxid + // Do some other update, so we bump the maxCommittedZxid // by setting the value to 2 servers.zk[nonleader].setData(path + nonleader, input, -1); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java index 27e2e320100..e7649cdbdfc 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumPeerTestBase.java @@ -95,7 +95,7 @@ public static class MainThread implements Runnable { final File tmpDir; public static final int UNSET_STATIC_CLIENTPORT = -1; - // standalone mode doens't need myid + // standalone mode doesn't need myid public static final int UNSET_MYID = -1; volatile TestQPMain main; diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java index 820394bf868..e2e1227e9b3 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java @@ -195,7 +195,7 @@ public void setup() throws Exception { rootKeyPair = createKeyPair(); contentSigner = new JcaContentSignerBuilder("SHA256WithRSAEncryption").build(rootKeyPair.getPrivate()); - rootCertificate = createSelfSignedCertifcate(rootKeyPair); + rootCertificate = createSelfSignedCertificate(rootKeyPair); // Write the truststore KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); @@ -304,7 +304,7 @@ public void handle(com.sun.net.httpserver.HttpExchange httpExchange) throws IOEx } - private X509Certificate createSelfSignedCertifcate(KeyPair keyPair) throws Exception { + private X509Certificate createSelfSignedCertificate(KeyPair keyPair) throws Exception { X500NameBuilder nameBuilder = new X500NameBuilder(BCStyle.INSTANCE); nameBuilder.addRDN(BCStyle.CN, HOSTNAME); BigInteger serialNumber = new BigInteger(128, new Random()); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/SyncRequestProcessorMetricTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/SyncRequestProcessorMetricTest.java index 17ccdae6ea6..8ca33f798c7 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/SyncRequestProcessorMetricTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/SyncRequestProcessorMetricTest.java @@ -64,7 +64,7 @@ public void setup() throws Exception { }).when(nextProcessor).processRequest(any(Request.class)); } - private Request createRquest(long sessionId, int xid) { + private Request createRequest(long sessionId, int xid) { return new Request(null, sessionId, xid, ZooDefs.OpCode.setData, RequestRecord.fromBytes(new byte[10]), null); } @@ -72,7 +72,7 @@ private Request createRquest(long sessionId, int xid) { public void testSyncProcessorMetrics() throws Exception { SyncRequestProcessor syncProcessor = new SyncRequestProcessor(zks, nextProcessor); for (int i = 0; i < 500; i++) { - syncProcessor.processRequest(createRquest(1, i)); + syncProcessor.processRequest(createRequest(1, i)); } Map values = MetricsUtils.currentServerMetrics(); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/AdHashTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/AdHashTest.java index 866cf9546de..f30de6404ba 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/AdHashTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/AdHashTest.java @@ -52,7 +52,7 @@ private static void removeListOfDigests(AdHash hash, List digests) { } /** - * Test thhe add and remove digest from AdHash is working as expected. + * Test the add and remove digest from AdHash is working as expected. */ @Test public void testAdHash() throws Exception { diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java index 1c8c882c5dc..7fc406b5263 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/util/RequestPathMetricsCollectorTest.java @@ -61,21 +61,21 @@ public void tearDown() { @Test public void testTrimPath() { //normal cases - String trimedPath = RequestPathMetricsCollector.trimPathDepth("/p1/p2/p3", 1); - assertTrue(trimedPath.equalsIgnoreCase("/p1")); - trimedPath = RequestPathMetricsCollector.trimPathDepth("/p1/p2/p3", 2); - assertTrue(trimedPath.equalsIgnoreCase("/p1/p2")); - trimedPath = RequestPathMetricsCollector.trimPathDepth("/p1/p2/p3", 3); - assertTrue(trimedPath.equalsIgnoreCase("/p1/p2/p3")); - trimedPath = RequestPathMetricsCollector.trimPathDepth("/p1/p2/p3", 4); - assertTrue(trimedPath.equalsIgnoreCase("/p1/p2/p3")); + String trimmedPath = RequestPathMetricsCollector.trimPathDepth("/p1/p2/p3", 1); + assertTrue(trimmedPath.equalsIgnoreCase("/p1")); + trimmedPath = RequestPathMetricsCollector.trimPathDepth("/p1/p2/p3", 2); + assertTrue(trimmedPath.equalsIgnoreCase("/p1/p2")); + trimmedPath = RequestPathMetricsCollector.trimPathDepth("/p1/p2/p3", 3); + assertTrue(trimmedPath.equalsIgnoreCase("/p1/p2/p3")); + trimmedPath = RequestPathMetricsCollector.trimPathDepth("/p1/p2/p3", 4); + assertTrue(trimmedPath.equalsIgnoreCase("/p1/p2/p3")); //some extra symbols - trimedPath = RequestPathMetricsCollector.trimPathDepth("//p1 next/p2.index/p3:next", 3); - assertTrue(trimedPath.equalsIgnoreCase("/p1 next/p2.index/p3:next")); - trimedPath = RequestPathMetricsCollector.trimPathDepth("//p1 next/p2.index/p3:next", 2); - assertTrue(trimedPath.equalsIgnoreCase("/p1 next/p2.index")); - trimedPath = RequestPathMetricsCollector.trimPathDepth("//p1 next/p2.index/p3:next", 6); - assertTrue(trimedPath.equalsIgnoreCase("/p1 next/p2.index/p3:next")); + trimmedPath = RequestPathMetricsCollector.trimPathDepth("//p1 next/p2.index/p3:next", 3); + assertTrue(trimmedPath.equalsIgnoreCase("/p1 next/p2.index/p3:next")); + trimmedPath = RequestPathMetricsCollector.trimPathDepth("//p1 next/p2.index/p3:next", 2); + assertTrue(trimmedPath.equalsIgnoreCase("/p1 next/p2.index")); + trimmedPath = RequestPathMetricsCollector.trimPathDepth("//p1 next/p2.index/p3:next", 6); + assertTrue(trimmedPath.equalsIgnoreCase("/p1 next/p2.index/p3:next")); } @Test diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientBase.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientBase.java index 843b804deca..3021421b5e4 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientBase.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientBase.java @@ -553,7 +553,7 @@ private void startServer(int serverId) throws Exception { Set children = JMXEnv.ensureParent("InMemoryDataTree", "StandaloneServer_port"); // Remove beans which are related to zk client sessions. Strong // assertions cannot be done for these client sessions because - // registeration of these beans with server will happen only on their + // registration of these beans with server will happen only on their // respective reconnection interval verifyUnexpectedBeans(children); } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientTest.java index 96db26f804d..faf5c260ea7 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ClientTest.java @@ -262,7 +262,7 @@ public void process(WatchedEvent event) { * in the right order. */ @Test - public void testMutipleWatcherObjs() throws IOException, InterruptedException, KeeperException { + public void testMultipleWatcherObjs() throws IOException, InterruptedException, KeeperException { ZooKeeper zk = createClient(new CountdownWatcher(), hostPort); try { MyWatcher[] watchers = new MyWatcher[100]; diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FollowerResyncConcurrencyTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FollowerResyncConcurrencyTest.java index d9d67c4023b..40cd03bd972 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/FollowerResyncConcurrencyTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/FollowerResyncConcurrencyTest.java @@ -76,7 +76,7 @@ public void tearDown() throws Exception { } /** - * See ZOOKEEPER-1319 - verify that a lagging follwer resyncs correctly + * See ZOOKEEPER-1319 - verify that a lagging follower resyncs correctly * * 1) start with down quorum * 2) start leader/follower1, add some data @@ -314,7 +314,7 @@ public void run() { // Wait until all updates return if (!sem.tryAcquire(ClientBase.CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS)) { - LOG.warn("Did not aquire semaphore fast enough"); + LOG.warn("Did not acquire semaphore fast enough"); } mytestfooThread.join(ClientBase.CONNECTION_TIMEOUT); if (mytestfooThread.isAlive()) { @@ -471,7 +471,7 @@ public void run() { // Wait until all updates return if (!sem.tryAcquire(ClientBase.CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS)) { - LOG.warn("Did not aquire semaphore fast enough"); + LOG.warn("Did not acquire semaphore fast enough"); } mytestfooThread.join(ClientBase.CONNECTION_TIMEOUT); if (mytestfooThread.isAlive()) { @@ -518,7 +518,7 @@ private boolean waitForPendingRequests(int timeout) throws InterruptedException } /** - * Wait for all server to have the same lastProccessedZxid. Timeout in seconds + * Wait for all server to have the same lastProcessedZxid. Timeout in seconds */ private boolean waitForSync(QuorumUtil qu, int index, int timeout) throws InterruptedException { LOG.info("Wait for server to sync"); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/GetProposalFromTxnTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/GetProposalFromTxnTest.java index a85e76d01ec..e9e5b184241 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/GetProposalFromTxnTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/GetProposalFromTxnTest.java @@ -18,11 +18,11 @@ package org.apache.zookeeper.test; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; import java.util.ArrayList; -import java.util.Arrays; import java.util.Iterator; import org.apache.jute.Record; import org.apache.zookeeper.CreateMode; @@ -117,7 +117,7 @@ public void testGetProposalFromTxn() throws Exception { } // All zxid should match what we created - assertTrue(Arrays.equals(zxids, retrievedZxids.toArray(new Long[0])), "Zxids missmatches"); + assertArrayEquals(zxids, retrievedZxids.toArray(new Long[0]), "Zxids mismatches"); // There should be 2000 create requests assertTrue((createCount == MSG_COUNT), "create proposal count == " + MSG_COUNT); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/LoadFromLogNoServerTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/LoadFromLogNoServerTest.java index 1f7fc0d7e76..32a99fa38fb 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/LoadFromLogNoServerTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/LoadFromLogNoServerTest.java @@ -104,7 +104,7 @@ public void testTxnFailure() throws Exception { /* * Does create/delete depending on the type and verifies - * if cversion before the operation is 1 less than cversion afer. + * if cversion before the operation is 1 less than cversion after. */ private void doOp(FileTxnSnapLog logFile, int type, String path, DataTree dt, DataNode parent, int cversion) throws Exception { int lastSlash = path.lastIndexOf('/'); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java index 16a470c31d8..45b5da4a11f 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/LocalSessionRequestTest.java @@ -71,7 +71,7 @@ public void testLocalSessionsOnLeader() throws Exception { } /** - * Walk through the target peer commmittedLog. + * Walk through the target peer committedLog. * @param sessionId * @param peerId */ diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java index 53b75ec32b2..7157966c977 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/MultiOperationTest.java @@ -571,7 +571,7 @@ public void testUpdateConflict(boolean useAsync) throws Exception { @ValueSource(booleans = {true, false}) public void testDeleteUpdateConflict(boolean useAsync) throws Exception { - /* Delete of a node folowed by an update of the (now) deleted node */ + /* Delete of a node followed by an update of the (now) deleted node */ try { multi(zk, Arrays.asList( Op.create("/multi", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT), @@ -590,7 +590,7 @@ public void testDeleteUpdateConflict(boolean useAsync) throws Exception { @ParameterizedTest @ValueSource(booleans = {true, false}) public void testGetResults(boolean useAsync) throws Exception { - /* Delete of a node folowed by an update of the (now) deleted node */ + /* Delete of a node followed by an update of the (now) deleted node */ Iterable ops = Arrays.asList( Op.create("/multi", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT), Op.delete("/multi", 0), diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverTest.java index deaad43b6ee..0eed28e7742 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ObserverTest.java @@ -56,7 +56,7 @@ public void testObserverOnly() throws Exception { * (and will not come up with standalone server). */ @Test - public void testObserverWithStandlone() throws Exception { + public void testObserverWithStandalone() throws Exception { ClientBase.setupTestEnv(); final int CLIENT_PORT_QP1 = PortAssignment.unique(); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumOracleMajTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumOracleMajTest.java index 2a079e2c33a..8cf63900707 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumOracleMajTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumOracleMajTest.java @@ -69,13 +69,13 @@ public void testMajQuorums() throws Throwable { s = s2; } - noDropConectionTest(s); + noDropConnectionTest(s); dropConnectionTest(s, leader); } - private void noDropConectionTest(QuorumPeer s) { + private void noDropConnectionTest(QuorumPeer s) { Leader.Proposal p = new Leader.Proposal(); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumTest.java index ff53b0fe932..1f2029b9a7e 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumTest.java @@ -120,7 +120,7 @@ public void testViewContains() { // Test view contains other servers assertTrue(qb.s1.viewContains(qb.s2.getMyId())); - // Test view does not contain non-existant servers + // Test view does not contain non-existent servers assertFalse(qb.s1.viewContains(-1L)); } @@ -178,7 +178,7 @@ public void testLeaderShutdown() throws IOException, InterruptedException, Keepe @Test public void testMultipleWatcherObjs() throws IOException, InterruptedException, KeeperException { - ct.testMutipleWatcherObjs(); + ct.testMultipleWatcherObjs(); } /** diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumUtilTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumUtilTest.java index 76513dc44c9..e6246e55028 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumUtilTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/QuorumUtilTest.java @@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory; /** - * This class is intented to ensure the correct functionality of + * This class is intended to ensure the correct functionality of * {@link QuorumUtil} helper. */ public class QuorumUtilTest extends ZKTestCase { @@ -42,7 +42,7 @@ public class QuorumUtilTest extends ZKTestCase { *

* This test ensures that all JXM beans associated to a {@link QuorumPeer} * are unregistered when shuted down ({@link QuorumUtil#shutdown(int)}). It - * allows a successfull restarting of several zookeeper servers ( + * allows a successfulrestarting of several zookeeper servers ( * {@link QuorumPeer}) running on the same JVM. *

* See ZOOKEEPER-1214 for details. @@ -77,9 +77,9 @@ public void validateAllMXBeanAreUnregistered() throws IOException { break; } - LOG.info(">-->> Shuting down server [{}]", firstFollowerIndex); + LOG.info(">-->> Shutting down server [{}]", firstFollowerIndex); qU.shutdown(firstFollowerIndex); - LOG.info(">-->> Shuting down server [{}]", secondFollowerIndex); + LOG.info(">-->> Shutting down server [{}]", secondFollowerIndex); qU.shutdown(secondFollowerIndex); LOG.info(">-->> Restarting server [{}]", firstFollowerIndex); qU.restart(firstFollowerIndex); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java index 02b8ff6ef15..e6e3c7b361c 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ReconfigTest.java @@ -553,7 +553,7 @@ public void testRoleChange() throws Exception { // during first and second iteration, leavingIndex will correspond to a // follower - // during third and fouth iteration leavingIndex will be the index of + // during third and fourth iteration leavingIndex will be the index of // the leader int changingIndex = (leaderIndex == 1) ? 2 : 1; diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/RecoveryTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/RecoveryTest.java index 46ff5880bbb..3f8fa9add1c 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/RecoveryTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/RecoveryTest.java @@ -55,7 +55,7 @@ public class RecoveryTest extends ZKTestCase implements Watcher { * server to restart within the connection timeout period. * * Also note that the client latches are used to eliminate any chance - * of spurrious connectionloss exceptions on the read ops. Specifically + * of spurious connectionloss exceptions on the read ops. Specifically * a sync operation will throw this exception if the server goes down * (as recognized by the client) during the operation. If the operation * occurs after the server is down, but before the client recognizes diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ServerCnxnTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ServerCnxnTest.java index 5fb772d58a2..93a35449ceb 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ServerCnxnTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ServerCnxnTest.java @@ -114,7 +114,7 @@ private static StringBuilder readLine(BufferedReader reader) { // After the socket is closed, when the client tries to read a // line of text it will throw java.net.SocketException. // @see jira issue ZOOKEEPER-1862 - LOG.info("Connnection is expired", ioe); + LOG.info("Connection is expired", ioe); } return sb; } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionInvalidationTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionInvalidationTest.java index 1e7870bd293..f3d794f759a 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionInvalidationTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionInvalidationTest.java @@ -41,7 +41,7 @@ public class SessionInvalidationTest extends ClientBase { * * We're using our own marshalling here in order to force an operation * after the session is closed (ZooKeeper.class will not allow this). Also - * by filling the pipe with operations it increases the likelyhood that + * by filling the pipe with operations it increases the likelihood that * the server will process the create before FinalRequestProcessor * removes the session from the tracker. */ diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionTest.java index 85f76c21381..ff3bb4e9c7c 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionTest.java @@ -121,8 +121,8 @@ private DisconnectableZooKeeper createClient(int timeout, CountdownWatcher watch // TODO this test is failing due to client close race condition fixing in separate patch for ZOOKEEPER-63 // /** // * this test checks to see if the sessionid that was created for the - // * first zookeeper client can be reused for the second one immidiately - // * after the first client closes and the new client resues them. + // * first zookeeper client can be reused for the second one immediately + // * after the first client closes and the new client reuses them. // * @throws IOException // * @throws InterruptedException // * @throws KeeperException diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionUpgradeTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionUpgradeTest.java index 114667f01dd..f01e891fb5f 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionUpgradeTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/SessionUpgradeTest.java @@ -94,7 +94,7 @@ private void testLocalSessionsWithoutEphemeral(boolean testLeader) throws Except byte[] localSessionPwd = zk.getSessionPasswd().clone(); // Try connecting with the same session id on a different - // server. This should fail since it is a local sesion. + // server. This should fail since it is a local session. try { watcher.reset(); DisconnectableZooKeeper zknew = new DisconnectableZooKeeper(hostPorts[otherFollowerIdx], CONNECTION_TIMEOUT, watcher, localSessionId, localSessionPwd); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/SledgeHammer.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/SledgeHammer.java index 8190797e4f1..867a092a293 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/SledgeHammer.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/SledgeHammer.java @@ -58,9 +58,9 @@ public void run() { for (int i = 0; i < count; i++) { try { System.out.print(i + "\r"); - List childs = zk.getChildren("/hammers", false); - Collections.shuffle(childs); - for (String s : childs) { + List children = zk.getChildren("/hammers", false); + Collections.shuffle(children); + for (String s : children) { if (s.startsWith("hammer-")) { s = "/hammers/" + s; zk.setData(s, tag, -1); diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/StaticHostProviderTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/StaticHostProviderTest.java index 9ee7dabe3e2..2289847d4e4 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/StaticHostProviderTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/StaticHostProviderTest.java @@ -827,7 +827,7 @@ public InetAddress[] getAllByName(String name) { assertFalse(resolvedThird.isUnresolved(), "HostProvider should return resolved addresses"); assertThat("Bad IP address returned", ipList, hasItems(resolvedThird.getAddress().getHostAddress())); - verify(spyResolver, times(3)).getAllByName("www.apache.org"); // resolution occured every time + verify(spyResolver, times(3)).getAllByName("www.apache.org"); // resolution occurred every time } @Test diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/StatsTrackTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/StatsTrackTest.java index 978e629dae2..4bf69befa33 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/StatsTrackTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/StatsTrackTest.java @@ -41,7 +41,7 @@ public OldStatsTrack() { * the stat string should be of the form count=int,bytes=long * if stats is called with null the count and bytes are initialized * to -1. - * @param stats the stat string to be intialized with + * @param stats the stat string to be initialized with */ public OldStatsTrack(String stats) { if (stats == null) { @@ -85,7 +85,7 @@ public long getBytes() { } /** - * set teh bytes for this stat tracker. + * set the bytes for this stat tracker. * * @param bytes * the bytes to set with diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ZooKeeperTestClient.java b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ZooKeeperTestClient.java index 389104b9aef..3bd0ff569d8 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/test/ZooKeeperTestClient.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/test/ZooKeeperTestClient.java @@ -131,7 +131,7 @@ private void enode_test_1() throws IOException, InterruptedException, KeeperExce Code code = ke.code(); boolean valid = code == KeeperException.Code.NODEEXISTS; if (!valid) { - fail("Unexpected exception code for createin: " + ke.getMessage()); + fail("Unexpected exception code for create: " + ke.getMessage()); } } @@ -207,7 +207,7 @@ private void enode_test_2() throws IOException, InterruptedException, KeeperExce Code code = ke.code(); boolean valid = code == KeeperException.Code.NODEEXISTS; if (!valid) { - fail("Unexpected exception code for createin: " + ke.getMessage()); + fail("Unexpected exception code for create: " + ke.getMessage()); } } @@ -243,7 +243,7 @@ private void enode_test_2() throws IOException, InterruptedException, KeeperExce Code code = ke.code(); boolean valid = code == KeeperException.Code.NOCHILDRENFOREPHEMERALS; if (!valid) { - fail("Unexpected exception code for createin: " + code); + fail("Unexpected exception code for create: " + code); } } @@ -262,7 +262,7 @@ private void enode_test_2() throws IOException, InterruptedException, KeeperExce Code code = ke.code(); boolean valid = code == KeeperException.Code.NONODE; if (!valid) { - fail("Unexpected exception code for createin: " + code); + fail("Unexpected exception code for create: " + code); } } firstGen1 = zk_1.getChildren(parentName, true); diff --git a/zookeeper-server/src/test/resources/test-scripts.sh b/zookeeper-server/src/test/resources/test-scripts.sh index 25854b815ae..531c282611a 100755 --- a/zookeeper-server/src/test/resources/test-scripts.sh +++ b/zookeeper-server/src/test/resources/test-scripts.sh @@ -115,7 +115,7 @@ ls $DATALOGDIR || fail $LINENO stop # -# verify autocreate diabled +# verify autocreate disabled # export ZOO_DATADIR_AUTOCREATE_DISABLE=1 diff --git a/zookeeper-specifications/protocol-spec/Zab.tla b/zookeeper-specifications/protocol-spec/Zab.tla index 25379f55080..4913f0012eb 100644 --- a/zookeeper-specifications/protocol-spec/Zab.tla +++ b/zookeeper-specifications/protocol-spec/Zab.tla @@ -683,7 +683,7 @@ LeaderProcessACKEPOCH(i, j) == /\ ackeRecv' = [ackeRecv EXCEPT ![i] = UpdateAckeRecv(@, j, msg.mepoch, msg.mhistory) ] /\ \/ \* 2.1. ackeRecv becomes quorum, determine Ie' - \* and broacasts NEWLEADER in Q. (l.1.2 + l.2.1) + \* and broadcasts NEWLEADER in Q. (l.1.2 + l.2.1) /\ AckeRecvBecomeQuorum(i) /\ \* Update f.a LET newLeaderEpoch == acceptedEpoch[i] IN @@ -833,14 +833,14 @@ LeaderProcessACKLD(i, j) == sendCounter, followerVars, electionVars, proposalMsgsLog, epochLeader>> /\ UpdateRecorder(<<"LeaderProcessACKLD", i, j>>) -RECURSIVE ZxidToIndexHepler(_,_,_,_) -ZxidToIndexHepler(his, zxid, cur, appeared) == +RECURSIVE ZxidToIndexHelper(_,_,_,_) +ZxidToIndexHelper(his, zxid, cur, appeared) == IF cur > Len(his) THEN cur ELSE IF TxnZxidEqual(his[cur], zxid) THEN CASE appeared = TRUE -> -1 [] OTHER -> Minimum( { cur, - ZxidToIndexHepler(his, zxid, cur + 1, TRUE) } ) - ELSE ZxidToIndexHepler(his, zxid, cur + 1, appeared) + ZxidToIndexHelper(his, zxid, cur + 1, TRUE) } ) + ELSE ZxidToIndexHelper(his, zxid, cur + 1, appeared) \* return -1: this zxid appears at least twice. Len(his) + 1: does not exist. \* 1 - Len(his): exists and appears just once. @@ -848,7 +848,7 @@ ZxidToIndex(his, zxid) == IF ZxidEqual( zxid, <<0, 0>> ) THEN 0 ELSE IF Len(his) = 0 THEN 1 ELSE LET len == Len(his) IN IF \E idx \in 1..len: TxnZxidEqual(his[idx], zxid) - THEN ZxidToIndexHepler(his, zxid, 1, FALSE) + THEN ZxidToIndexHelper(his, zxid, 1, FALSE) ELSE len + 1 (* Follower receives COMMITLD. Commit all txns. *) diff --git a/zookeeper-specifications/protocol-spec/issues.md b/zookeeper-specifications/protocol-spec/issues.md index 559434dd974..c6d2bcd857f 100644 --- a/zookeeper-specifications/protocol-spec/issues.md +++ b/zookeeper-specifications/protocol-spec/issues.md @@ -34,7 +34,7 @@ We found that because the set of objects when the Leader broadcast *PROPOSE* is Therefore, we have made amendments in the spec. When the Leader broadcasts *PROPOSE*, the set of sending objects has been changed from *ackldRecv* to *ackeRecv*. We successfully discovered errors introduced by the vague description of **Q** in the protocol through model checking, and fixed them in the specification. ## (Issue 2) Issue introduced by lack of client request logic -Since there is not discriptions about client request, we need to add a process that describes the Leader receives a client request and encapsulates the request as a new log entry and appends it to the local log. This process are represented as action *LeaderProcessRequest* in the spec. +Since there is no descriptions about client request, we need to add a process that describes the Leader receives a client request and encapsulates the request as a new log entry and appends it to the local log. This process are represented as action *LeaderProcessRequest* in the spec. In our original specification, when Follower receives the message *PROPOSE*, the *zxid* of the proposed log entry should be the successor *zxid* of the latest local log entry‘s *zxid*, otherwise it will be regarded as an illegal *PROPOSE*. diff --git a/zookeeper-specifications/system-spec/zk-3.7/FastLeaderElection.tla b/zookeeper-specifications/system-spec/zk-3.7/FastLeaderElection.tla index a5a44ba2ca0..cdff66ad225 100644 --- a/zookeeper-specifications/system-spec/zk-3.7/FastLeaderElection.tla +++ b/zookeeper-specifications/system-spec/zk-3.7/FastLeaderElection.tla @@ -72,7 +72,7 @@ VARIABLE outOfElection \* recvQueue[i]: The queue of received notifications or timeout signals in server i. VARIABLE recvQueue -\* A veriable to wait for new notifications, corresponding to line 1050 in FastLeaderElection.java. +\* A variable to wait for new notifications, corresponding to line 1050 in FastLeaderElection.java. VARIABLE waitNotmsg \* leadingVoteSet[i]: The set of voters that follow i. diff --git a/zookeeper-specifications/system-spec/zk-3.7/ZkV3_7_0.tla b/zookeeper-specifications/system-spec/zk-3.7/ZkV3_7_0.tla index cf8ca8fa180..2f3efd6ec6e 100644 --- a/zookeeper-specifications/system-spec/zk-3.7/ZkV3_7_0.tla +++ b/zookeeper-specifications/system-spec/zk-3.7/ZkV3_7_0.tla @@ -119,7 +119,7 @@ VARIABLE msgs \* Simulates network channel. \* Variables about status of cluster network and node presence. VARIABLES status, \* Whether the server is online or offline. - partition \* network partion. + partition \* network partition. \* Variables only used in verifying properties. VARIABLES epochLeader, \* Set of leaders in every epoch. @@ -143,7 +143,7 @@ VARIABLES epochLeader, \* Set of leaders in every epoch. \* to compare ids between servers. \* Update: we have transformed idTable from variable to function. -\*VARIABLE clientReuqest \* Start from 0, and increases monotonically +\*VARIABLE clientRequest \* Start from 0, and increases monotonically \* when LeaderProcessRequest performed. To \* avoid existing two requests with same value. \* Update: Remove it to recorder.nClientRequest. @@ -797,7 +797,7 @@ LeaderProcessFOLLOWERINFO(i, j) == /\ \/ /\ zabState[i] = DISCOVERY /\ UNCHANGED violatedInvariants \/ /\ zabState[i] /= DISCOVERY - /\ PrintT("Exception: waitingFotNewEpoch true," \o + /\ PrintT("Exception: waitingForNewEpoch true," \o " while zabState not DISCOVERY.") /\ violatedInvariants' = [violatedInvariants EXCEPT !.stateInconsistent = TRUE] /\ tempMaxEpoch' = [tempMaxEpoch EXCEPT ![i] = IF lastAcceptedEpoch >= tempMaxEpoch[i] @@ -895,20 +895,20 @@ UpdateAckSid(his, lastSeenIndex, target) == \* return -1: this zxid appears at least twice; Len(his) + 1: does not exist; \* 1 ~ Len(his): exists and appears just once. -RECURSIVE ZxidToIndexHepler(_,_,_,_) -ZxidToIndexHepler(his, zxid, cur, appeared) == +RECURSIVE ZxidToIndexHelper(_,_,_,_) +ZxidToIndexHelper(his, zxid, cur, appeared) == IF cur > Len(his) THEN cur ELSE IF TxnZxidEqual(his[cur], zxid) THEN CASE appeared = TRUE -> -1 [] OTHER -> Minimum( { cur, - ZxidToIndexHepler(his, zxid, cur + 1, TRUE) } ) - ELSE ZxidToIndexHepler(his, zxid, cur + 1, appeared) + ZxidToIndexHelper(his, zxid, cur + 1, TRUE) } ) + ELSE ZxidToIndexHelper(his, zxid, cur + 1, appeared) ZxidToIndex(his, zxid) == IF ZxidEqual( zxid, <<0, 0>> ) THEN 0 ELSE IF Len(his) = 0 THEN 1 ELSE LET len == Len(his) IN IF \E idx \in 1..len: TxnZxidEqual(his[idx], zxid) - THEN ZxidToIndexHepler(his, zxid, 1, FALSE) + THEN ZxidToIndexHelper(his, zxid, 1, FALSE) ELSE len + 1 \* Find index idx which meets: @@ -963,7 +963,7 @@ LastSnapshot(i) == IF zabState[i] = BROADCAST THEN lastSnapshot[i] [] OTHER -> lastSnapshot[i] \* To compress state space, -\* 1. we merge sending SNAP and outputing snapshot buffer into sending SNAP, and +\* 1. we merge sending SNAP and outputting snapshot buffer into sending SNAP, and \* 2. substitute sub sequence of history for snapshot of data tree. SerializeSnapshot(i, idx) == IF idx <= 0 THEN << >> ELSE SubSeq(history[i], 1, idx) @@ -1618,7 +1618,7 @@ FollowerCommitInBatches(i) == /\ lastProcessed' = [lastProcessed EXCEPT ![i] = lastCommitted'[i]] /\ UNCHANGED violatedInvariants \/ /\ ~match - /\ PrintT("Warn: Committing zxid withou see txn. /" \o + /\ PrintT("Warn: Committing zxid without see txn. /" \o "Committing zxid != pending txn zxid.") /\ violatedInvariants' = [violatedInvariants EXCEPT !.commitInconsistent = TRUE ]