Examples of futureRequests()


Examples of net.tomp2p.dht.FuturePut.futureRequests()

            }
            //store data, the two peers do not know each other
            Data data = new Data("Test");
            FuturePut futureDHT = master.put(Number160.createHash("2")).data(data).start();
            futureDHT.awaitUninterruptibly();
            futureDHT.futureRequests().awaitUninterruptibly();
            //now, do the routing, so that each peers know each other. The content should be moved
            Assert.assertEquals(false, peers[1].storageLayer().contains(new Number640(Number160.createHash("2"), Number160.ZERO, Number160.ZERO, Number160.ZERO)));
            Utils2.perfectRouting(peers);
            //we should see now the forward replication
            Thread.sleep(1000);
View Full Code Here

Examples of net.tomp2p.dht.FuturePut.futureRequests()

            System.err.println("closest to " + locationKey + " is " + closest);
            // store
            Data data = new Data("Test");
            FuturePut futureDHT = master.put(locationKey).data(data).start();
            futureDHT.awaitUninterruptibly();
            futureDHT.futureRequests().awaitUninterruptibly();
            Assert.assertEquals(true, futureDHT.isSuccess());
            List<FutureBootstrap> tmp2 = new ArrayList<FutureBootstrap>();
            Utils2.perfectRouting(peers);
            //for (int i = 0; i < peers.length; i++) {
            //    if (peers[i] != master) {
View Full Code Here

Examples of net.tomp2p.dht.FuturePut.futureRequests()

      PeerMapConfiguration pmc = new PeerMapConfiguration(Number160.createHash(rnd.nextInt()));
      slave = new PeerBuilderDHT(new PeerBuilder(Number160.ONE).peerMap(new PeerMap(pmc)).ports(13337).start())
          .start();
      printMapStatus(slave, peers);
      FuturePut futurePut = peers[8].put(slave.peerID()).data(new Data("hello")).start().awaitUninterruptibly();
      futurePut.futureRequests().awaitUninterruptibly();
      Assert.assertTrue(futurePut.isSuccess());
      Assert.assertFalse(slave.storageLayer().contains(
          new Number640(slave.peerID(), Number160.ZERO, Number160.ZERO, Number160.ZERO)));
      System.err.println("DONE!");
    } finally {
View Full Code Here

Examples of net.tomp2p.dht.FuturePut.futureRequests()

      printMapStatus(unreachablePeer, peers);

      FuturePut futurePut = peers[8].put(unreachablePeer.peerID()).data(new Data("hello")).start()
          .awaitUninterruptibly();
      // the relayed one is the slowest, so we need to wait for it!
      futurePut.futureRequests().awaitUninterruptibly();
      System.err.println(futurePut.failedReason());

      Assert.assertTrue(futurePut.isSuccess());
      // we cannot see the peer in futurePut.rawResult, as the relayed is the slowest and we finish
      // earlier than that.
View Full Code Here

Examples of net.tomp2p.dht.FuturePut.futureRequests()

      System.err.println("Relay: " + master.peerID());

      FuturePut futurePut = peers[8].put(unreachablePeer.peerID()).data(new Data("hello")).routingConfiguration(r)
          .requestP2PConfiguration(rp).start().awaitUninterruptibly();
      // the relayed one is the slowest, so we need to wait for it!
      futurePut.futureRequests().awaitUninterruptibly();
      System.err.println(futurePut.failedReason());

      Assert.assertTrue(futurePut.isSuccess());
      Assert.assertTrue(unreachablePeer.storageLayer().contains(
          new Number640(unreachablePeer.peerID(), Number160.ZERO, Number160.ZERO, Number160.ZERO)));
View Full Code Here

Examples of net.tomp2p.dht.FuturePut.futureRequests()

      System.err.println(unreachablePeer2.peerID()); // e7

      FuturePut futurePut = unreachablePeer1.put(unreachablePeer2.peerID()).data(new Data("hello"))
          .routingConfiguration(r).requestP2PConfiguration(rp).start().awaitUninterruptibly();
      // the relayed one is the slowest, so we need to wait for it!
      futurePut.futureRequests().awaitUninterruptibly();
      System.err.println(futurePut.failedReason());

      Assert.assertTrue(futurePut.isSuccess());
      Assert.assertTrue(unreachablePeer2.storageLayer().contains(
          new Number640(unreachablePeer2.peerID(), Number160.ZERO, Number160.ZERO, Number160.ZERO)));
View Full Code Here

Examples of net.tomp2p.dht.FuturePut.futureRequests()

             System.err.println(unreachablePeer2.peerID()); //e7
            
             FuturePut futurePut = unreachablePeer1.put(unreachablePeer2.peerID()).data(new Data("hello")).sign().routingConfiguration(r).requestP2PConfiguration(rp).start().awaitUninterruptibly();
             //the relayed one is the slowest, so we need to wait for it!
             futurePut.awaitUninterruptibly();
             futurePut.futureRequests().awaitUninterruptibly();
             System.err.println(futurePut.failedReason());
            
             Assert.assertTrue(futurePut.isSuccess());
             Assert.assertTrue(unreachablePeer2.storageLayer().contains(new Number640(unreachablePeer2.peerID(), Number160.ZERO, Number160.ZERO, Number160.ZERO)));
            
View Full Code Here

Examples of net.tomp2p.dht.FuturePut.futureRequests()

        // put test data (prepare)
        FuturePut fput = peers[rnd.nextInt(10)].put(locationKey)
            .data(contentKey, sortedMap.get(vKey)).domainKey(domainKey).versionKey(vKey).start();
        fput.awaitUninterruptibly();
        fput.futureRequests().awaitUninterruptibly();
        fput.futureRequests().awaitListenersUninterruptibly();
        Assert.assertEquals(true, fput.isSuccess());

        // confirm put
        FuturePut futurePutConfirm = peers[rnd.nextInt(10)].put(locationKey).domainKey(domainKey)
View Full Code Here

Examples of net.tomp2p.dht.FuturePut.futureRequests()

        // put test data (prepare)
        FuturePut fput = peers[rnd.nextInt(10)].put(locationKey)
            .data(contentKey, sortedMap.get(vKey)).domainKey(domainKey).versionKey(vKey).start();
        fput.awaitUninterruptibly();
        fput.futureRequests().awaitUninterruptibly();
        fput.futureRequests().awaitListenersUninterruptibly();
        Assert.assertEquals(true, fput.isSuccess());

        // confirm put
        FuturePut futurePutConfirm = peers[rnd.nextInt(10)].put(locationKey).domainKey(domainKey)
            .data(contentKey, new Data()).versionKey(vKey).putConfirm().start();
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.