You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ti...@apache.org on 2023/08/15 08:32:55 UTC
[curator-site] 04/05: style: more align code blocks
This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/curator-site.git
commit 125608fbeb019e872a188a4bd43a558a8c5aea4f
Author: tison <wa...@gmail.com>
AuthorDate: Tue Aug 15 16:28:41 2023 +0800
style: more align code blocks
Signed-off-by: tison <wa...@gmail.com>
---
docs/async-details.md | 1 -
docs/recipes-curator-cache.md | 2 +-
docs/recipes-path-cache.md | 2 +-
docs/recipes-shared-counter.md | 6 +++---
docs/recipes-shared-semaphore.md | 2 +-
docs/service-discovery.md | 2 +-
docs/utilities.md | 2 +-
7 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/docs/async-details.md b/docs/async-details.md
index 085d9e9..13f037a 100644
--- a/docs/async-details.md
+++ b/docs/async-details.md
@@ -124,7 +124,6 @@ async.create()
.getData()
.forPath(actualPath)
.thenApply(() -> watchTriggered()));
-
```
### AsyncStage canonical usage
diff --git a/docs/recipes-curator-cache.md b/docs/recipes-curator-cache.md
index 2faf2b9..c4255c8 100644
--- a/docs/recipes-curator-cache.md
+++ b/docs/recipes-curator-cache.md
@@ -27,7 +27,7 @@ A utility that attempts to keep the data from a node locally cached. Optionally
// client - the client
// path - path to watch
// options - empty or one or more options
-CuratorCache.build(CuratorFramework client, String path, Options... options);
+CuratorCache build(CuratorFramework client, String path, Options... options);
```
There is a builder factory available for additional options when building the cache instance. See `CuratorCacheBuilder` for details.
diff --git a/docs/recipes-path-cache.md b/docs/recipes-path-cache.md
index 074decf..75d55d9 100644
--- a/docs/recipes-path-cache.md
+++ b/docs/recipes-path-cache.md
@@ -17,7 +17,7 @@ A Path Cache is used to watch a ZNode. Whenever a child is added, updated or rem
## Creating a PathChildrenCache
-```
+```java
// Parameters:
// client - the client
// path - path to watch
diff --git a/docs/recipes-shared-counter.md b/docs/recipes-shared-counter.md
index 7bf8f6e..16e5826 100644
--- a/docs/recipes-shared-counter.md
+++ b/docs/recipes-shared-counter.md
@@ -43,17 +43,17 @@ count.close();
int getCount();
```
-```
+```java
// Add a listener for changes to the count
void addListener(SharedCountListener listener);
```
-```
+```java
// Change the shared count value irrespective of its previous state
public void setCount(int newCount);
```
-```
+```java
// Changes the shared count only if its value has not changed since this client last read it. If the count
// has changed, the value is not set and this client's view of the value is updated. i.e. if the count is
// not successful you can get the updated value by calling getCount().
diff --git a/docs/recipes-shared-semaphore.md b/docs/recipes-shared-semaphore.md
index b782fcc..347d282 100644
--- a/docs/recipes-shared-semaphore.md
+++ b/docs/recipes-shared-semaphore.md
@@ -52,7 +52,7 @@ To acquire one lease/usage, use one of the acquire methods:
```java
// 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.
+// 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.
public Lease acquire();
```
diff --git a/docs/service-discovery.md b/docs/service-discovery.md
index 026cedb..9a655a0 100644
--- a/docs/service-discovery.md
+++ b/docs/service-discovery.md
@@ -40,9 +40,9 @@ ServiceProviders are allocated by using a `ServiceProviderBuilder`. You obtain a
The ServiceProvider must be started by calling `start()`. When finished you should call `close()`. The only method in ServiceProvider is:
```java
-public ServiceInstance<T> getInstance() throws Exception;
// Return an instance for a single use. IMPORTANT: users should not hold on to the instance
// returned. A fresh instance should always be retrieved.
+public ServiceInstance<T> getInstance() throws Exception;
```
:::note
diff --git a/docs/utilities.md b/docs/utilities.md
index 4347e8a..5a5d653 100644
--- a/docs/utilities.md
+++ b/docs/utilities.md
@@ -41,7 +41,7 @@ CuratorFramework client = CuratorFrameworkFactory.builder()
Curator's Locker uses Java 7's try-with-resources feature to making using Curator locks safer:
```java
-InterProcessMutex mutex = new InterProcessMutex(...) // or any InterProcessLock
+InterProcessMutex mutex = new InterProcessMutex(...); // or any InterProcessLock
try (Locker locker = new Locker(mutex, maxTimeout, unit)) {
// do work
}