Package net.tomp2p.p2p

Examples of net.tomp2p.p2p.RoutingConfiguration


        }
        if (dataMap == null) {
            dataMap = EMPTY_MAP;
        }
        if (routingConfiguration == null) {
            routingConfiguration = new RoutingConfiguration(3, 5, 10, 2);
        }
        if (requestP2PConfiguration == null) {
            requestP2PConfiguration = new RequestP2PConfiguration(1, 0, 1);
        }
        if (futureChannelCreator == null) {
View Full Code Here


        }
        if (versionKey == null) {
            versionKey = Number160.ZERO;
        }
        if (routingConfiguration == null) {
            routingConfiguration = new RoutingConfiguration(5, 10, 2);
        }
        if (requestP2PConfiguration == null) {
            requestP2PConfiguration = new RequestP2PConfiguration(3, 5, 3);
        }
        int size = peer.peer().peerBean().peerMap().size() + 1;
View Full Code Here

    this.peerDHT = peerDHT;
    this.avgSleepTime = avgSleepTime;
    this.avgBytes = avgBytes;
    this.random = new Random();
    this.validKeys = new ArrayList<Number160>();
    this.routingConfig = new RoutingConfiguration(5, 1, 1);
    this.requestConfig = new RequestP2PConfiguration(1, 1, 0);
    this.putStats = new DHTQueryStatistics();
    this.getStats = new DHTQueryStatistics();
    this.rmvStats = new DHTQueryStatistics();
  }
View Full Code Here

            // perfect routing
            for (int i = 0; i < nodes.length; i++) {
                for (int j = 0; j < nodes.length; j++)
                    nodes[i].peer().peerBean().peerMap().peerFound(nodes[j].peerAddress(), null, null);
            }
            RoutingConfiguration rc = new RoutingConfiguration(0, 1, 1);
            TrackerConfiguration tc = new TrackerConfiguration(1, 1, 1, 0);
            Number160 trackerID = new Number160(rnd);
            System.err.println("about to store " + trackerID);
            // FutureTracker ft = nodes[300].addToTracker(trackerID, "test",
            // null, rc, tc);
View Full Code Here

            // perfect routing
            for (int i = 0; i < nodes.length; i++) {
                for (int j = 0; j < nodes.length; j++)
                    nodes[i].peer().peerBean().peerMap().peerFound(nodes[j].peerAddress(), null, null);
            }
            RoutingConfiguration rc = new RoutingConfiguration(1, 1, 1);
            TrackerConfiguration tc = new TrackerConfiguration(1, 1, 2, 0, 1000, 2);
            Number160 trackerID = new Number160(rnd);
            System.err.println("about to store " + trackerID);
            FutureTracker ft = nodes[300].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
View Full Code Here

            // perfect routing
            for (int i = 0; i < nodes.length; i++) {
                for (int j = 0; j < nodes.length; j++)
                    nodes[i].peer().peerBean().peerMap().peerFound(nodes[j].peerAddress(), null, null);
            }
            RoutingConfiguration rc = new RoutingConfiguration(1, 1, 1);
            TrackerConfiguration tc = new TrackerConfiguration(1, 1, 2, 0, 1000, 2);
            Number160 trackerID = new Number160(rnd);
            System.err.println("about to store " + trackerID);
            FutureTracker ft = nodes[300].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
View Full Code Here

            // perfect routing
            for (int i = 0; i < nodes.length; i++) {
                for (int j = 0; j < nodes.length; j++)
                    nodes[i].peer().peerBean().peerMap().peerFound(nodes[j].peerAddress(), null, null);
            }
            RoutingConfiguration rc = new RoutingConfiguration(1, 1, 1);
            TrackerConfiguration tc = new TrackerConfiguration(1, 1, 2, 0);
            Number160 trackerID = new Number160(rnd);
            System.err.println("about to store " + trackerID);
            FutureTracker ft = nodes[300].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
View Full Code Here

                // nodes[i].getPeerBean().getTrackerStorage()
                // .setTrackerStoreSize(nodes[i].getPeerBean().getTrackerStorage().getTrackerSize());
                for (int j = 0; j < nodes.length; j++)
                    nodes[i].peer().peerBean().peerMap().peerFound(nodes[j].peerAddress(), null, null);
            }
            RoutingConfiguration rc = new RoutingConfiguration(1, 1, 1);
            // 3 is good!
            TrackerConfiguration tc = new TrackerConfiguration(1, 1, 20, 0, 20, 2);
            Number160 trackerID = new Number160(rnd);
            Set<Number160> tmp = new HashSet<Number160>();
            for (int i = 0; i <= 300; i++) {
View Full Code Here

      PeerDHT[] peers = UtilsDHT2.createNodes(2000, rnd, 4001);
      master = peers[0];
      UtilsDHT2.perfectRouting(peers);
      // do testing
      Data data = new Data(new byte[44444]);
      RoutingConfiguration rc = new RoutingConfiguration(2, 10, 2);
      RequestP2PConfiguration pc = new RequestP2PConfiguration(3, 5, 0);

      FuturePut fp = peers[444].put(peers[30].peerID())
              .data(Number160.createHash("test"), new Number160(5), data).requestP2PConfiguration(pc)
              .routingConfiguration(rc).start();
View Full Code Here

      PeerDHT[] peers = UtilsDHT2.createNodes(500, rnd, 4001);
      master = peers[0];
      UtilsDHT2.perfectRouting(peers);
      // do testing
      Data data = new Data(new byte[44444]);
      RoutingConfiguration rc = new RoutingConfiguration(0, 0, 1);
      RequestP2PConfiguration pc = new RequestP2PConfiguration(1, 0, 0);
      FuturePut fdht = peers[444].put(peers[30].peerID()).data(new Number160(5), data)
              .domainKey(Number160.createHash("test")).routingConfiguration(rc)
              .requestP2PConfiguration(pc).start();
      fdht.awaitUninterruptibly();
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.