Package net.tomp2p.futures

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


            putBuilder.dataMapContent(tmp);
            putBuilder.forceUDP();
            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"));
            getBuilder.contentKeys(tmp.keySet());
View Full Code Here


            getBuilder.forceUDP();
            getBuilder.versionKey(Number160.ZERO);

            // get
            fr = smmSender.get(recv1.peerAddress(), getBuilder, cc);
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            Message m = fr.responseMessage();
            Map<Number640, Data> stored = m.dataMap(0).dataMap();
            compare(dataMap.convertToMap640(), stored);
        } finally {
View Full Code Here

           
            putBuilder.dataMapContent(tmp);
            putBuilder.versionKey(Number160.ZERO);

            FutureResponse fr = smmSender.put(recv1.peerAddress(), putBuilder, cc);
            fr.awaitUninterruptibly();
            // remove
            RemoveBuilder removeBuilder = new RemoveBuilder(recv1, new Number160(33));
            removeBuilder.domainKey(Number160.createHash("test"));
            removeBuilder.contentKeys(tmp.keySet());
            removeBuilder.returnResults();
View Full Code Here

            removeBuilder.domainKey(Number160.createHash("test"));
            removeBuilder.contentKeys(tmp.keySet());
            removeBuilder.returnResults();
            removeBuilder.versionKey(Number160.ZERO);
            fr = smmSender.remove(recv1.peerAddress(), removeBuilder, cc);
            fr.awaitUninterruptibly();
            Message m = fr.responseMessage();
            Assert.assertEquals(true, fr.isSuccess());

            // check for returned results
            Map<Number640, Data> stored = m.dataMap(0).dataMap();
View Full Code Here

            getBuilder.domainKey(Number160.createHash("test"));
            getBuilder.contentKeys(tmp.keySet());
            getBuilder.versionKey(Number160.ZERO);

            fr = smmSender.get(recv1.peerAddress(), getBuilder, cc);
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            m = fr.responseMessage();
            DataMap stored2 = m.dataMap(0);
            Assert.assertEquals(0, stored2.size());
        } finally {
View Full Code Here

            DataMap dataMap = new DataMap(new Number160(33), Number160.createHash("test"), Number160.ZERO, tmp);
            putBuilder.dataMapContent(tmp);
            putBuilder.versionKey(Number160.ZERO);

            FutureResponse fr = smmSender.put(recv1.peerAddress(), putBuilder, cc);
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            KeyMapByte keys = fr.responseMessage().keyMapByte(0);
            Utils.isSameSets(keys.keysMap().keySet(), dataMap.convertToMap640().keySet());

        } finally {
View Full Code Here

                    FutureResponse fr = store(sender, recv1, smmSender, cc);
                    res.add(fr);
                }
                // cc1.release();
                for (FutureResponse fr : res) {
                    fr.awaitUninterruptibly();
                    if (!fr.isSuccess()) {
                        System.err.println("failed: " + fr.failedReason());
                    }
                    Assert.assertEquals(true, fr.isSuccess());
                }
View Full Code Here

            putBuilder.domainKey(Number160.createHash("test"));
            putBuilder.dataMapContent(tmp);
            putBuilder.versionKey(Number160.ZERO);

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

            SimpleBloomFilter<Number160> sbf = new SimpleBloomFilter<Number160>(100, 1);
            sbf.add(new Number160(77));

            // get
View Full Code Here

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

            fr = smmSender.get(recv1.peerAddress(), getBuilder, cc);
            fr.awaitUninterruptibly();
            Assert.assertEquals(true, fr.isSuccess());
            Message m = fr.responseMessage();
            Map<Number640, Data> stored = m.dataMap(0).dataMap();
            Assert.assertEquals(1, stored.size());
        } finally {
View Full Code Here

            putBuilder.domainKey(Number160.createHash("test"));
            putBuilder.dataMapContent(tmp);
            putBuilder.versionKey(Number160.ZERO);

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

            SimpleBloomFilter<Number160> sbf = new SimpleBloomFilter<Number160>(100, 2);
            sbf.add(new Number160(77));
            sbf.add(new Number160(99));
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.