public class PartitionedHashMap<K,V> extends java.lang.Object implements MembershipListener
限定符和类型 | 类和说明 |
---|---|
static class |
PartitionedHashMap.ConsistentHashFunction<K> |
static interface |
PartitionedHashMap.HashFunction<K> |
限定符和类型 | 字段和说明 |
---|---|
protected static java.util.Map<java.lang.Short,java.lang.reflect.Method> |
methods |
构造器和说明 |
---|
PartitionedHashMap(java.lang.String props,
java.lang.String cluster_name) |
限定符和类型 | 方法和说明 |
---|---|
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.
|
java.lang.String |
dump() |
V |
get(K key) |
long |
getCachingTime() |
long |
getCallTimeout() |
java.lang.String |
getClusterName() |
PartitionedHashMap.HashFunction |
getHashFunction() |
Cache<K,V> |
getL1Cache() |
Cache<K,V> |
getL2Cache() |
Address |
getLocalAddress() |
java.lang.String |
getLocalAddressAsString() |
java.lang.String |
getProps() |
java.lang.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(java.lang.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(java.lang.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.
|
java.lang.String |
toString() |
void |
unblock()
Called after the FLUSH protocol has unblocked previously blocked senders, and
messages can be sent again.
|
void |
viewAccepted(View new_view)
Called when a change in membership has occurred.
|
protected static final java.util.Map<java.lang.Short,java.lang.reflect.Method> methods
public PartitionedHashMap(java.lang.String props, java.lang.String cluster_name)
public java.lang.String getProps()
public void setProps(java.lang.String props)
public Address getLocalAddress()
public java.lang.String getLocalAddressAsString()
public java.lang.String getView()
public boolean isL1CacheEnabled()
public java.lang.String getClusterName()
public void setClusterName(java.lang.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 start() throws java.lang.Exception
java.lang.Exception
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
在接口中 MembershipListener
public void suspect(Address suspected_mbr)
MembershipListener
suspect
在接口中 MembershipListener
public void block()
MembershipListener
MembershipListener.unblock()
. Note that block() is the equivalent
of reception of a BlockEvent in the pull mode.block
在接口中 MembershipListener
public void unblock()
MembershipListener
Note that during new view installation we provide guarantee that unblock invocation strictly follows view installation at some node A belonging to that view . However, some other message M may squeeze in between view and unblock callbacks.
For more details see https://jira.jboss.org/jira/browse/JGRP-986
unblock
在接口中 MembershipListener
public java.lang.String toString()
toString
在类中 java.lang.Object
public java.lang.String dump()