net.tomp2p.p2p
Class RoutingConfiguration
java.lang.Object
net.tomp2p.p2p.RoutingConfiguration
public class RoutingConfiguration
- extends Object
|
Constructor Summary |
RoutingConfiguration(int maxNoNewInfoDiff,
int maxFailures,
int parallel)
|
RoutingConfiguration(int maxNoNewInfoDiff,
int maxFailures,
int maxSuccess,
int parallel)
|
RoutingConfiguration(int directHits,
int maxNoNewInfoDiff,
int maxFailures,
int maxSuccess,
int parallel)
|
RoutingConfiguration(int directHits,
int maxNoNewInfoDiff,
int maxFailures,
int maxSuccess,
int parallel,
boolean forceTCP)
Sets the routing configuration and its stop conditions. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RoutingConfiguration
public RoutingConfiguration(int maxNoNewInfoDiff,
int maxFailures,
int parallel)
RoutingConfiguration
public RoutingConfiguration(int maxNoNewInfoDiff,
int maxFailures,
int maxSuccess,
int parallel)
RoutingConfiguration
public RoutingConfiguration(int directHits,
int maxNoNewInfoDiff,
int maxFailures,
int maxSuccess,
int parallel)
RoutingConfiguration
public RoutingConfiguration(int directHits,
int maxNoNewInfoDiff,
int maxFailures,
int maxSuccess,
int parallel,
boolean forceTCP)
- Sets the routing configuration and its stop conditions.
- Parameters:
directHits - Number of direct hits (d): This is used for fetching data. If d peers have been contacted that have
the data stored, routing stops.maxNoNewInfoDiff - Number of no new information (n): This is mainly used for storing data. It searches the closest peers
and if n peers do not report any closer nodes, the routing stops.maxFailures - Number of failures (f): The routing stops if f peers fail to respond.maxSuccess - Number of success (s): The routing stops if s peers respond.parallel - Number of parallel requests (p): This tells the routing how many peers to contact in parallel.forceTCP - Flag to indicate that routing should be done with TCP instead of UDP
getDirectHits
public int getDirectHits()
getMaxNoNewInfoDiff
public int getMaxNoNewInfoDiff()
- This returns the difference to the min value of P2P configuration. We need to have a difference, because we need
to search at least for min peers in the routing, as otherwise if we find the closest node by chance, then we
don't reach min.
- Returns:
getMaxNoNewInfo
public int getMaxNoNewInfo(int minimumResults)
getMaxFailures
public int getMaxFailures()
getMaxSuccess
public int getMaxSuccess()
getParallel
public int getParallel()
isForceTCP
public boolean isForceTCP()
- Returns:
- True if the routing should use TCP instead of the default UDP
Copyright © 2013. All Rights Reserved.