| org.apache.catalina.tribes.tipis.AbstractReplicatedMap org.apache.catalina.tribes.tipis.ReplicatedMap
ReplicatedMap | public class ReplicatedMap extends AbstractReplicatedMap implements RpcCallback,ChannelListener,MembershipListener(Code) | | All-to-all replication for a hash map implementation. Each node in the cluster will carry an identical
copy of the map.
This map implementation doesn't have a background thread running to replicate changes.
If you do have changes without invoking put/remove then you need to invoke one of the following methods:
replicate(Object,boolean) - replicates only the object that belongs to the key
replicate(boolean) - Scans the entire map for changes and replicates data
the boolean 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.
REMBER TO CALL breakdown() or finalize() when you are done with the map to
avoid memory leaks.
author: Filip Hanik version: 1.0 |
Constructor Summary | |
public | ReplicatedMap(Object owner, Channel channel, long timeout, String mapContextName, int initialCapacity, float loadFactor, ClassLoader[] cls) | public | ReplicatedMap(Object owner, Channel channel, long timeout, String mapContextName, int initialCapacity, ClassLoader[] cls) | public | ReplicatedMap(Object owner, Channel channel, long timeout, String mapContextName, ClassLoader[] cls) |
ReplicatedMap | public ReplicatedMap(Object owner, Channel channel, long timeout, String mapContextName, int initialCapacity, float loadFactor, ClassLoader[] cls)(Code) | | Creates a new map
Parameters: channel - The channel to use for communication Parameters: timeout - long - timeout for RPC messags Parameters: mapContextName - String - unique name for this map, to allow multiple maps per channel Parameters: initialCapacity - int - the size of this map, see HashMap Parameters: loadFactor - float - load factor, see HashMap |
ReplicatedMap | public ReplicatedMap(Object owner, Channel channel, long timeout, String mapContextName, int initialCapacity, ClassLoader[] cls)(Code) | | Creates a new map
Parameters: channel - The channel to use for communication Parameters: timeout - long - timeout for RPC messags Parameters: mapContextName - String - unique name for this map, to allow multiple maps per channel Parameters: initialCapacity - int - the size of this map, see HashMap |
ReplicatedMap | public ReplicatedMap(Object owner, Channel channel, long timeout, String mapContextName, ClassLoader[] cls)(Code) | | Creates a new map
Parameters: channel - The channel to use for communication Parameters: timeout - long - timeout for RPC messags Parameters: mapContextName - String - unique name for this map, to allow multiple maps per channel |
getStateMessageType | protected int getStateMessageType()(Code) | | |
publishEntryInfo | protected Member[] publishEntryInfo(Object key, Object value) throws ChannelException(Code) | | publish info about a map pair (key/value) to other nodes in the cluster
Parameters: key - Object Parameters: value - Object Member - the backup node throws: ChannelException - |
Methods inherited from org.apache.catalina.tribes.tipis.AbstractReplicatedMap | public boolean accept(Serializable msg, Member sender)(Code)(Java Doc) public void breakdown()(Code)(Java Doc) protected void broadcast(int msgtype, boolean rpc) throws ChannelException(Code)(Java Doc) public void clear()(Code)(Java Doc) public void clear(boolean notify)(Code)(Java Doc) public Object clone()(Code)(Java Doc) public boolean containsKey(Object key)(Code)(Java Doc) public boolean containsValue(Object value)(Code)(Java Doc) public Set entrySet()(Code)(Java Doc) public Set entrySetFull()(Code)(Java Doc) public boolean equals(Object o)(Code)(Java Doc) public Member[] excludeFromSet(Member[] mbrs, Member[] set)(Code)(Java Doc) public void finalize()(Code)(Java Doc) public Object get(Object key)(Code)(Java Doc) public long getAccessTimeout()(Code)(Java Doc) public Channel getChannel()(Code)(Java Doc) public int getChannelSendOptions()(Code)(Java Doc) public ClassLoader[] getExternalLoaders()(Code)(Java Doc) public MapEntry getInternal(Object key)(Code)(Java Doc) public byte[] getMapContextName()(Code)(Java Doc) public Member[] getMapMembers(HashMap members)(Code)(Java Doc) public Member[] getMapMembers()(Code)(Java Doc) public Member[] getMapMembersExcl(Member[] exclude)(Code)(Java Doc) public Object getMapOwner()(Code)(Java Doc) public int getNextBackupIndex()(Code)(Java Doc) public Member getNextBackupNode()(Code)(Java Doc) public RpcChannel getRpcChannel()(Code)(Java Doc) public long getRpcTimeout()(Code)(Java Doc) abstract protected int getStateMessageType()(Code)(Java Doc) public Object getStateMutex()(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public void heartbeat()(Code)(Java Doc) public boolean inSet(Member m, Member[] set)(Code)(Java Doc) protected void init(Object owner, Channel channel, String mapContextName, long timeout, int channelSendOptions, ClassLoader[] cls)(Code)(Java Doc) public boolean isEmpty()(Code)(Java Doc) public boolean isStateTransferred()(Code)(Java Doc) public Set keySet()(Code)(Java Doc) public Set keySetFull()(Code)(Java Doc) public void leftOver(Serializable msg, Member sender)(Code)(Java Doc) public void mapMemberAdded(Member member)(Code)(Java Doc) public void memberAdded(Member member)(Code)(Java Doc) protected void memberAlive(Member member)(Code)(Java Doc) public void memberDisappeared(Member member)(Code)(Java Doc) public void messageReceived(Serializable msg, Member sender)(Code)(Java Doc) protected void ping(long timeout) throws ChannelException(Code)(Java Doc) protected void printMap(String header)(Code)(Java Doc) abstract protected Member[] publishEntryInfo(Object key, Object value) throws ChannelException(Code)(Java Doc) public Object put(Object key, Object value)(Code)(Java Doc) public Object put(Object key, Object value, boolean notify)(Code)(Java Doc) public void putAll(Map m)(Code)(Java Doc) public Object remove(Object key)(Code)(Java Doc) public Object remove(Object key, boolean notify)(Code)(Java Doc) protected boolean removeEldestEntry(Map.Entry eldest)(Code)(Java Doc) public void replicate(Object key, boolean complete)(Code)(Java Doc) public void replicate(boolean complete)(Code)(Java Doc) public Serializable replyRequest(Serializable msg, Member sender)(Code)(Java Doc) public void setAccessTimeout(long accessTimeout)(Code)(Java Doc) public void setChannelSendOptions(int channelSendOptions)(Code)(Java Doc) public void setExternalLoaders(ClassLoader[] externalLoaders)(Code)(Java Doc) public void setMapOwner(Object mapOwner)(Code)(Java Doc) public int size()(Code)(Java Doc) public int sizeFull()(Code)(Java Doc) public void transferState()(Code)(Java Doc) public Collection values()(Code)(Java Doc) protected Member[] wrap(Member m)(Code)(Java Doc)
|
|
|