Package net.tomp2p.p2p

Examples of net.tomp2p.p2p.VotingSchemeTracker


     *
     * @param futureCreate
     *            Keeps track of futures that are based on this future
     */
    public FutureTracker(FutureCreate<BaseFuture> futureCreate) {
        this(new VotingSchemeTracker(), null, futureCreate);
    }
View Full Code Here


     *            summarize them
     * @param knownPeers
     *            A set of know peers that we don't want in the result set.
     */
    public FutureTracker(EvaluatingSchemeTracker evaluatingSchemeTracker, Set<Number160> knownPeers) {
        this(new VotingSchemeTracker(), knownPeers, null);
    }
View Full Code Here

            Assert.assertEquals(true, ft.isSuccess());
            Thread.sleep(2000);
            tc = new TrackerConfiguration(1, 1, 0, 1);
            ft = nodes[301].getTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc)
                    .evaluatingScheme(new VotingSchemeTracker()).start();
            ft.awaitUninterruptibly();
            System.err.println(ft.failedReason());
            Assert.assertEquals(true, ft.isSuccess());
            Assert.assertEquals(1, ft.rawPeersOnTracker().size());
        } finally {
View Full Code Here

            //myself and an other
            Assert.assertEquals(2, ft.directTrackers().size());
            tc = new TrackerConfiguration(1, 1, 1, 3, 1000, 2);
            ft = nodes[301].getTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc)
                    .evaluatingScheme(new VotingSchemeTracker()).start();
            ft.awaitUninterruptibly();
            System.err.println(ft.failedReason());
            Assert.assertEquals(true, ft.isSuccess());
            Assert.assertEquals(1, ft.rawPeersOnTracker().size());
            Assert.assertEquals(1, ft.directTrackers().size());
View Full Code Here

            Assert.assertEquals(true, ft.isSuccess());
            Assert.assertEquals(2, ft.directTrackers().size());
            tc = new TrackerConfiguration(1, 1, 2, 3, 1000, 2);
            ft = nodes[301].getTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc)
                    .evaluatingScheme(new VotingSchemeTracker()).start();
            ft.awaitUninterruptibly();
            Assert.assertEquals(true, ft.isSuccess());
            Assert.assertEquals(2, ft.rawPeersOnTracker().size());
            Assert.assertEquals(1, ft.potentialTrackers().size());
            Assert.assertEquals(2, ft.directTrackers().size());
View Full Code Here

            Assert.assertEquals(true, ft.isSuccess());
            Assert.assertEquals(2, ft.directTrackers().size());
            tc = new TrackerConfiguration(1, 1, 2, 2);
            ft = nodes[299].getTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc)
                    .evaluatingScheme(new VotingSchemeTracker()).start();
            ft.awaitUninterruptibly();
            Assert.assertEquals(true, ft.isSuccess());
            // we return there 2 because we use bloomfilters to not return
            // already known peers
            Assert.assertEquals(2, ft.rawPeersOnTracker().size());
View Full Code Here

                // || ft.getDirectTrackers().size() == 3);
            }
            tc = new TrackerConfiguration(1, 1, 30, 301, 0, 20);
            FutureTracker ft1 = nodes[299].getTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc)
                    .evaluatingScheme(new VotingSchemeTracker()).start();
            ft1.awaitUninterruptibly();
            Assert.assertEquals(true, ft1.isSuccess());
            for (TrackerData pa : ft1.trackers()) {
                for (PeerStatistic pas : pa.peerAddresses().keySet()) {
                    System.err.println("found on DHT1: " + pas.peerAddress().peerId());
                    tmp.remove(pas.peerAddress().peerId());
                }
            }
            // ctg.setUseSecondaryTrackers(true);
            FutureTracker ft2 = nodes[299].getTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc)
                    .evaluatingScheme(new VotingSchemeTracker()).knownPeers(ft1.knownPeers())
                    .start();
            ft2.awaitUninterruptibly();
            System.err.println("Reason: " + ft2.failedReason());
            Assert.assertEquals(true, ft2.isSuccess());
            for (TrackerData pa : ft2.trackers()) {
View Full Code Here

TOP

Related Classes of net.tomp2p.p2p.VotingSchemeTracker

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.