Package net.tomp2p.p2p

Examples of net.tomp2p.p2p.RoutingConfiguration


  public void testConsistency() throws Exception {
    Random rnd = new Random(42);
    PeerDHT peers [] = UtilsReplication.createNodes(11, rnd, 4000, null);
    UtilsReplication.perfectRouting(peers);
   
    RoutingConfiguration r = new RoutingConfiguration(6, 10, 2);
    RequestP2PConfiguration p = new RequestP2PConfiguration(6, 10, 0);
    FuturePut fp = peers[5].put(Number160.MAX_VALUE).routingConfiguration(r).requestP2PConfiguration(p).data(new Data("test")).start();
    fp.awaitUninterruptibly();
    //now it is stored on 6 peers: 0, 1 , 2, 4, 5, 8
    for(PeerDHT p1:peers) {
View Full Code Here


    public void preBuild(String name) {
        if (domainKey == null) {
            domainKey = DEFAULT_DOMAIN;
        }
        if (routingConfiguration == null) {
            routingConfiguration = new RoutingConfiguration(5, 10, 2);
        }
        if (trackerConfiguration == null) {
            int size = peer.peerMap().size() + 1;
            trackerConfiguration = new TrackerConfiguration(Math.min(size, 3), 5, 3, 30);
        }
View Full Code Here

      // wait for maintenance to kick in
      Thread.sleep(4000);

      printMapStatus(unreachablePeer, peers);

      RoutingConfiguration r = new RoutingConfiguration(5, 1, 1);
      RequestP2PConfiguration rp = new RequestP2PConfiguration(1, 1, 0);

      System.err.println("Unreachable: " + unreachablePeer.peerID());
      System.err.println("Relay: " + master.peerID());
View Full Code Here

      Thread.sleep(6000);

      printMapStatus(unreachablePeer1, peers);
      printMapStatus(unreachablePeer2, peers);

      RoutingConfiguration r = new RoutingConfiguration(5, 1, 1);
      RequestP2PConfiguration rp = new RequestP2PConfiguration(1, 1, 0);

      System.err.println(unreachablePeer1.peerID()); // f1
      System.err.println(unreachablePeer2.peerID()); // e7
View Full Code Here

       Thread.sleep(4000);
            
             printMapStatus(unreachablePeer1, peers);
             printMapStatus(unreachablePeer2, peers);
            
             RoutingConfiguration r = new RoutingConfiguration(5, 1, 1);
             RequestP2PConfiguration rp = new RequestP2PConfiguration(1, 1, 0);
            
             System.err.println(unreachablePeer1.peerID()); //f1
             System.err.println(unreachablePeer2.peerID()); //e7
            
View Full Code Here

TOP

Related Classes of net.tomp2p.p2p.RoutingConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.