public class DistributedMap extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
DistributedMap.LatchChildWatcher |
static class |
DistributedMap.MapEvent |
| Modifier and Type | Field and Description |
|---|---|
protected static long |
DEFAULT_TIMEOUT |
protected String |
dir |
protected String |
prefix |
protected String |
response_prefix |
protected SolrZkClient |
zookeeper |
| Constructor and Description |
|---|
DistributedMap(SolrZkClient zookeeper,
String dir,
List<org.apache.zookeeper.data.ACL> acl) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Helper method to clear all child nodes for a parent node.
|
boolean |
contains(String trackingId) |
protected String |
createData(String path,
byte[] data,
org.apache.zookeeper.CreateMode mode)
Inserts data into zookeeper.
|
DistributedMap.MapEvent |
get(String trackingId) |
boolean |
put(String trackingId,
byte[] data) |
DistributedMap.MapEvent |
put(String trackingId,
byte[] data,
long timeout)
Offer the data and wait for the response
|
boolean |
remove(String trackingId)
return true if the znode was successfully deleted
false if the node didn't exist and therefore not deleted
exception an exception occurred while deleting
|
int |
size() |
protected static long DEFAULT_TIMEOUT
protected final String dir
protected SolrZkClient zookeeper
protected final String prefix
protected final String response_prefix
public DistributedMap(SolrZkClient zookeeper, String dir, List<org.apache.zookeeper.data.ACL> acl)
protected String createData(String path, byte[] data, org.apache.zookeeper.CreateMode mode) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic boolean put(String trackingId, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic DistributedMap.MapEvent put(String trackingId, byte[] data, long timeout) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic DistributedMap.MapEvent get(String trackingId) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic boolean contains(String trackingId) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic int size()
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic boolean remove(String trackingId) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void clear()
throws org.apache.zookeeper.KeeperException,
InterruptedException
org.apache.zookeeper.KeeperExceptionInterruptedExceptionCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.