jgroup.relacs.mss
Class RoutingTable

java.lang.Object
  extended by jgroup.relacs.mss.RoutingTable
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, MssConstants

public final class RoutingTable
extends java.lang.Object
implements MssConstants, java.io.Externalizable

The RoutingTable class

Since:
Jgroup 1.2
Author:
Salvatore Cammarata, Hein Meling
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface jgroup.relacs.mss.MssConstants
ALL, EHANDLER_PRIORITY, HEADER_SIZE, MINIMUM_ALIVE_VALUE, MSS_HEADER_SIZE, MSSUSER_PRIORITY, NACKSUPPRESSION, NI_PRIORITY, OVERHEAD_SIZE, ROUTING_ENABLED, TRAILER_SIZE, UNDEF, UNREACHABLE
 
Constructor Summary
RoutingTable()
          Default constructor for externalization
RoutingTable(jgroup.relacs.mss.ClusterTable ct, int threshold)
           
 
Method Summary
 int getMarshalSize()
          Returns the number of bytes required to marshal this routing table instance.
static int getMaxSize(int numOfHosts, int numOfClusters)
          Returns the maximum number of bytes required to marshal a routing table instance, when the reachability set includes all hosts in the system.
 void readExternal(java.io.ObjectInput in)
          Restores the content of this object from the marshalled data contained in the specified input stream.
 void splitHorizonOff()
          Reverts all negative routing costs to positive.
 void splitHorizonOn(EndPoint key)
          Negate the cost as reverse poison
 java.lang.String toString()
          Returns a string representation of this object
 boolean updateReachability()
          Updates the reachability information for all clusters in the clustertable.
 void writeExternal(java.io.ObjectOutput out)
          Marshals the content of this object to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoutingTable

public RoutingTable()
Default constructor for externalization


RoutingTable

public RoutingTable(jgroup.relacs.mss.ClusterTable ct,
                    int threshold)
Method Detail

getMarshalSize

public int getMarshalSize()
Returns the number of bytes required to marshal this routing table instance.


getMaxSize

public static int getMaxSize(int numOfHosts,
                             int numOfClusters)
Returns the maximum number of bytes required to marshal a routing table instance, when the reachability set includes all hosts in the system.


updateReachability

public boolean updateReachability()
Updates the reachability information for all clusters in the clustertable.

Returns:
true if the reachability information in the routing table was changed as a consequence of this invocation; false otherwise.

splitHorizonOn

public void splitHorizonOn(EndPoint key)
Negate the cost as reverse poison


splitHorizonOff

public void splitHorizonOff()
Reverts all negative routing costs to positive.


readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Restores the content of this object from the marshalled data contained in the specified input stream.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - the stream to be read
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Marshals the content of this object to the specified output stream.

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - the stream to be written
Throws:
java.io.IOException

toString

public java.lang.String toString()
Returns a string representation of this object

Overrides:
toString in class java.lang.Object


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.