public class DistributedMap extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
dir |
protected static String |
PREFIX |
protected SolrZkClient |
zookeeper |
Constructor and Description |
---|
DistributedMap(SolrZkClient zookeeper,
String dir) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Helper method to clear all child nodes for a parent node.
|
boolean |
contains(String trackingId) |
byte[] |
get(String trackingId) |
Collection<String> |
keys()
Returns the keys of all the elements in the map
|
void |
put(String trackingId,
byte[] data) |
boolean |
putIfAbsent(String trackingId,
byte[] data)
Puts an element in the map only if there isn't one with the same trackingId already
|
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 final String dir
protected SolrZkClient zookeeper
protected static final String PREFIX
public DistributedMap(SolrZkClient zookeeper, String dir)
public void put(String trackingId, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public boolean putIfAbsent(String trackingId, byte[] data) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public byte[] get(String trackingId) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public boolean contains(String trackingId) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public int size() throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public boolean remove(String trackingId) throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public void clear() throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
public Collection<String> keys() throws org.apache.zookeeper.KeeperException, InterruptedException
org.apache.zookeeper.KeeperException
InterruptedException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.