Registry / networking / curator-recipes

curator-recipes

JSON →
library5.9.0javamavenunverified

Apache Curator Recipes provides high-level implementations of common ZooKeeper recipes like leader election, distributed locks, and barriers.

<dependency> <groupId>org.apache.curator</groupId> <artifactId>curator-recipes</artifactId> <version>5.9.0</version> </dependency>
INSTALL
IMPORT
SIG · CURATOR-RECIPES
C
curator-recipes
networkingjavav5.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

InterProcessMutex
org.apache.curator.framework.recipes.locks.InterProcessMutex

Demonstrates using a distributed mutex lock with Curator.

import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.framework.recipes.locks.InterProcessMutex; public class Example { public static void main(String[] args) throws Exception { CuratorFramework client = CuratorFrameworkFactory.newClient("localhost:2181", new ExponentialBackoffRetry(1000, 3)); client.start(); InterProcessMutex lock = new InterProcessMutex(client, "/my/lock"); lock.acquire(); try { // critical section } finally { lock.release(); } client.close(); } }
Debug
Known issues
breakingCurator 5.x requires ZooKeeper 3.6.x or later; older ZooKeeper versions may cause compatibility issues.
fix
Ensure your ZooKeeper version is compatible with the Curator version you are using.
affects: >=5.0
Upgrade
Version history
5.9.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
curator-recipes — mvn dependency:get curator-recipes · libregistry