Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureTracker.awaitUninterruptibly()


            // FutureTracker ft = nodes[300].addToTracker(trackerID, "test",
            // null, rc, tc);
            PeerTracker closest = findClosest(nodes, trackerID);
            FutureTracker ft = nodes[300].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
            ft.awaitUninterruptibly();
            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)
View Full Code Here


            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 {
            if (master != null) {
View Full Code Here

            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();
            ft.awaitUninterruptibly();
            Assert.assertEquals(true, ft.isSuccess());
            //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"))
View Full Code Here

            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());
            Assert.assertEquals(2, ft.potentialTrackers().size());
View Full Code Here

            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();
            ft.awaitUninterruptibly();
            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)
View Full Code Here

            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

            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();
            System.err.println("add the peer to the tracker: " + nodes[300].peerAddress());
            ft.awaitUninterruptibly();
            ft = nodes[301].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
            System.err.println("add the peer to the tracker: " + nodes[301].peerAddress());
            ft.awaitUninterruptibly();
            ft = nodes[302].addTracker(trackerID).domainKey(Number160.createHash("test"))
View Full Code Here

            System.err.println("add the peer to the tracker: " + nodes[300].peerAddress());
            ft.awaitUninterruptibly();
            ft = nodes[301].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
            System.err.println("add the peer to the tracker: " + nodes[301].peerAddress());
            ft.awaitUninterruptibly();
            ft = nodes[302].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
            System.err.println("add the peer to the tracker: " + nodes[302].peerAddress());
            ft.awaitUninterruptibly();
            Assert.assertEquals(true, ft.isSuccess());
View Full Code Here

            System.err.println("add the peer to the tracker: " + nodes[301].peerAddress());
            ft.awaitUninterruptibly();
            ft = nodes[302].addTracker(trackerID).domainKey(Number160.createHash("test"))
                    .routingConfiguration(rc).trackerConfiguration(tc).start();
            System.err.println("add the peer to the tracker: " + nodes[302].peerAddress());
            ft.awaitUninterruptibly();
            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)
View Full Code Here

            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());
            // but here we expect 3 peers, since 3 peers are on the tracker
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.