From 4be6dd71af083192f20c4399d86b3a0e5a9327ec Mon Sep 17 00:00:00 2001 From: Timandes White Date: Sun, 13 Nov 2016 14:18:20 +0000 Subject: [PATCH] add class Zookeeper git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@340987 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/zookeeper/book.xml | 4 +- reference/zookeeper/constants.xml | 82 +---- reference/zookeeper/zookeeper.xml | 319 ++++++++++++++++++ reference/zookeeper/zookeeper/addauth.xml | 135 ++++++++ reference/zookeeper/zookeeper/connect.xml | 89 +++++ reference/zookeeper/zookeeper/construct.xml | 88 +++++ reference/zookeeper/zookeeper/create.xml | 141 ++++++++ reference/zookeeper/zookeeper/delete.xml | 112 ++++++ reference/zookeeper/zookeeper/exists.xml | 112 ++++++ reference/zookeeper/zookeeper/get.xml | 133 ++++++++ reference/zookeeper/zookeeper/getacl.xml | 124 +++++++ reference/zookeeper/zookeeper/getclientid.xml | 63 ++++ .../zookeeper/zookeeper/getrecvtimeout.xml | 61 ++++ reference/zookeeper/zookeeper/getstate.xml | 63 ++++ .../zookeeper/zookeeper/isrecoverable.xml | 66 ++++ reference/zookeeper/zookeeper/set.xml | 132 ++++++++ reference/zookeeper/zookeeper/setacl.xml | 142 ++++++++ .../zookeeper/zookeeper/setdebuglevel.xml | 102 ++++++ .../zookeeper/setdeterministicconnorder.xml | 90 +++++ .../zookeeper/zookeeper/setlogstream.xml | 77 +++++ reference/zookeeper/zookeeper/setwatcher.xml | 75 ++++ 21 files changed, 2127 insertions(+), 83 deletions(-) create mode 100644 reference/zookeeper/zookeeper.xml create mode 100644 reference/zookeeper/zookeeper/addauth.xml create mode 100644 reference/zookeeper/zookeeper/connect.xml create mode 100644 reference/zookeeper/zookeeper/construct.xml create mode 100644 reference/zookeeper/zookeeper/create.xml create mode 100644 reference/zookeeper/zookeeper/delete.xml create mode 100644 reference/zookeeper/zookeeper/exists.xml create mode 100644 reference/zookeeper/zookeeper/get.xml create mode 100644 reference/zookeeper/zookeeper/getacl.xml create mode 100644 reference/zookeeper/zookeeper/getclientid.xml create mode 100644 reference/zookeeper/zookeeper/getrecvtimeout.xml create mode 100644 reference/zookeeper/zookeeper/getstate.xml create mode 100644 reference/zookeeper/zookeeper/isrecoverable.xml create mode 100644 reference/zookeeper/zookeeper/set.xml create mode 100644 reference/zookeeper/zookeeper/setacl.xml create mode 100644 reference/zookeeper/zookeeper/setdebuglevel.xml create mode 100644 reference/zookeeper/zookeeper/setdeterministicconnorder.xml create mode 100644 reference/zookeeper/zookeeper/setlogstream.xml create mode 100644 reference/zookeeper/zookeeper/setwatcher.xml diff --git a/reference/zookeeper/book.xml b/reference/zookeeper/book.xml index 7ef19420e0..75a7e11962 100644 --- a/reference/zookeeper/book.xml +++ b/reference/zookeeper/book.xml @@ -2,8 +2,8 @@ - Zookeeper - Zookeeper + ZooKeeper + ZooKeeper diff --git a/reference/zookeeper/constants.xml b/reference/zookeeper/constants.xml index ec98b953fc..7b696c74f1 100644 --- a/reference/zookeeper/constants.xml +++ b/reference/zookeeper/constants.xml @@ -3,87 +3,7 @@ &reftitle.constants; - &extension.constants; - - - - - - - - - Zookeeper::PERM_READ - (integer) - - - - can read nodes value and list its children - - - - - - - Zookeeper::PERM_WRITE - (integer) - - - - can set the nodes value - - - - - - - Zookeeper::PERM_CREATE - (integer) - - - - can create children - - - - - - - Zookeeper::PERM_DELETE - (integer) - - - - can delete children - - - - - - - Zookeeper::PERM_ADMIN - (integer) - - - - can execute set_acl() - - - - - - - Zookeeper::PERM_ALL - (integer) - - - - all of the above flags ORd together - - - - - - + &no.constants; + + + The ZooKeeper class + ZooKeeper + + + + +
+ &reftitle.intro; + + Represents ZooKeeper session. + +
+ + +
+ &reftitle.classsynopsis; + + + + Zookeeper + + + + + Zookeeper + + + + + + &Methods; + + + + + + + + + + + &Constants; + + const + integer + PERM_READ + 1 + + + const + integer + PERM_WRITE + 2 + + + const + integer + PERM_CREATE + 4 + + + const + integer + PERM_DELETE + 8 + + + const + integer + PERM_ADMIN + 16 + + + const + integer + PERM_ALL + 31 + + + + const + integer + LOG_LEVEL_ERROR + 1 + + + const + integer + LOG_LEVEL_WARN + 2 + + + const + integer + LOG_LEVEL_INFO + 3 + + + const + integer + LOG_LEVEL_DEBUG + 4 + + + + const + integer + EXPIRED_SESSION_STATE + -112 + + + const + integer + AUTH_FAILED_STATE + -113 + + + const + integer + CONNECTING_STATE + 1 + + + const + integer + ASSOCIATING_STATE + 2 + + + const + integer + CONNECTED_STATE + 3 + + + const + integer + READONLY_STATE + 5 + + + const + integer + NOTCONNECTED_STATE + 999 + + + + + +
+ &reftitle.constants; +
+ <acronym>ZooKeeper</acronym> Permissions + + + + Zookeeper::PERM_READ + + Can read nodes value and list its children + + + + Zookeeper::PERM_WRITE + + Can set the nodes value + + + + Zookeeper::PERM_CREATE + + Can create children + + + + Zookeeper::PERM_DELETE + + Can delete children + + + + Zookeeper::PERM_ADMIN + + Can execute set_acl() + + + + Zookeeper::PERM_ALL + + All of the above flags ORd together + + + + +
+ +
+ <acronym>ZooKeeper</acronym> Log Levels + + + + Zookeeper::LOG_LEVEL_ERROR + + Outputs only error mesages + + + + Zookeeper::LOG_LEVEL_WARN + + Outputs errors/warnings + + + + Zookeeper::LOG_LEVEL_INFO + + Outputs big action messages besides errors/warnings + + + + Zookeeper::LOG_LEVEL_DEBUG + + Outputs all + + + + +
+ +
+ <acronym>ZooKeeper</acronym> States + + + + Zookeeper::EXPIRED_SESSION_STATE + + Connected but session expired + + + + Zookeeper::AUTH_FAILED_STATE + + Connected but auth failed + + + + Zookeeper::CONNECTING_STATE + + Connecting + + + + Zookeeper::ASSOCIATING_STATE + + Associating + + + + Zookeeper::CONNECTED_STATE + + Connected + + + + Zookeeper::READONLY_STATE + + TODO: help us improve this extension. + + + + Zookeeper::NOTCONNECTED_STATE + + Connection failed + + + + +
+ +
+ + + +
+ +
+ + &reference.zookeeper.entities.zookeeper; + +
+ + + diff --git a/reference/zookeeper/zookeeper/addauth.xml b/reference/zookeeper/zookeeper/addauth.xml new file mode 100644 index 0000000000..c280179d1b --- /dev/null +++ b/reference/zookeeper/zookeeper/addauth.xml @@ -0,0 +1,135 @@ + + + + + + Zookeeper::addAuth + Specify application credentials. + + + + &reftitle.description; + + boolZookeeper::addAuth + stringscheme + stringcert + callablecompletion_cbnull + + + The application calls this function to specify its credentials for purposes of authentication. The server will use the security provider specified by the scheme parameter to authenticate the client connection. If the authentication request has failed: + - the server connection is dropped. + - the watcher is called with the ZOO_AUTH_FAILED_STATE value as the state parameter. + + + + + &reftitle.parameters; + + + scheme + + + The id of authentication scheme. Natively supported: "digest" password-based authentication + + + + + cert + + + Application credentials. The actual value depends on the scheme. + + + + + completion_cb + + + The routine to invoke when the request completes. One of the following result codes may be passed into the completion callback: + - ZOK operation completed successfully + - ZAUTHFAILED authentication failed + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or operation fails. + + + + + &reftitle.examples; + + <methodname>Zookeeper::addAuth</methodname> example + + Add auth before requesting node value. + + +set($path, $value); + +$zookeeper->addAuth('digest', 'user0:passwd0'); +$r = $zookeeper->get($path); +if ($r) + echo $r; +else + echo 'ERR'; +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + Zookeeper::create + Zookeeper::setAcl + Zookeeper::getAcl + ZooKeeper States + + + + + + diff --git a/reference/zookeeper/zookeeper/connect.xml b/reference/zookeeper/zookeeper/connect.xml new file mode 100644 index 0000000000..bbdde8c419 --- /dev/null +++ b/reference/zookeeper/zookeeper/connect.xml @@ -0,0 +1,89 @@ + + + + + + Zookeeper::connect + Create a handle to used communicate with zookeeper. + + + + &reftitle.description; + + voidZookeeper::connect + stringhost + callablewatcher_cbnull + intrecv_timeout10000 + + + + This method creates a new handle and a zookeeper session that corresponds to that handle. Session establishment is asynchronous, meaning that the session should not be considered established until (and unless) an event of state ZOO_CONNECTED_STATE is received. + + + + + &reftitle.parameters; + + + host + + + Comma separated host:port pairs, each corresponding to a zk server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" + + + + + watcher_cb + + + The global watcher callback function. When notifications are triggered this function will be invoked. + + + + + recv_timeout + + + The timeout for this session, only valid if the connections is currently connected (ie. last watcher state is ZOO_CONNECTED_STATE). + + + + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or could not init instance. + + + + + &reftitle.seealso; + + Zookeeper::__construct + + + + + + diff --git a/reference/zookeeper/zookeeper/construct.xml b/reference/zookeeper/zookeeper/construct.xml new file mode 100644 index 0000000000..97d2da5614 --- /dev/null +++ b/reference/zookeeper/zookeeper/construct.xml @@ -0,0 +1,88 @@ + + + + + + Zookeeper::__construct + Create a handle to used communicate with zookeeper. + + + + &reftitle.description; + + Zookeeper::__construct + stringhost'' + callablewatcher_cbnull + intrecv_timeout10000 + + + This method creates a new handle and a zookeeper session that corresponds to that handle. Session establishment is asynchronous, meaning that the session should not be considered established until (and unless) an event of state ZOO_CONNECTED_STATE is received. + + + + + &reftitle.parameters; + + + host + + + comma separated host:port pairs, each corresponding to a zk server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002" + + + + + watcher_cb + + + the global watcher callback function. When notifications are triggered this function will be invoked. + + + + + recv_timeout + + + the timeout for this session, only valid if the connections is currently connected (ie. last watcher state is ZOO_CONNECTED_STATE). + + + + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or could not init instance. + + + + + &reftitle.seealso; + + Zookeeper::connect + + + + + + diff --git a/reference/zookeeper/zookeeper/create.xml b/reference/zookeeper/zookeeper/create.xml new file mode 100644 index 0000000000..1aa3f63f2a --- /dev/null +++ b/reference/zookeeper/zookeeper/create.xml @@ -0,0 +1,141 @@ + + + + + + Zookeeper::create + Create a node synchronously. + + + + &reftitle.description; + + stringZookeeper::create + stringpath + stringvalue + arrayacls + intflagsnull + + + This method will create a node in ZooKeeper. A node can only be created if it does not already exists. The Create Flags affect the creation of nodes. If ZOO_EPHEMERAL flag is set, the node will automatically get removed if the client session goes away. If the ZOO_SEQUENCE flag is set, a unique monotonically increasing sequence number is appended to the path name. + + + + + &reftitle.parameters; + + + path + + + The name of the node. Expressed as a file name with slashes separating ancestors of the node. + + + + + value + + + The data to be stored in the node. + + + + + acls + + + The initial ACL of the node. The ACL must not be null or empty. + + + + + flags + + + this parameter can be set to 0 for normal create or an OR of the Create Flags + + + + + + + + &reftitle.returnvalues; + + Returns the path of the new node (this might be different than the supplied path because of the ZOO_SEQUENCE flag) on success, and false on failure. + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to create node. + + + + + &reftitle.examples; + + <methodname>Zookeeper::create</methodname> example + + Create a new node. + + + Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone', + ) +); +$path = '/path/to/newnode'; +$realPath = $zookeeper->create($path, null, $aclArray); +if ($realPath) + echo $realPath; +else + echo 'ERR'; +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + Zookeeper::delete + ZooKeeper Permissions + + + + + + diff --git a/reference/zookeeper/zookeeper/delete.xml b/reference/zookeeper/zookeeper/delete.xml new file mode 100644 index 0000000000..26d443688a --- /dev/null +++ b/reference/zookeeper/zookeeper/delete.xml @@ -0,0 +1,112 @@ + + + + + + Zookeeper::delete + Delete a node in zookeeper synchronously. + + + + &reftitle.description; + + boolZookeeper::delete + stringpath + intversion-1 + + + + + &reftitle.parameters; + + + path + + + The name of the node. Expressed as a file name with slashes separating ancestors of the node. + + + + + version + + + The expected version of the node. The function will fail if the actual version of the node does not match the expected version. If -1 is used the version check will not take place. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to delete node. + + + + + &reftitle.examples; + + <methodname>Zookeeper::delete</methodname> example + + Delete a existing node. + + +delete($path); +if ($r) + echo 'SUCCESS'; +else + echo 'ERR'; +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + Zookeeper::create + + + + + + diff --git a/reference/zookeeper/zookeeper/exists.xml b/reference/zookeeper/zookeeper/exists.xml new file mode 100644 index 0000000000..123445fc71 --- /dev/null +++ b/reference/zookeeper/zookeeper/exists.xml @@ -0,0 +1,112 @@ + + + + + + Zookeeper::exists + Checks the existence of a node in zookeeper synchronously. + + + + &reftitle.description; + + boolZookeeper::exists + stringpath + callablewatcher_cbnull + + + + + &reftitle.parameters; + + + path + + + The name of the node. Expressed as a file name with slashes separating ancestors of the node. + + + + + watcher_cb + + + if nonzero, a watch will be set at the server to notify the client if the node changes. The watch will be set even if the node does not + + + + + + + + &reftitle.returnvalues; + + Returns true/false on success, and false on failure. + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to check the existence of a node. + + + + + &reftitle.examples; + + <methodname>Zookeeper::exists</methodname> example + + Check the existence of a node. + + +exists($path); +if ($r) + echo 'EXISTS'; +else + echo 'N/A or ERR'; +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + Zookeeper::get + + + + + + diff --git a/reference/zookeeper/zookeeper/get.xml b/reference/zookeeper/zookeeper/get.xml new file mode 100644 index 0000000000..acff779770 --- /dev/null +++ b/reference/zookeeper/zookeeper/get.xml @@ -0,0 +1,133 @@ + + + + + + Zookeeper::get + Gets the data associated with a node synchronously. + + + + &reftitle.description; + + stringZookeeper::get + stringpath + callablewatcher_cbnull + arraystatnull + intmax_size0 + + + + + &reftitle.parameters; + + + path + + + The name of the node. Expressed as a file name with slashes separating ancestors of the node. + + + + + watcher_cb + + + If nonzero, a watch will be set at the server to notify the client if the node changes. + + + + + stat + + + If not NULL, will hold the value of stat for the path on return. + + + + + max_size + + + Max size of the data. If 0 is used, this method will return the whole data. + + + + + + + + &reftitle.returnvalues; + + Returns the data on success, and false on failure. + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to get value from node. + + + + + &reftitle.examples; + + <methodname>Zookeeper::get</methodname> example + + Get value from node. + + +set($path, $value); + +$r = $zookeeper->get($path); +if ($r) + echo $r; +else + echo 'ERR'; +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + Zookeeper::set + + + + + + diff --git a/reference/zookeeper/zookeeper/getacl.xml b/reference/zookeeper/zookeeper/getacl.xml new file mode 100644 index 0000000000..24272b4e74 --- /dev/null +++ b/reference/zookeeper/zookeeper/getacl.xml @@ -0,0 +1,124 @@ + + + + + + Zookeeper::getAcl + Gets the acl associated with a node synchronously. + + + + &reftitle.description; + + arrayZookeeper::getAcl + stringpath + + + + + &reftitle.parameters; + + + path + + + The name of the node. Expressed as a file name with slashes separating ancestors of the node. + + + + + + + + &reftitle.returnvalues; + + Return acl array on success and false on failure. + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to get ACL of a node. + + + + + &reftitle.examples; + + <methodname>Zookeeper::getAcl</methodname> example + + Get ACL of a node. + + + Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone', + ) +); +$path = '/path/to/newnode'; +$zookeeper->setAcl($path, $aclArray); + +$r = $zookeeper->getAcl($path); +if ($r) + var_dump($r); +else + echo 'ERR'; +?> +]]> + + &example.outputs; + + + array(3) { + ["perms"]=> + int(31) + ["scheme"]=> + string(5) "world" + ["id"]=> + string(6) "anyone" + } +} +]]> + + + + + + &reftitle.seealso; + + Zookeeper::create + Zookeeper::setAcl + ZooKeeper Permissions + + + + + + diff --git a/reference/zookeeper/zookeeper/getclientid.xml b/reference/zookeeper/zookeeper/getclientid.xml new file mode 100644 index 0000000000..5c46c0ac57 --- /dev/null +++ b/reference/zookeeper/zookeeper/getclientid.xml @@ -0,0 +1,63 @@ + + + + + + Zookeeper::getClientId + return the client session id, only valid if the connections is currently connected (ie. last watcher state is ZOO_CONNECTED_STATE) + + + + &reftitle.description; + + intZookeeper::getClientId + + + + + + &reftitle.returnvalues; + + Returns the client session id on success, and false on failure. + + + + + &reftitle.errors; + + This method emits PHP error/warning when it could not get client session id. + + + + + &reftitle.seealso; + + Zookeeper::__construct + Zookeeper::connect + Zookeeper::getState + ZooKeeper States + + + + + + diff --git a/reference/zookeeper/zookeeper/getrecvtimeout.xml b/reference/zookeeper/zookeeper/getrecvtimeout.xml new file mode 100644 index 0000000000..69f68a1876 --- /dev/null +++ b/reference/zookeeper/zookeeper/getrecvtimeout.xml @@ -0,0 +1,61 @@ + + + + + + Zookeeper::getRecvTimeout + Return the timeout for this session, only valid if the connections is currently connected (ie. last watcher state is ZOO_CONNECTED_STATE). This value may change after a server re-connect. + + + + &reftitle.description; + + intZookeeper::getRecvTimeout + + + + + + &reftitle.returnvalues; + + Returns the timeout for this session on success, and false on failure. + + + + + &reftitle.errors; + + This method emits PHP error/warning when operation fails. + + + + + &reftitle.seealso; + + Zookeeper::__construct + Zookeeper::connect + + + + + + diff --git a/reference/zookeeper/zookeeper/getstate.xml b/reference/zookeeper/zookeeper/getstate.xml new file mode 100644 index 0000000000..7993e3b5c1 --- /dev/null +++ b/reference/zookeeper/zookeeper/getstate.xml @@ -0,0 +1,63 @@ + + + + + + Zookeeper::getState + Get the state of the zookeeper connection. + + + + &reftitle.description; + + intZookeeper::getState + + + + + + &reftitle.returnvalues; + + Returns the state of zookeeper connection on success, and false on failure. + + + + + &reftitle.errors; + + This method emits PHP error/warning when it fails to get state of zookeeper connection. + + + + + &reftitle.seealso; + + Zookeeper::__construct + Zookeeper::connect + Zookeeper::getClientId + ZooKeeper States + + + + + + diff --git a/reference/zookeeper/zookeeper/isrecoverable.xml b/reference/zookeeper/zookeeper/isrecoverable.xml new file mode 100644 index 0000000000..39c9eed8b1 --- /dev/null +++ b/reference/zookeeper/zookeeper/isrecoverable.xml @@ -0,0 +1,66 @@ + + + + + + Zookeeper::isRecoverable + Checks if the current zookeeper connection state can be recovered. + + + + &reftitle.description; + + boolZookeeper::isRecoverable + + + + The application must close the zhandle and try to reconnect. + + + + + &reftitle.returnvalues; + + Returns true/false on success, and false on failure. + + + + + &reftitle.errors; + + This method emits PHP error/warning when operation fails. + + + + + &reftitle.seealso; + + Zookeeper::__construct + Zookeeper::connect + Zookeeper::getClientId + ZooKeeper States + + + + + + diff --git a/reference/zookeeper/zookeeper/set.xml b/reference/zookeeper/zookeeper/set.xml new file mode 100644 index 0000000000..abdb6d82f8 --- /dev/null +++ b/reference/zookeeper/zookeeper/set.xml @@ -0,0 +1,132 @@ + + + + + + Zookeeper::set + Sets the data associated with a node. + + + + &reftitle.description; + + boolZookeeper::set + stringpath + stringvalue + intversion-1 + arraystatnull + + + + + &reftitle.parameters; + + + path + + + The name of the node. Expressed as a file name with slashes separating ancestors of the node. + + + + + value + + + The data to be stored in the node. + + + + + version + + + The expected version of the node. The function will fail if the actual version of the node does not match the expected version. If -1 is used the version check will not take place. + + + + + stat + + + If not NULL, will hold the value of stat for the path on return. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to save value to node. + + + + + &reftitle.examples; + + <methodname>Zookeeper::set</methodname> example + + Save value to node. + + +set($path, $value); +if ($r) + echo 'SUCCESS'; +else + echo 'ERR'; +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + Zookeeper::create + Zookeeper::get + + + + + + diff --git a/reference/zookeeper/zookeeper/setacl.xml b/reference/zookeeper/zookeeper/setacl.xml new file mode 100644 index 0000000000..ee9d36f009 --- /dev/null +++ b/reference/zookeeper/zookeeper/setacl.xml @@ -0,0 +1,142 @@ + + + + + + Zookeeper::setAcl + Sets the acl associated with a node synchronously. + + + + &reftitle.description; + + boolZookeeper::setAcl + stringpath + intversion + arrayacl + + + + + &reftitle.parameters; + + + path + + + The name of the node. Expressed as a file name with slashes separating ancestors of the node. + + + + + version + + + The expected version of the path. + + + + + acl + + + The acl to be set on the path. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to set ACL for a node. + + + + + &reftitle.examples; + + <methodname>Zookeeper::setAcl</methodname> example + + Set ACL for a node. + + + Zookeeper::PERM_ALL, + 'scheme' => 'world', + 'id' => 'anyone', + ) +); +$path = '/path/to/newnode'; +$zookeeper->setAcl($path, $aclArray); + +$r = $zookeeper->getAcl($path); +if ($r) + var_dump($r); +else + echo 'ERR'; +?> +]]> + + &example.outputs; + + + array(3) { + ["perms"]=> + int(31) + ["scheme"]=> + string(5) "world" + ["id"]=> + string(6) "anyone" + } +} +]]> + + + + + + &reftitle.seealso; + + Zookeeper::create + Zookeeper::getAcl + ZooKeeper Permissions + + + + + + diff --git a/reference/zookeeper/zookeeper/setdebuglevel.xml b/reference/zookeeper/zookeeper/setdebuglevel.xml new file mode 100644 index 0000000000..c588c01bb9 --- /dev/null +++ b/reference/zookeeper/zookeeper/setdebuglevel.xml @@ -0,0 +1,102 @@ + + + + + + Zookeeper::setDebugLevel + Sets the debugging level for the library. + + + + &reftitle.description; + + staticboolZookeeper::setDebugLevel + intlogLevel + + + + + &reftitle.parameters; + + + logLevel + + + ZooKeeper log level constants. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to set debug level. + + + + + &reftitle.examples; + + <methodname>Zookeeper::setDebugLevel</methodname> example + + Set debugl level. + + + +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + ZooKeeper Log Levels + + + + + + diff --git a/reference/zookeeper/zookeeper/setdeterministicconnorder.xml b/reference/zookeeper/zookeeper/setdeterministicconnorder.xml new file mode 100644 index 0000000000..30f9c0d9e1 --- /dev/null +++ b/reference/zookeeper/zookeeper/setdeterministicconnorder.xml @@ -0,0 +1,90 @@ + + + + + + Zookeeper::setDeterministicConnOrder + Enable/disable quorum endpoint order randomization. + + + + &reftitle.description; + + staticboolZookeeper::setDeterministicConnOrder + boolyesOrNo + + + If passed a non-zero value, will make the client connect to quorum peers in the order as specified in the zookeeper_init() call. A zero value causes zookeeper_init() to permute the peer endpoints which is good for more even client connection distribution among the quorum peers. + + + + + &reftitle.parameters; + + + yesOrNo + + + Enable/disable quorum endpoint order randomization. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or operation fails. + + + + + &reftitle.notes; + + + Note: typically this method should NOT be used outside of testing. + + + ¬e.language-construct; + ¬e.not-bin-safe; + ¬e.registerglobals; + + + + &reftitle.seealso; + + Zookeeper::__construct + Zookeeper::connect + + + + + + diff --git a/reference/zookeeper/zookeeper/setlogstream.xml b/reference/zookeeper/zookeeper/setlogstream.xml new file mode 100644 index 0000000000..db63bd447f --- /dev/null +++ b/reference/zookeeper/zookeeper/setlogstream.xml @@ -0,0 +1,77 @@ + + + + + + Zookeeper::setLogStream + Sets the stream to be used by the library for logging. + + + + &reftitle.description; + + boolZookeeper::setLogStream + resourcestream + + + The zookeeper library uses stderr as its default log stream. Application must make sure the stream is writable. Passing in NULL resets the stream to its default value (stderr). + + + + + &reftitle.parameters; + + + stream + + + The stream to be used by the library for logging. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or operation fails. + + + + + &reftitle.seealso; + + Zookeeper::setDebugLevel + + + + + + diff --git a/reference/zookeeper/zookeeper/setwatcher.xml b/reference/zookeeper/zookeeper/setwatcher.xml new file mode 100644 index 0000000000..702d7013ae --- /dev/null +++ b/reference/zookeeper/zookeeper/setwatcher.xml @@ -0,0 +1,75 @@ + + + + + + Zookeeper::setWatcher + Set a watcher function. + + + + &reftitle.description; + + boolZookeeper::setWatcher + callablewatcher_cb + + + + + &reftitle.parameters; + + + watcher_cb + + + A watch will be set at the server to notify the client if the node changes. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.errors; + + This method emits PHP error/warning when parameters count or types are wrong or fail to set watcher. + + + + + &reftitle.seealso; + + Zookeeper::exists + Zookeeper::get + + + + + +