public class DistributedQueue extends Object
| 构造器和说明 |
|---|
DistributedQueue(String dir) |
| 限定符和类型 | 方法和说明 |
|---|---|
byte[] |
element()
Return the head of the queue without modifying the queue.
|
boolean |
offer(byte[] data)
Inserts data into queue.
|
byte[] |
peek()
Returns the data at the first element of the queue, or null if the queue
is empty.
|
byte[] |
poll()
Attempts to remove the head of the queue and return it.
|
byte[] |
remove()
Attempts to remove the head of the queue and return it.
|
byte[] |
take()
Removes the head of the queue and returns it, blocks until it succeeds.
|
public DistributedQueue(String dir)
public byte[] element()
throws NoSuchElementException,
org.apache.zookeeper.KeeperException,
InterruptedException
NoSuchElementExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic byte[] remove()
throws NoSuchElementException,
org.apache.zookeeper.KeeperException,
InterruptedException
NoSuchElementExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic byte[] take()
throws org.apache.zookeeper.KeeperException,
InterruptedException
NoSuchElementExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic boolean offer(byte[] data)
throws org.apache.zookeeper.KeeperException,
InterruptedException
data - org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic byte[] peek()
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic byte[] poll()
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionCopyright © 2016. All rights reserved.