Examples of dataMap()


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

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

        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

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

    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

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

       
        // 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

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

        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

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

            .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

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

            futureChannelCreator.addListener(new BaseFutureAdapter<FutureChannelCreator>() {
                @Override
                public void operationComplete(final FutureChannelCreator future) throws Exception {
                    if (future.isSuccess()) {
                        PutBuilder putBuilder = new PutBuilder(peer, locationKey);
                        putBuilder.dataMap(dataMap);
                        FutureResponse futureResponse = storageRPC.put(other, putBuilder,
                                future.channelCreator());
                        futureResponse.addListener(new BaseFutureAdapter<FutureResponse>() {
              @Override
              public void operationComplete(FutureResponse future)
View Full Code Here

Examples of net.tomp2p.message.DataMap.dataMap()

        final DataMap dataMap = message.dataMap(0);
        final PublicKey publicKey = message.publicKey(0);
        final List<Number640> retVal = new ArrayList<Number640>(dataMap.size());

        for (Map.Entry<Number640, Data> entry : dataMap.dataMap().entrySet()) {
            if (entry.getValue().isFlag2()) {
              LOG.debug("remove entry {}", entry.getKey());
              Pair<Data, Enum<?>> result = storageLayer.remove(entry.getKey(), publicKey, false);
                if (replicationListener != null && result.element1() == PutStatus.OK) {
                  replicationListener.dataRemoved(entry.getKey().locationKey());
View Full Code Here

Examples of net.tomp2p.message.DataMap.dataMap()

          result.put(key, (byte) status.ordinal());
        } else {
          dataSize = toStore.size();
            result = new HashMap<Number640, Byte>(dataSize);
          LOG.debug("received meta request to change entry");
          for (Map.Entry<Number640, Data> entry : toStore.dataMap().entrySet()) {
            entry.getValue().meta();
            Enum<?> status = storageLayer.updateMeta(publicKey, entry.getKey(), entry.getValue());
            result.put(entry.getKey(), (byte) status.ordinal());
          }
        }
View Full Code Here

Examples of net.tomp2p.message.DataMap.dataMap()

                        int dataCopy = 0;
                        int dataOrig = 0;
                        //int dataCopyCount = 0;
                        //int diffCount = 0;
                        //int dataNotCopied = 0;
                        for (Map.Entry<Number640, Data> entry : dataMap.dataMap().entrySet()) {
                         
                          Data data = entry.getValue();
                          if(data.length() == 0) {
                            if(data.isFlag1()) {
                              LOG.debug("no sync required");
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.