K
- The type of KeyV
- The type of Valuepublic class ReplicatedMap<K,V> extends AbstractReplicatedMap<K,V>
replicate(Object,boolean)
- replicates only the object that belongs to the keyreplicate(boolean)
- Scans the entire map for changes and replicates databoolean
value in the replicate
method used to decide
whether to only replicate objects that implement the ReplicatedMapEntry
interface
or to replicate all objects. If an object doesn't implement the ReplicatedMapEntry
interface
each time the object gets replicated the entire object gets serialized, hence a call to replicate(true)
will replicate all objects in this map that are using this node as primary.
breakdown()
or finalize()
when you are done with the map to avoid memory leaks.AbstractReplicatedMap.MapEntry<K,V>, AbstractReplicatedMap.MapMessage, AbstractReplicatedMap.MapOwner
accessTimeout, channel, channelSendOptions, currentNode, DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, externalLoaders, innerMap, mapContextName, mapMembers, mapname, mapOwner, rpcChannel, rpcTimeout, sm, stateMutex, stateTransferred
Constructor and Description |
---|
ReplicatedMap(AbstractReplicatedMap.MapOwner owner,
Channel channel,
long timeout,
String mapContextName,
ClassLoader[] cls)
Creates a new map
|
ReplicatedMap(AbstractReplicatedMap.MapOwner owner,
Channel channel,
long timeout,
String mapContextName,
ClassLoader[] cls,
boolean terminate)
Creates a new map
|
ReplicatedMap(AbstractReplicatedMap.MapOwner owner,
Channel channel,
long timeout,
String mapContextName,
int initialCapacity,
ClassLoader[] cls)
Creates a new map
|
ReplicatedMap(AbstractReplicatedMap.MapOwner owner,
Channel channel,
long timeout,
String mapContextName,
int initialCapacity,
float loadFactor,
ClassLoader[] cls)
Creates a new map
|
Modifier and Type | Method and Description |
---|---|
protected int |
getReplicateMessageType() |
protected int |
getStateMessageType() |
void |
mapMemberAdded(Member member) |
void |
memberDisappeared(Member member)
A member was removed from the group
If the member left voluntarily, the Member.getCommand will contain the Member.SHUTDOWN_PAYLOAD data |
protected Member[] |
publishEntryInfo(Object key,
Object value)
publish info about a map pair (key/value) to other nodes in the cluster
|
accept, breakdown, broadcast, clear, clear, containsKey, containsValue, entrySet, entrySetFull, equals, excludeFromSet, finalize, get, getAccessTimeout, getChannel, getChannelSendOptions, getExternalLoaders, getInternal, getMapContextName, getMapMembers, getMapMembers, getMapMembersExcl, getMapOwner, getNextBackupIndex, getNextBackupNode, getRpcChannel, getRpcTimeout, getStateMutex, hashCode, heartbeat, init, inSet, isEmpty, isStateTransferred, keySet, keySetFull, leftOver, memberAdded, memberAlive, messageReceived, ping, printMap, put, put, putAll, remove, remove, replicate, replicate, replyRequest, setAccessTimeout, setChannelSendOptions, setExternalLoaders, setMapOwner, size, sizeFull, transferState, values, wrap
public ReplicatedMap(AbstractReplicatedMap.MapOwner owner, Channel channel, long timeout, String mapContextName, int initialCapacity, float loadFactor, ClassLoader[] cls)
owner
- The map ownerchannel
- The channel to use for communicationtimeout
- long - timeout for RPC messagesmapContextName
- String - unique name for this map, to allow multiple maps per channelinitialCapacity
- int - the size of this map, see HashMaploadFactor
- float - load factor, see HashMapcls
- Class loaderspublic ReplicatedMap(AbstractReplicatedMap.MapOwner owner, Channel channel, long timeout, String mapContextName, int initialCapacity, ClassLoader[] cls)
owner
- The map ownerchannel
- The channel to use for communicationtimeout
- long - timeout for RPC messagesmapContextName
- String - unique name for this map, to allow multiple maps per channelinitialCapacity
- int - the size of this map, see HashMapcls
- Class loaderspublic ReplicatedMap(AbstractReplicatedMap.MapOwner owner, Channel channel, long timeout, String mapContextName, ClassLoader[] cls)
owner
- The map ownerchannel
- The channel to use for communicationtimeout
- long - timeout for RPC messagesmapContextName
- String - unique name for this map, to allow multiple maps per channelcls
- Class loaderspublic ReplicatedMap(AbstractReplicatedMap.MapOwner owner, Channel channel, long timeout, String mapContextName, ClassLoader[] cls, boolean terminate)
owner
- The map ownerchannel
- The channel to use for communicationtimeout
- long - timeout for RPC messagesmapContextName
- String - unique name for this map, to allow multiple maps per channelcls
- Class loadersterminate
- boolean - Flag for whether to terminate this map that failed to start.protected int getStateMessageType()
getStateMessageType
in class AbstractReplicatedMap<K,V>
protected int getReplicateMessageType()
getReplicateMessageType
in class AbstractReplicatedMap<K,V>
protected Member[] publishEntryInfo(Object key, Object value) throws ChannelException
publishEntryInfo
in class AbstractReplicatedMap<K,V>
key
- Objectvalue
- ObjectChannelException
- Cluster errorpublic void memberDisappeared(Member member)
MembershipListener
memberDisappeared
in interface MembershipListener
memberDisappeared
in class AbstractReplicatedMap<K,V>
member
- MemberMember.SHUTDOWN_PAYLOAD
public void mapMemberAdded(Member member)
mapMemberAdded
in class AbstractReplicatedMap<K,V>
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.