|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.jas.util.DistHashTable
public class DistHashTable
Distributed version of a HashTable. Implemented with a SortedMap / TreeMap to keep the sequence order of elements.
Field Summary | |
---|---|
protected edu.unima.ky.parallel.ChannelFactory |
cf
|
protected edu.unima.ky.parallel.SocketChannel |
channel
|
protected DHTListener |
listener
|
protected java.util.SortedMap |
theList
|
Constructor Summary | |
---|---|
DistHashTable(edu.unima.ky.parallel.ChannelFactory cf,
java.lang.String host,
int port)
|
|
DistHashTable(edu.unima.ky.parallel.SocketChannel sc)
|
|
DistHashTable(java.lang.String host)
Constructs a new DistHashTable |
|
DistHashTable(java.lang.String host,
int port)
|
Method Summary | |
---|---|
void |
clear()
Clear the List caveat: must be called on all clients |
java.lang.Object |
get(java.lang.Object key)
Get value under key from DHT. |
java.util.ArrayList |
getArrayList()
Get the internal list, convert from Collection |
java.lang.Object |
getWait(java.lang.Object key)
Get value under key from DHT. |
boolean |
isEmpty()
Is the List empty? |
java.util.Iterator |
iterator()
List key iterator |
void |
put(java.lang.Object key,
java.lang.Object value)
Put object to the distributed hash table. |
void |
putWait(java.lang.Object key,
java.lang.Object value)
Put object to the distributed hash table. |
int |
size()
Size of the (local) list |
void |
terminate()
Terminate the list thread |
java.util.Iterator |
valueIterator()
List value iterator |
java.util.Collection |
values()
Get the internal list, do not convert from Collection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.SortedMap theList
protected final edu.unima.ky.parallel.ChannelFactory cf
protected edu.unima.ky.parallel.SocketChannel channel
protected DHTListener listener
Constructor Detail |
---|
public DistHashTable(java.lang.String host)
host
- Name or IP of server hostpublic DistHashTable(java.lang.String host, int port)
public DistHashTable(edu.unima.ky.parallel.ChannelFactory cf, java.lang.String host, int port)
public DistHashTable(edu.unima.ky.parallel.SocketChannel sc)
Method Detail |
---|
public java.util.Collection values()
public java.util.ArrayList getArrayList()
public int size()
public boolean isEmpty()
public java.util.Iterator iterator()
public java.util.Iterator valueIterator()
public void putWait(java.lang.Object key, java.lang.Object value)
public void put(java.lang.Object key, java.lang.Object value)
public java.lang.Object getWait(java.lang.Object key)
public java.lang.Object get(java.lang.Object key)
public void clear()
public void terminate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |