Package net.tomp2p.dht

Examples of net.tomp2p.dht.FutureGet.dataMap()


      System.out.println("peer started.");
      for (;;) {
        Thread.sleep(5000);
        FutureGet fg = peer.get(new Number160(keyStore)).all().start();
        fg.awaitUninterruptibly();
        int size = fg.dataMap().size();
        System.out.println("size " + size);
        Iterator<Data> iterator = fg.dataMap().values().iterator();
        while (iterator.hasNext()) {
          Data d = iterator.next();
          System.out.println("got: " + d.object().toString());
View Full Code Here


        Thread.sleep(5000);
        FutureGet fg = peer.get(new Number160(keyStore)).all().start();
        fg.awaitUninterruptibly();
        int size = fg.dataMap().size();
        System.out.println("size " + size);
        Iterator<Data> iterator = fg.dataMap().values().iterator();
        while (iterator.hasNext()) {
          Data d = iterator.next();
          System.out.println("got: " + d.object().toString());
        }
      }
View Full Code Here

    String inLine = null;
    while ((inLine = getLine()) != null) {
      if (inLine.equals("show")) {
        FutureGet fget = peer.get(new Number160(keyStore)).all().start();
        fget.awaitUninterruptibly();
        Iterator<Data> iterator = fget.dataMap().values().iterator();
        StringBuffer allString = new StringBuffer();
        FutureGet fg;
        while (iterator.hasNext()) {
          Data d = iterator.next();
          fg = peer.get(new Number160(((Integer) d.object()).intValue())).start();
View Full Code Here

       
        // get can also be used with ranges for content keys
        FutureGet futureGet2 = peers[peerGet].get(locationKey).from(from).to(to).start();
        futureGet2.awaitUninterruptibly();
        System.out.println("row fetch [" + rowKey1 + "]");
        for (Map.Entry<Number640, Data> entry : futureGet2.dataMap().entrySet()) {
            System.out.println("multi fetch: " + entry.getValue().object());
        }
        // column get
        String search = col1;
       
View Full Code Here

        to = new Number640(locationKey, Number160.ZERO, createNr(search, -1), Number160.MAX_VALUE);
       
        FutureGet futureGet3 = peers[peerGet].get(locationKey).from(from).to(to).start();
        futureGet3.awaitUninterruptibly();
        System.out.println("column fetch [" + search + "]");
        for (Map.Entry<Number640, Data> entry : futureGet3.dataMap().entrySet()) {
            System.out.println("multi fetch: " + entry.getValue().object());
        }
    }

    /**
 
View Full Code Here

            .contentKey(contentKey).getLatest().withDigest().start();
        fget.awaitUninterruptibly();
        Assert.assertTrue(fget.isSuccess());

        // check result
        Map<Number640, Data> dataMap = fget.dataMap();
        Assert.assertEquals(1, dataMap.size());
        Number480 key480 = new Number480(locationKey, domainKey, contentKey);

        Number640 key = new Number640(key480, vKey);
        Assert.assertTrue(dataMap.containsKey(key));
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.