예제 #1
0
 @Override
 public void notifyDataRehashed(
     ConsistentHash oldCH, ConsistentHash newCH, int newTopologyId, boolean pre) {
   if (!dataRehashedListeners.isEmpty()) {
     EventImpl<Object, Object> e = EventImpl.createEvent(cache, DATA_REHASHED);
     e.setPre(pre);
     e.setConsistentHashAtStart(oldCH);
     e.setConsistentHashAtEnd(newCH);
     e.setNewTopologyId(newTopologyId);
     for (ListenerInvocation listener : dataRehashedListeners) listener.invoke(e);
   }
 }
예제 #2
0
 @Override
 public void notifyTopologyChanged(
     ConsistentHash oldConsistentHash,
     ConsistentHash newConsistentHash,
     int newTopologyId,
     boolean pre) {
   if (!topologyChangedListeners.isEmpty()) {
     EventImpl<Object, Object> e = EventImpl.createEvent(cache, TOPOLOGY_CHANGED);
     e.setPre(pre);
     e.setConsistentHashAtStart(oldConsistentHash);
     e.setConsistentHashAtEnd(newConsistentHash);
     e.setNewTopologyId(newTopologyId);
     for (ListenerInvocation listener : topologyChangedListeners) listener.invoke(e);
   }
 }