Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9DDA411C70 for ; Sat, 7 Jun 2014 18:19:01 +0000 (UTC) Received: (qmail 33205 invoked by uid 500); 7 Jun 2014 18:19:01 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 33094 invoked by uid 500); 7 Jun 2014 18:19:01 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 32643 invoked by uid 99); 7 Jun 2014 18:19:01 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Jun 2014 18:19:01 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 20F508BBEAD; Sat, 7 Jun 2014 18:19:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Date: Sat, 07 Jun 2014 18:19:32 -0000 Message-Id: In-Reply-To: <29937670c88a49f291fad4a4fae0fddd@git.apache.org> References: <29937670c88a49f291fad4a4fae0fddd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [34/50] [abbrv] git commit: wip on doc wip on doc Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/bfc388ce Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/bfc388ce Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/bfc388ce Branch: refs/heads/master Commit: bfc388ce020afa62a6f5e1d6bd3c6cdd9a82e8a3 Parents: 48b0759 Author: randgalt Authored: Sun Jun 1 13:14:49 2014 -0500 Committer: randgalt Committed: Sun Jun 1 13:14:49 2014 -0500 ---------------------------------------------------------------------- .../idl/services/CuratorProjectionService.java | 15 ++++ .../src/site/confluence/events.confluence | 85 ++++++++++++++++++++ 2 files changed, 100 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/bfc388ce/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java index ca5a604..b9de507 100644 --- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java +++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/idl/services/CuratorProjectionService.java @@ -314,6 +314,21 @@ public class CuratorProjectionService } @ThriftMethod + public void sync(CuratorProjection projection, String path, String asyncContext) throws RpcException + { + try + { + CuratorEntry entry = CuratorEntry.mustGetEntry(connectionManager, projection); + BackgroundCallback backgroundCallback = new RpcBackgroundCallback(this, projection); + entry.getClient().sync().inBackground(backgroundCallback, asyncContext).forPath(path); + } + catch ( Exception e ) + { + throw new RpcException(e); + } + } + + @ThriftMethod public boolean closeGenericProjection(CuratorProjection projection, String id) throws RpcException { try http://git-wip-us.apache.org/repos/asf/curator/blob/bfc388ce/curator-x-rpc/src/site/confluence/events.confluence ---------------------------------------------------------------------- diff --git a/curator-x-rpc/src/site/confluence/events.confluence b/curator-x-rpc/src/site/confluence/events.confluence index 416b978..a6df4e8 100644 --- a/curator-x-rpc/src/site/confluence/events.confluence +++ b/curator-x-rpc/src/site/confluence/events.confluence @@ -2,3 +2,88 @@ h1. Events + +h2. Event Loop + +In order to receive out\-of\-bounds messages (connection state changes, watcher triggers, etc.) you must have an event loop to recieve +messages from the EventService. Here is pseudo code: + +{code} +inThread => { + while ( isOpen ) { + event = eventService.getNextEvent(curatorProjection) + ... process event ... + } +} +{code} + +h2. Schema + +h3. CuratorEvent + +||Field||Type||Description|| +|type|CuratorEventType|The event type| +|resultCode|int|some event types have a result code (i.e. async API calls)| +|path|string|if there is a path associated with the event| +|context|string|async context for async API calls| +|stat|Stat|some event types have a ZooKeeper Stat object| +|data|bytes|ZNode data if the event type has it| +|name|string|ZNode name if the event type has it| +|children|list of string|list of node names if the event type has it| +|aclList|list of Acl|list of ACL data if the event type has it| +|watchedEvent|WatchedEvent|if the event type is WATCHED| +|leaderEvent|LeaderEvent|if the event type is WATCHED| +|childrenCacheEvent|PathChildrenCacheEvent|if the event type is PATH\_CHILDREN\_CACHE| + +h3. CuratorEventType + +||Value||Description|| +|PING|Returned if there no events have been generated within the [[configured|configuration.html]] pingTime| +|CREATE|Async createNode() API completion| +|DELETE|Async deleteNode() API completion| +|EXISTS|Async exists() API completion| +|GET\_DATA|Async getData() API completion| +|SET\_DATA|Async setData() API completion| +|CHILDREN|Async getChildren() API completion| +|SYNC|Async sync() API completion| +|WATCHED|A watcher has triggered| +|CONNECTION\_CONNECTED|A Curator ConnectionStateListener is installed. This event is for the initial successful connection.| +|CONNECTION\_SUSPENDED|A Curator ConnectionStateListener is installed. This event means the connection has been suspended.| +|CONNECTION\_RECONNECTED|A Curator ConnectionStateListener is installed. This event means the connection has been reconnected.| +|CONNECTION\_LOST|A Curator ConnectionStateListener is installed. This event means the connection has been lost.| +|CONNECTION\_READ\_ONLY|A Curator ConnectionStateListener is installed. This event means the connection has changed to read only.| +|LEADER|A Leader recipe event| +|PATH\_CHILDREN\_CACHE|A path children cache event| +|NODE\_CACHE|The node for a node cache has changed| + +h3. LeaderEvent + +||Field||Type||Description|| +|path|string|The leader's path| +|participantId|string|The participant ID for the event being reported| +|isLeader|bool|if true, this participant is being made leader. If false, it is losing leadership.| + +h3. PathChildrenCacheEvent + +||Field||Type||Description|| +|cachedPath|name|The path being cached| +|type|PathChildrenCacheEventType|cache event type| +|data|ChildData|data for the child ZNode| + +h3. PathChildrenCacheEventType + +Values: CHILD\_ADDED, + CHILD\_UPDATED, + CHILD\_REMOVED, + CONNECTION\_SUSPENDED, + CONNECTION\_RECONNECTED, + CONNECTION\_LOST, + INITIALIZED + +h3. ChildData + +||Field||Type||Description|| +|path|string|The ZNode path| +|stat|Stat|ZooKeeper Stat object| +|data|bytes|ZNode data (if the cache is configured to cache data)| +