-
Notifications
You must be signed in to change notification settings - Fork 434
Simple Distributed Queue
Randgalt edited this page Oct 1, 2012
·
3 revisions
- IMPORTANT – We recommend that you do NOT use ZooKeeper for Queues. Please see Tech Note 4 for details.
A drop-in replacement for the DistributedQueue that comes with the ZK distribution.
- SimpleDistributedQueue
Creating a SimpleDistributedQueue
public SimpleDistributedQueue(CuratorFramework client,
String path)
Parameters:
client - the client
path - path to store queue nodes
Add to the queue
public boolean offer(byte[] data)
throws Exception
Inserts data into queue.
Parameters:
data - the data
Returns:
true if data was successfully added
Take from the queue
public byte[] take()
throws Exception
Removes the head of the queue and returns it, blocks until it succeeds.
Returns:
The former head of the queue
NOTE: see the Javadoc for additional methods
- Curator
- Javadoc
- Coverage Report
- Getting Started
- Examples
- FAQ
- Client
- Framework
-
Recipes
- Leader Latch
- Leader Election
- Shared Reentrant Lock
- Shared Lock
- Shared Reentrant Read Write Lock
- Shared Semaphore
- Multi Shared Lock
- Distributed Queue
- Distributed Id Queue
- Distributed Priority Queue
- Distributed Delay Queue
- Simple Distributed Queue
- Barrier
- Double Barrier
- Shared counter
- Distributed Atomic Long
- Path Cache
- Node Cache
- Utilities – Test Server, Test Cluster, ZKPaths, EnsurePath, QueueSharder, Reaper, ChildReaper
- Tech Notes
- Errors
- Exhibitor Integration
- Extensions
- Logging and Tracing