public class PartitionedHashMap<K,V> extends Object implements MembershipListener
Modifier and Type | Class and Description |
---|---|
static class |
PartitionedHashMap.ArrayBasedConsistentHashFunction<K>
Uses arrays to store hash values of addresses, plus addresses.
|
static class |
PartitionedHashMap.ConsistentHashFunction<K> |
static interface |
PartitionedHashMap.HashFunction<K> |
Modifier and Type | Field and Description |
---|---|
protected static Map<Short,Method> |
methods |
Constructor and Description |
---|
PartitionedHashMap(String props,
String cluster_name) |
Modifier and Type | Method and Description |
---|---|
Cache.Value<V> |
_get(K key) |
V |
_put(K key,
V val,
long caching_time) |
V |
_remove(K key) |
void |
addMembershipListener(MembershipListener l) |
void |
block()
Called (usually by the FLUSH protocol), as an indication that the member should stop sending messages.
|
String |
dump() |
V |
get(K key) |
long |
getCachingTime() |
long |
getCallTimeout() |
String |
getClusterName() |
PartitionedHashMap.HashFunction |
getHashFunction() |
Cache<K,V> |
getL1Cache() |
Cache<K,V> |
getL2Cache() |
Address |
getLocalAddress() |
String |
getLocalAddressAsString() |
String |
getProps() |
String |
getView() |
boolean |
isL1CacheEnabled() |
boolean |
isMigrateData() |
void |
put(K key,
V val) |
void |
put(K key,
V val,
long caching_time)
Adds a key/value to the cache, replacing a previous item if there was one
|
void |
remove(K key) |
void |
removeMembershipListener(MembershipListener l) |
void |
setCachingTime(long caching_time) |
void |
setCallTimeout(long call_timeout) |
void |
setClusterName(String cluster_name) |
void |
setHashFunction(PartitionedHashMap.HashFunction<K> hash_function) |
void |
setL1Cache(Cache<K,V> cache) |
void |
setL2Cache(Cache<K,V> cache) |
void |
setMigrateData(boolean migrate_data) |
void |
setProps(String props) |
void |
start() |
void |
stop() |
void |
suspect(Address suspected_mbr)
Called whenever a member is suspected of having crashed,
but has not yet been excluded.
|
String |
toString() |
void |
viewAccepted(View new_view)
Called when a change in membership has occurred.
|
public String getProps()
public void setProps(String props)
public Address getLocalAddress()
public String getLocalAddressAsString()
public String getView()
public boolean isL1CacheEnabled()
public String getClusterName()
public void setClusterName(String cluster_name)
public long getCallTimeout()
public void setCallTimeout(long call_timeout)
public long getCachingTime()
public void setCachingTime(long caching_time)
public boolean isMigrateData()
public void setMigrateData(boolean migrate_data)
public PartitionedHashMap.HashFunction getHashFunction()
public void setHashFunction(PartitionedHashMap.HashFunction<K> hash_function)
public void addMembershipListener(MembershipListener l)
public void removeMembershipListener(MembershipListener l)
public void stop()
public void put(K key, V val, long caching_time)
key
- The keyval
- The valuecaching_time
- Time to live. -1 means never cache, 0 means cache forever. All other (positive) values
are the number of milliseconds to cache the itempublic void remove(K key)
public Cache.Value<V> _get(K key)
public void viewAccepted(View new_view)
MembershipListener
Channel.connect(String)
returns.viewAccepted
in interface MembershipListener
public void suspect(Address suspected_mbr)
MembershipListener
suspect
in interface MembershipListener
public void block()
MembershipListener
ExtendedMembershipListener.unblock()
.
Note that block() is the equivalent of reception of a BlockEvent in the pull mode.block
in interface MembershipListener
public String dump()
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.