org.infinispan.topology
Class CacheTopology

java.lang.Object
  extended by org.infinispan.topology.CacheTopology

public class CacheTopology
extends Object

The status of a cache from a distribution/state transfer point of view.

The pending CH can be null if we don't have a state transfer in progress.

The topologyId is incremented every time the topology changes (i.e. state transfer starts or ends). It is not modified when the consistent hashes are updated without requiring state transfer (e.g. when a member leaves).

Since:
5.2
Author:
Dan Berindei

Nested Class Summary
static class CacheTopology.Externalizer
           
 
Constructor Summary
CacheTopology(int topologyId, ConsistentHash currentCH, ConsistentHash pendingCH)
           
 
Method Summary
 boolean equals(Object o)
           
 ConsistentHash getCurrentCH()
          The current consistent hash.
 List<Address> getMembers()
           
 ConsistentHash getPendingCH()
          The future consistent hash.
 ConsistentHash getReadConsistentHash()
          Read operations should always go to the "current" members.
 int getTopologyId()
           
 ConsistentHash getWriteConsistentHash()
          When there is a rebalance in progress, write operations should go to the "pending" members.
 int hashCode()
           
 void logRoutingTableInformation()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheTopology

public CacheTopology(int topologyId,
                     ConsistentHash currentCH,
                     ConsistentHash pendingCH)
Method Detail

getTopologyId

public int getTopologyId()

getCurrentCH

public ConsistentHash getCurrentCH()
The current consistent hash.


getPendingCH

public ConsistentHash getPendingCH()
The future consistent hash. Should be null if there is no rebalance in progress.


getMembers

public List<Address> getMembers()

getReadConsistentHash

public ConsistentHash getReadConsistentHash()
Read operations should always go to the "current" members.


getWriteConsistentHash

public ConsistentHash getWriteConsistentHash()
When there is a rebalance in progress, write operations should go to the "pending" members. Note: The pending members always include the current members (unless there is no rebalance in progress).


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

logRoutingTableInformation

public final void logRoutingTableInformation()

-->

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.