Package net.tomp2p.futures

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


            getBuilder.domainKey(Number160.createHash("test"));
            getBuilder.keyBloomFilter(sbf);
            getBuilder.versionKey(Number160.ZERO);

            fr = smmSender.digest(recv1.peerAddress(), getBuilder, cc);
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            Message m = fr.responseMessage();
            Assert.assertEquals(2, m.keyMap640Keys(0).size());

        } finally {
View Full Code Here


            putBuilder.dataMapContent(tmp);
            putBuilder.idleTCPSeconds(Integer.MAX_VALUE);
            putBuilder.versionKey(Number160.ZERO);

            FutureResponse fr = smmSender.put(recv1.peerAddress(), putBuilder, cc);
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            Data data = recv1.storageLayer()
                    .get(new Number640(new Number160(33), Number160.createHash("test"), new Number160(77), Number160.ZERO));
            Assert.assertEquals(true, data != null);
View Full Code Here

            putBuilder.idleTCPSeconds(Integer.MAX_VALUE);
            putBuilder.versionKey(Number160.ZERO);

            FutureResponse fr = smmSender.put(recv1.peerAddress(), putBuilder, cc);

            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            //

            GetBuilder getBuilder = new GetBuilder(recv1, new Number160(33));
            getBuilder.domainKey(Number160.createHash("test"));
View Full Code Here

            getBuilder.idleTCPSeconds(Integer.MAX_VALUE);
            getBuilder.versionKey(Number160.ZERO);

            fr = smmSender.get(recv1.peerAddress(), getBuilder, cc);

            fr.awaitUninterruptibly();
            System.err.println(fr.failedReason());
            Assert.assertEquals(true, fr.isSuccess());
            Number640 key = new Number640(new Number160(33), Number160.createHash("test"), new Number160(77), Number160.ZERO);
            Assert.assertEquals(50 * 1024 * 1024, fr.responseMessage().dataMap(0).dataMap().get(key)
                    .length());
View Full Code Here

            putBuilder.dataMapContent(tmp);
            putBuilder.idleTCPSeconds(Integer.MAX_VALUE);
            putBuilder.versionKey(Number160.ZERO);

            FutureResponse fr = smmSender.put(recv1.peerAddress(), putBuilder, cc);
            fr.awaitUninterruptibly();
            System.err.println("XX:" + fr.failedReason());
            Assert.assertEquals(true, fr.isSuccess());
            //
            GetBuilder getBuilder = new GetBuilder(recv1, new Number160(33));
            getBuilder.domainKey(Number160.createHash("test"));
View Full Code Here

      FutureChannelCreator fcc = master.peer().connectionBean().reservation().create(0, 1);
            fcc.awaitUninterruptibly();
            cc = fcc.channelCreator();
     
      FutureResponse fr = master.storeRPC().put(slave.peerAddress(), pb, cc);
      fr.awaitUninterruptibly();
      Assert.assertEquals(true, fr.isSuccess());
     
      GetBuilder gb = master.get(new Number160("0x51")).domainKey(Number160.ZERO);

      fr = master.storeRPC().get(slave.peerAddress(), gb, cc);
View Full Code Here

      Assert.assertEquals(true, fr.isSuccess());
     
      GetBuilder gb = master.get(new Number160("0x51")).domainKey(Number160.ZERO);

      fr = master.storeRPC().get(slave.peerAddress(), gb, cc);
      fr.awaitUninterruptibly();
      Assert.assertEquals(true, fr.isSuccess());

      System.err.println("done");
     
     
View Full Code Here

            SearchValues v = new SearchValues(new Number160("0x1"), null);
            FutureResponse fr = neighbors2.closeNeighbors(sender.peerAddress(), v,
                    Type.REQUEST_2, cc, new DefaultConnectionConfiguration());

            fr.awaitUninterruptibly();
            // Thread.sleep(10000000);
            Assert.assertEquals(true, fr.isSuccess());
            NeighborSet pas = fr.responseMessage().neighborsSet(0);
            // we are able to fit 40 neighbors into 1400 bytes
            Assert.assertEquals(33, pas.size());
View Full Code Here

            DefaultConnectionConfiguration d = new DefaultConnectionConfiguration();
            d.forceTCP();
            FutureResponse fr = neighbors2.closeNeighbors(sender.peerAddress(), v,
                    Type.REQUEST_2, cc, d);

            fr.awaitUninterruptibly();
            System.err.println(fr.failedReason());
            // Thread.sleep(10000000);
            Assert.assertEquals(true, fr.isSuccess());
            NeighborSet pas = fr.responseMessage().neighborsSet(0);
            // we are able to fit 40 neighbors into 1400 bytes
View Full Code Here

            ChannelCreator cc = fcc.channelCreator();

            SearchValues v = new SearchValues(new Number160("0x30"), null);
            FutureResponse fr = neighbors2.closeNeighbors(sender.peerAddress(), v,
                    Type.REQUEST_2, cc, new DefaultConnectionConfiguration());
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            NeighborSet pas = fr.responseMessage().neighborsSet(0);

            // I see no one, not evenmyself. My peer was added in the overflow map
            Assert.assertEquals(0, pas.size());
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.