You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2014/06/18 01:03:10 UTC
[06/18] git commit: some doc edits
some doc edits
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/a57be393
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/a57be393
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/a57be393
Branch: refs/heads/master
Commit: a57be393bab39fcc20b09331cc2a736127885823
Parents: 122476a
Author: randgalt <ra...@apache.org>
Authored: Mon Jun 9 11:10:16 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Mon Jun 9 11:10:16 2014 -0500
----------------------------------------------------------------------
.../src/site/confluence/configuration.confluence | 2 +-
curator-x-rpc/src/site/confluence/reference.confluence | 6 +++---
curator-x-rpc/src/site/confluence/usage.confluence | 13 +++++++------
3 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/a57be393/curator-x-rpc/src/site/confluence/configuration.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/configuration.confluence b/curator-x-rpc/src/site/confluence/configuration.confluence
index 939ee47..56f6cfe 100644
--- a/curator-x-rpc/src/site/confluence/configuration.confluence
+++ b/curator-x-rpc/src/site/confluence/configuration.confluence
@@ -120,7 +120,7 @@ h2. Connection
h2. Retry
-The retry policy configuration depends on what type is used. There 3 types supported:
+The retry policy configuration depends on what type is used. There are three types supported:
||Name||Type||Default Value||Description||
|type|string|n/a|*exponential\-backoff*|
http://git-wip-us.apache.org/repos/asf/curator/blob/a57be393/curator-x-rpc/src/site/confluence/reference.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/reference.confluence b/curator-x-rpc/src/site/confluence/reference.confluence
index a7b1ce5..68c3692 100644
--- a/curator-x-rpc/src/site/confluence/reference.confluence
+++ b/curator-x-rpc/src/site/confluence/reference.confluence
@@ -6,16 +6,16 @@ h2. CuratorService
||API||Arguments||Return Value||Description||
|newCuratorProjection|connectionName|CuratorProjection|Allocates a projection to a configured CuratorFramework instance in the RPC server. "connectionName" is the name of a [[configured|configuration.html]] connection.|
-|closeCuratorProjection|CuratorProjection|void|Close a CuratorProjection. Also closes any recipes, etc. create for the projection.|
+|closeCuratorProjection|CuratorProjection|void|Close a CuratorProjection. Also closes any recipes, etc. created for the projection.|
|pingCuratorProjection|CuratorProjection|void|Keeps the CuratorProjection from timing out. NOTE: your [[EventService|events.html]] event loop will do this for you.|
|createNode|CreateSpec|Created path name|Create a ZNode|
|deleteNode|DeleteSpec|void|Delete a ZNode|
|getData|GetDataSpec|bytes|Return a ZNode's data|
|setData|SetDataSpec|Stat|Set a ZNode's data|
-|exists|ExistsSpec|Stat|Check is a ZNode exists|
+|exists|ExistsSpec|Stat|Check if a ZNode exists|
|getChildren|GetChildrenSpec|List of nodes|Get the child nodes for a ZNode|
|sync|path and async context|void|Do a ZooKeeper sync|
-|closeGenericProjection|id|void|Closes any projection|
+|closeGenericProjection|id|void|Closes any projection. All projections have an "id" field. This is the value to pass.|
|acquireLock|path, maxWaitMs|optional lock projection|Acquire a lock for the given path. Will wait at most maxWaitMs to acquire the lock. If the acquisition fails, result will be null.|
|startLeaderSelector|path, participantId, waitForLeadershipMs|LeaderResult|Start a leader selector on the given path. The instance will be assigned the specified participantId. If waitForLeadershipMs is non\-zero, the method will block for that amount of time waiting for leadership.|
|getLeaderParticipants|leaderProjection|List of Participant|Return the participants in a leader selector|
http://git-wip-us.apache.org/repos/asf/curator/blob/a57be393/curator-x-rpc/src/site/confluence/usage.confluence
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/site/confluence/usage.confluence b/curator-x-rpc/src/site/confluence/usage.confluence
index 36fb04e..047ae5e 100644
--- a/curator-x-rpc/src/site/confluence/usage.confluence
+++ b/curator-x-rpc/src/site/confluence/usage.confluence
@@ -72,15 +72,16 @@ h2. Usage
Once initialized, use recipes/APIs as needed. Here is an example of using the lock recipe:
{code}
-optionalLockId = client.acquireLock(curatorProjection, "/mylock", 10000)
-if optionalLockId.lockProjection == null {
+optionalLock = client.acquireLock(curatorProjection, "/mylock", 10000)
+if optionalLock.lockProjection == null {
// lock attempt failed. Throw exception, etc.
}
-lockId = optionalLockId.lockProjection
+lockProjection = optionalLock.lockProjection
-// you now own the lock
-
-client.closeGenericProjection(curatorProjection, lockId.id)
+try
+ // you now own the lock
+finally
+ client.closeGenericProjection(curatorProjection, lockProjection.id)
{code}
Here is an example of using the path cache: