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 48B2911001 for ; Wed, 14 May 2014 15:10:52 +0000 (UTC) Received: (qmail 68054 invoked by uid 500); 14 May 2014 15:10:52 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 67953 invoked by uid 500); 14 May 2014 15:10:51 -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 67746 invoked by uid 99); 14 May 2014 15:10:51 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 May 2014 15:10:51 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 090C98C44C6; Wed, 14 May 2014 15:10:51 +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: Wed, 14 May 2014 15:10:56 -0000 Message-Id: In-Reply-To: <9eefb947d5c04c1fb4504f1691c37586@git.apache.org> References: <9eefb947d5c04c1fb4504f1691c37586@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/12] git commit: Fixed a slew of javadoc errors Fixed a slew of javadoc errors Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/c7968b92 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/c7968b92 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/c7968b92 Branch: refs/heads/CURATOR-96 Commit: c7968b9295c450932e1bbb566ab4f910f68a7393 Parents: 62494bd Author: randgalt Authored: Mon Apr 21 16:17:51 2014 -0500 Committer: randgalt Committed: Mon Apr 21 16:17:51 2014 -0500 ---------------------------------------------------------------------- .../main/java/org/apache/curator/RetryLoop.java | 6 ++-- .../apache/curator/SessionFailRetryLoop.java | 11 +++--- .../apache/curator/utils/CloseableUtils.java | 4 +-- .../org/apache/curator/utils/EnsurePath.java | 10 +++--- .../curator/framework/CuratorFramework.java | 2 +- .../curator/framework/api/CreateBuilder.java | 4 +-- .../api/transaction/CuratorTransaction.java | 16 +++++---- .../transaction/CuratorTransactionResult.java | 4 +-- .../framework/recipes/cache/ChildData.java | 2 +- .../recipes/cache/PathChildrenCache.java | 6 ++-- .../framework/recipes/leader/LeaderLatch.java | 38 ++++++++++---------- .../recipes/leader/LeaderSelector.java | 7 ++-- .../locks/InterProcessReadWriteLock.java | 6 ++-- .../recipes/locks/InterProcessSemaphoreV2.java | 8 ----- .../recipes/nodes/PersistentEphemeralNode.java | 1 - .../recipes/queue/DistributedDelayQueue.java | 4 +-- .../recipes/queue/DistributedIdQueue.java | 2 +- .../recipes/queue/DistributedPriorityQueue.java | 4 +-- .../recipes/queue/DistributedQueue.java | 11 +++--- .../server/rest/DiscoveryResource.java | 4 +-- .../curator/x/discovery/ServiceDiscovery.java | 1 - .../discovery/details/ServiceDiscoveryImpl.java | 1 - pom.xml | 2 +- 23 files changed, 70 insertions(+), 84 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-client/src/main/java/org/apache/curator/RetryLoop.java ---------------------------------------------------------------------- diff --git a/curator-client/src/main/java/org/apache/curator/RetryLoop.java b/curator-client/src/main/java/org/apache/curator/RetryLoop.java index 3f6a469..6b66e82 100644 --- a/curator-client/src/main/java/org/apache/curator/RetryLoop.java +++ b/curator-client/src/main/java/org/apache/curator/RetryLoop.java @@ -37,8 +37,8 @@ import java.util.concurrent.atomic.AtomicReference; * the exception *

* - * Canonical usage:
- *
+ * Canonical usage:
+ *
  * RetryLoop retryLoop = client.newRetryLoop();
  * while ( retryLoop.shouldContinue() )
  * {
@@ -54,7 +54,7 @@ import java.util.concurrent.atomic.AtomicReference;
  *         retryLoop.takeException(e);
  *     }
  * }
- * 
+ *
*/ public class RetryLoop { http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-client/src/main/java/org/apache/curator/SessionFailRetryLoop.java ---------------------------------------------------------------------- diff --git a/curator-client/src/main/java/org/apache/curator/SessionFailRetryLoop.java b/curator-client/src/main/java/org/apache/curator/SessionFailRetryLoop.java index 8ae5e74..ec77b35 100644 --- a/curator-client/src/main/java/org/apache/curator/SessionFailRetryLoop.java +++ b/curator-client/src/main/java/org/apache/curator/SessionFailRetryLoop.java @@ -45,18 +45,19 @@ import java.util.concurrent.atomic.AtomicBoolean; * *

* Here's an example: + *

*
    *
  • You create an ephemeral/sequential node as a kind of lock/marker
  • *
  • You perform some other operations
  • *
  • The session fails for some reason
  • - *
  • You attempt to create a node assuming that the lock/marker still exists
  • + *
  • You attempt to create a node assuming that the lock/marker still exists *
      *
    • Curator will notice the session failure and try to reconnect
    • *
    • In most cases, the reconnect will succeed and, thus, the node creation will succeed * even though the ephemeral node will have been deleted by ZooKeeper.
    • *
    + *
  • *
- *

* *

* The SessionFailRetryLoop prevents this type of scenario. When a session failure is detected, @@ -65,8 +66,8 @@ import java.util.concurrent.atomic.AtomicBoolean; * set of operations or fail (depending on {@link SessionFailRetryLoop.Mode}) *

* - * Canonical usage:
- *
+ * Canonical usage:
+ *
  * SessionFailRetryLoop    retryLoop = client.newSessionFailRetryLoop(mode);
  * retryLoop.start();
  * try
@@ -87,7 +88,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
  * {
  *     retryLoop.close();
  * }
- * 
+ *
*/ public class SessionFailRetryLoop implements Closeable { http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-client/src/main/java/org/apache/curator/utils/CloseableUtils.java ---------------------------------------------------------------------- diff --git a/curator-client/src/main/java/org/apache/curator/utils/CloseableUtils.java b/curator-client/src/main/java/org/apache/curator/utils/CloseableUtils.java index 6b6a475..1082afb 100644 --- a/curator-client/src/main/java/org/apache/curator/utils/CloseableUtils.java +++ b/curator-client/src/main/java/org/apache/curator/utils/CloseableUtils.java @@ -26,9 +26,7 @@ import java.io.Closeable; import java.io.IOException; /** - * @author Andy Boothe - *

- * This class adds back functionality that was removed in Guava v16.0. + * This class adds back functionality that was removed in Guava v16.0. */ public class CloseableUtils { http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-client/src/main/java/org/apache/curator/utils/EnsurePath.java ---------------------------------------------------------------------- diff --git a/curator-client/src/main/java/org/apache/curator/utils/EnsurePath.java b/curator-client/src/main/java/org/apache/curator/utils/EnsurePath.java index 15687c4..f072775 100644 --- a/curator-client/src/main/java/org/apache/curator/utils/EnsurePath.java +++ b/curator-client/src/main/java/org/apache/curator/utils/EnsurePath.java @@ -29,16 +29,15 @@ import java.util.concurrent.atomic.AtomicReference; *

* Utility to ensure that a particular path is created. *

- *

*

* The first time it is used, a synchronized call to {@link ZKPaths#mkdirs(ZooKeeper, String)} is made to * ensure that the entire path has been created (with an empty byte array if needed). Subsequent * calls with the instance are un-synchronized NOPs. *

- *

*

- * Usage:
- *

+ * Usage:
+ *

+ *
  *         EnsurePath       ensurePath = new EnsurePath(aFullPathToEnsure);
  *         ...
  *         String           nodePath = aFullPathToEnsure + "/foo";
@@ -47,8 +46,7 @@ import java.util.concurrent.atomic.AtomicReference;
  *         ...
  *         ensurePath.ensure(zk);   // subsequent times are NOPs
  *         zk.create(nodePath, ...);
- *     
- *

+ *
*/ public class EnsurePath { http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java index e49386e..dcbc567 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/CuratorFramework.java @@ -74,7 +74,7 @@ public interface CuratorFramework extends Closeable /** * Start an exists builder - *

+ *

* The builder will return a Stat object as if org.apache.zookeeper.ZooKeeper.exists() were called. Thus, a null * means that it does not exist and an actual Stat object means it does exist. * http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java b/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java index 8109f13..d29b475 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/api/CreateBuilder.java @@ -33,9 +33,9 @@ public interface CreateBuilder extends /** * @deprecated this has been generalized to support all create modes. Instead, use: - *

+     * 
      *     client.create().withProtection().withMode(CreateMode.PERSISTENT_SEQUENTIAL)...
-     * 
+ *
* @return this */ public ACLPathAndBytesable withProtectedEphemeralSequential(); http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransaction.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransaction.java b/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransaction.java index 53d482b..3901abf 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransaction.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransaction.java @@ -28,21 +28,23 @@ import org.apache.zookeeper.ZooKeeper; * *

* The general form for this interface is: - *

+ * 

+ *
  *         curator.inTransaction().operation().arguments().forPath(...).
  *             and().more-operations.
  *             and().commit();
- *     
+ *
* + *

* Here's an example that creates two nodes in a transaction - *

+ * 

+ *
  *         curator.inTransaction().
  *             create().forPath("/path-one", path-one-data).
  *             and().create().forPath("/path-two", path-two-data).
  *             and().commit();
- *     
- *

- * + *
+ * *

* Important: the operations are not submitted until * {@link CuratorTransactionFinal#commit()} is called. @@ -73,7 +75,7 @@ public interface CuratorTransaction /** * Start a check builder in the transaction - * + *ChildData * @return builder object */ public TransactionCheckBuilder check(); http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java ---------------------------------------------------------------------- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java b/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java index 86ca457..03bbca2 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java @@ -33,9 +33,9 @@ public class CuratorTransactionResult /** * Utility that can be passed to Google Guava to find a particular result. E.g. - *

+     * 
      * Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, path))
-     * 
+ *
* * @param type operation type * @param forPath path http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/ChildData.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/ChildData.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/ChildData.java index 399cb33..d385d4d 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/ChildData.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/ChildData.java @@ -36,7 +36,7 @@ public class ChildData implements Comparable } /** - * @inheritDoc + * {@inheritDoc} * * Note: this class has a natural ordering that is inconsistent with equals. */ http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java index 0599499..855d060 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/PathChildrenCache.java @@ -59,7 +59,7 @@ import java.util.concurrent.atomic.AtomicReference; *

A utility that attempts to keep all data from all children of a ZK path locally cached. This class * will watch the ZK path, respond to update/create/delete events, pull down the data, etc. You can * register a listener that will get notified when changes occur.

- *

+ *

*

IMPORTANT - it's not possible to stay transactionally in sync. Users of this class must * be prepared for false-positives and false-negatives. Additionally, always use the version number * when updating data to avoid overwriting another process' change.

@@ -769,11 +769,11 @@ public class PathChildrenCache implements Closeable /** * Submits a runnable to the executor. - *

+ *

* This method is synchronized because it has to check state about whether this instance is still open. Without this check * there is a race condition with the dataWatchers that get set. Even after this object is closed() it can still be * called by those watchers, because the close() method cannot actually disable the watcher. - *

+ *

* The synchronization overhead should be minimal if non-existant as this is generally only called from the * ZK client thread and will only contend if close() is called in parallel with an update, and that's the exact state * we want to protect from. http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java index d419b98..ecdd903 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderLatch.java @@ -218,9 +218,9 @@ public class LeaderLatch implements Closeable /** * Attaches a listener to this LeaderLatch - *

+ *

* Attaching the same listener multiple times is a noop from the second time on. - *

+ *

* All methods for the listener are run using the provided Executor. It is common to pass in a single-threaded * executor so that you can be certain that listener methods are called in sequence, but if you are fine with * them being called out of order you are welcome to use multiple threads. @@ -234,9 +234,9 @@ public class LeaderLatch implements Closeable /** * Attaches a listener to this LeaderLatch - *

+ *

* Attaching the same listener multiple times is a noop from the second time on. - *

+ *

* All methods for the listener are run using the provided Executor. It is common to pass in a single-threaded * executor so that you can be certain that listener methods are called in sequence, but if you are fine with * them being called out of order you are welcome to use multiple threads. @@ -262,25 +262,23 @@ public class LeaderLatch implements Closeable /** *

Causes the current thread to wait until this instance acquires leadership * unless the thread is {@linkplain Thread#interrupt interrupted} or {@linkplain #close() closed}.

- *

*

If this instance already is the leader then this method returns immediately.

- *

+ * *

Otherwise the current * thread becomes disabled for thread scheduling purposes and lies - * dormant until one of three things happen: + * dormant until one of three things happen:

*
    *
  • This instance becomes the leader
  • *
  • Some other thread {@linkplain Thread#interrupt interrupts} * the current thread
  • *
  • The instance is {@linkplain #close() closed}
  • - *

- *

- *

If the current thread: + * + *

If the current thread:

*
    *
  • has its interrupted status set on entry to this method; or *
  • is {@linkplain Thread#interrupt interrupted} while waiting, *
- * then {@link InterruptedException} is thrown and the current thread's + *

then {@link InterruptedException} is thrown and the current thread's * interrupted status is cleared.

* * @throws InterruptedException if the current thread is interrupted @@ -307,13 +305,13 @@ public class LeaderLatch implements Closeable *

Causes the current thread to wait until this instance acquires leadership * unless the thread is {@linkplain Thread#interrupt interrupted}, * the specified waiting time elapses or the instance is {@linkplain #close() closed}.

- *

+ * *

If this instance already is the leader then this method returns immediately * with the value {@code true}.

- *

+ * *

Otherwise the current * thread becomes disabled for thread scheduling purposes and lies - * dormant until one of four things happen: + * dormant until one of four things happen:

*
    *
  • This instance becomes the leader
  • *
  • Some other thread {@linkplain Thread#interrupt interrupts} @@ -321,15 +319,15 @@ public class LeaderLatch implements Closeable *
  • The specified waiting time elapses.
  • *
  • The instance is {@linkplain #close() closed}
  • *
- *

- *

If the current thread: + * + *

If the current thread:

*
    *
  • has its interrupted status set on entry to this method; or *
  • is {@linkplain Thread#interrupt interrupted} while waiting, *
- * then {@link InterruptedException} is thrown and the current thread's + *

then {@link InterruptedException} is thrown and the current thread's * interrupted status is cleared.

- *

+ * *

If the specified waiting time elapses or the instance is {@linkplain #close() closed} * then the value {@code false} is returned. If the time is less than or equal to zero, the method * will not wait at all.

@@ -385,7 +383,7 @@ public class LeaderLatch implements Closeable *

* Returns the set of current participants in the leader selection *

- *

+ *

*

* NOTE - this method polls the ZK server. Therefore it can possibly * return a value that does not match {@link #hasLeadership()} as hasLeadership @@ -406,7 +404,7 @@ public class LeaderLatch implements Closeable * Return the id for the current leader. If for some reason there is no * current leader, a dummy participant is returned. *

- *

+ *

*

* NOTE - this method polls the ZK server. Therefore it can possibly * return a value that does not match {@link #hasLeadership()} as hasLeadership http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java index 1a2470c..e7b61f9 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/leader/LeaderSelector.java @@ -54,7 +54,6 @@ import java.util.concurrent.atomic.AtomicReference; * be assigned leader until it releases leadership at which time another one from the group will * be chosen. *

- *

*

* Note that this class uses an underlying {@link InterProcessMutex} and as a result leader * election is "fair" - each user will become leader in the order originally requested @@ -202,7 +201,7 @@ public class LeaderSelector implements Closeable /** * Attempt leadership. This attempt is done in the background - i.e. this method returns - * immediately.

+ * immediately.

* IMPORTANT: previous versions allowed this method to be called multiple times. This * is no longer supported. Use {@link #requeue()} for this purpose. */ @@ -278,7 +277,7 @@ public class LeaderSelector implements Closeable *

* Returns the set of current participants in the leader selection *

- *

+ *

*

* NOTE - this method polls the ZK server. Therefore it can possibly * return a value that does not match {@link #hasLeadership()} as hasLeadership @@ -323,7 +322,7 @@ public class LeaderSelector implements Closeable * Return the id for the current leader. If for some reason there is no * current leader, a dummy participant is returned. *

- *

+ *

*

* NOTE - this method polls the ZK server. Therefore it can possibly * return a value that does not match {@link #hasLeadership()} as hasLeadership http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessReadWriteLock.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessReadWriteLock.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessReadWriteLock.java index fafde5f..d5b0036 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessReadWriteLock.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessReadWriteLock.java @@ -39,13 +39,13 @@ import java.util.List; *

* *

- * Reentrancy
+ * Reentrancy
* This lock allows both readers and writers to reacquire read or write locks in the style of a * re-entrant lock. Non-re-entrant readers are not allowed until all write locks held by the * writing thread/process have been released. Additionally, a writer can acquire the read lock, but not - * vice-versa. If a reader tries to acquire the write lock it will never succeed.

+ * vice-versa. If a reader tries to acquire the write lock it will never succeed.

* - * Lock downgrading
+ * Lock downgrading
* Re-entrancy also allows downgrading from the write lock to a read lock, by acquiring the write * lock, then the read lock and then releasing the write lock. However, upgrading from a read * lock to the write lock is not possible. http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java index fd27cbb..52b8d8f 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreV2.java @@ -49,27 +49,23 @@ import java.util.concurrent.TimeUnit; * Further, this semaphore is mostly "fair" - each user will get a lease in the order requested * (from ZK's point of view). *

- *

*

* There are two modes for determining the max leases for the semaphore. In the first mode the * max leases is a convention maintained by the users of a given path. In the second mode a * {@link SharedCountReader} is used as the method for semaphores of a given path to determine * the max leases. *

- *

*

* If a {@link SharedCountReader} is not used, no internal checks are done to prevent * Process A acting as if there are 10 leases and Process B acting as if there are 20. Therefore, * make sure that all instances in all processes use the same numberOfLeases value. *

- *

*

* The various acquire methods return {@link Lease} objects that represent acquired leases. Clients * must take care to close lease objects (ideally in a finally * block) else the lease will be lost. However, if the client session drops (crash, etc.), * any leases held by the client are automatically closed and made available to other clients. *

- *

*

* Thanks to Ben Bangert (ben@groovie.org) for the algorithm used. *

@@ -194,7 +190,6 @@ public class InterProcessSemaphoreV2 /** *

Acquire a lease. If no leases are available, this method blocks until either the maximum * number of leases is increased or another client/process closes a lease.

- *

*

The client must close the lease when it is done with it. You should do this in a * finally block.

* @@ -211,7 +206,6 @@ public class InterProcessSemaphoreV2 *

Acquire qty leases. If there are not enough leases available, this method * blocks until either the maximum number of leases is increased enough or other clients/processes * close enough leases.

- *

*

The client must close the leases when it is done with them. You should do this in a * finally block. NOTE: You can use {@link #returnAll(Collection)} for this.

* @@ -228,7 +222,6 @@ public class InterProcessSemaphoreV2 *

Acquire a lease. If no leases are available, this method blocks until either the maximum * number of leases is increased or another client/process closes a lease. However, this method * will only block to a maximum of the time parameters given.

- *

*

The client must close the lease when it is done with it. You should do this in a * finally block.

* @@ -249,7 +242,6 @@ public class InterProcessSemaphoreV2 * close enough leases. However, this method will only block to a maximum of the time * parameters given. If time expires before all leases are acquired, the subset of acquired * leases are automatically closed.

- *

*

The client must close the leases when it is done with them. You should do this in a * finally block. NOTE: You can use {@link #returnAll(Collection)} for this.

* http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java index 6b6ae52..08cbe17 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentEphemeralNode.java @@ -45,7 +45,6 @@ import java.util.concurrent.atomic.AtomicReference; * A persistent ephemeral node is an ephemeral node that attempts to stay present in * ZooKeeper, even through connection and session interruptions. *

- *

*

* Thanks to bbeck (https://github.com/bbeck) for the initial coding and design *

http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedDelayQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedDelayQueue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedDelayQueue.java index eb55989..b84471f 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedDelayQueue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedDelayQueue.java @@ -121,7 +121,7 @@ public class DistributedDelayQueue implements Closeable, QueueBase /** * Add an item into the queue. Adding is done in the background - thus, this method will - * return quickly.

+ * return quickly.

* NOTE: if an upper bound was set via {@link QueueBuilder#maxItems}, this method will * block until there is available space in the queue. * @@ -156,7 +156,7 @@ public class DistributedDelayQueue implements Closeable, QueueBase /** * Add a set of items with the same priority into the queue. Adding is done in the background - thus, this method will - * return quickly.

+ * return quickly.

* NOTE: if an upper bound was set via {@link QueueBuilder#maxItems}, this method will * block until there is available space in the queue. * http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedIdQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedIdQueue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedIdQueue.java index 68a78fb..a83fa36 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedIdQueue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedIdQueue.java @@ -122,7 +122,7 @@ public class DistributedIdQueue implements QueueBase } /** - * Put an item into the queue with the given Id

+ * Put an item into the queue with the given Id

* NOTE: if an upper bound was set via {@link QueueBuilder#maxItems}, this method will * block until there is available space in the queue. * http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedPriorityQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedPriorityQueue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedPriorityQueue.java index cebdc3b..4b70ec5 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedPriorityQueue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedPriorityQueue.java @@ -92,7 +92,7 @@ public class DistributedPriorityQueue implements Closeable, QueueBase /** * Add an item into the queue. Adding is done in the background - thus, this method will - * return quickly.

+ * return quickly.

* NOTE: if an upper bound was set via {@link QueueBuilder#maxItems}, this method will * block until there is available space in the queue. * @@ -126,7 +126,7 @@ public class DistributedPriorityQueue implements Closeable, QueueBase /** * Add a set of items with the same priority into the queue. Adding is done in the background - thus, this method will - * return quickly.

+ * return quickly.

* NOTE: if an upper bound was set via {@link QueueBuilder#maxItems}, this method will * block until there is available space in the queue. * http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java index a04cad7..ca53a4e 100644 --- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java +++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java @@ -53,13 +53,14 @@ import java.util.concurrent.atomic.AtomicReference; * are guaranteed to be ordered (by means of ZK's PERSISTENT_SEQUENTIAL node).

* *

- * Guarantees:
+ * Guarantees:

+ *
    *
  • If a single consumer takes items out of the queue, they will be ordered FIFO. i.e. if ordering is important, * use a {@link LeaderSelector} to nominate a single consumer.
  • *
  • Unless a {@link QueueBuilder#lockPath(String)} is used, there is only guaranteed processing of each message to the point of receipt by a given instance. - * If an instance receives an item from the queue but dies while processing it, the item will be lost. If you need message recoverability, use + *
  • If an instance receives an item from the queue but dies while processing it, the item will be lost. If you need message recoverability, use * a {@link QueueBuilder#lockPath(String)}
  • - *

    + *
*/ public class DistributedQueue implements QueueBase { @@ -287,7 +288,7 @@ public class DistributedQueue implements QueueBase /** * Add an item into the queue. Adding is done in the background - thus, this method will - * return quickly.

+ * return quickly.

* NOTE: if an upper bound was set via {@link QueueBuilder#maxItems}, this method will * block until there is available space in the queue. * @@ -319,7 +320,7 @@ public class DistributedQueue implements QueueBase /** * Add a set of items into the queue. Adding is done in the background - thus, this method will - * return quickly.

+ * return quickly.

* NOTE: if an upper bound was set via {@link QueueBuilder#maxItems}, this method will * block until there is available space in the queue. * http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java ---------------------------------------------------------------------- diff --git a/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java b/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java index 7d048af..271b827 100644 --- a/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java +++ b/curator-x-discovery-server/src/main/java/org/apache/curator/x/discovery/server/rest/DiscoveryResource.java @@ -56,7 +56,7 @@ import java.util.List; * Here's a version that has no payload (i.e. * a Void payload): *

- *
+ * 
  * @Path("/")
  * public class MyResource extends DiscoveryResource<Void> {
  *     public MyResource(@Context ContextResolver<DiscoveryContext<Void>> resolver) {
@@ -64,7 +64,7 @@ import java.util.List;
  *         super(resolver.getContext(DiscoveryContext.class));
  *     }
  * }
- * 
+ *
*/ public abstract class DiscoveryResource { http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceDiscovery.java ---------------------------------------------------------------------- diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceDiscovery.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceDiscovery.java index 4cb3dee..3347edf 100644 --- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceDiscovery.java +++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceDiscovery.java @@ -91,7 +91,6 @@ public interface ServiceDiscovery extends Closeable /** * Allocate a new builder. {@link ServiceProviderBuilder#providerStrategy} is set to {@link RoundRobinStrategy} - * and {@link ServiceProviderBuilder#refreshPaddingMs} is set to 1 second. * * @return the builder */ http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java ---------------------------------------------------------------------- diff --git a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java index 9fc2b54..3924b40 100644 --- a/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java +++ b/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java @@ -206,7 +206,6 @@ public class ServiceDiscoveryImpl implements ServiceDiscovery /** * Allocate a new builder. {@link ServiceProviderBuilder#providerStrategy} is set to {@link RoundRobinStrategy} - * and {@link ServiceProviderBuilder#refreshPaddingMs} is set to 1 second. * * @return the builder */ http://git-wip-us.apache.org/repos/asf/curator/blob/c7968b92/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 18e5907..0982a1d 100644 --- a/pom.xml +++ b/pom.xml @@ -431,7 +431,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9 + 2.9.1 true