Package net.tomp2p.message

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


          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

                        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

      LOG.debug("handlePut {}", message);
        final PublicKey publicKey = message.publicKey(0);
        final DataMap toStore = message.dataMap(0);
        final int dataSize = toStore.size();
        final Map<Number640, Byte> result = new HashMap<Number640, Byte>(dataSize);
        for (Map.Entry<Number640, Data> entry : toStore.dataMap().entrySet()) {
            Enum<?> putStatus = doPut(putIfAbsent, protectDomain, publicKey, entry.getKey(), entry.getValue());
            result.put(entry.getKey(), (byte) putStatus.ordinal());
            // check the responsibility of the newly added data, do something
            // (notify) if we are responsible
            if (!entry.getValue().hasPrepareFlag()) {
View Full Code Here

    final PublicKey publicKey = message.publicKey(0);
    final DataMap toStore = message.dataMap(0);
    final int dataSize = toStore.size();
    final Map<Number640, Byte> result = new HashMap<Number640, Byte>(dataSize);
    LOG.debug("Received put confirmation.");
    for (Map.Entry<Number640, Data> entry : toStore.dataMap().entrySet()) {
      Enum<?> status = storageLayer.putConfirm(publicKey, entry.getKey(), entry.getValue());
      result.put(entry.getKey(), (byte) status.ordinal());
     
      if ((status == PutStatus.OK || status == PutStatus.VERSION_FORK)
              && replicationListener != null) {
View Full Code Here

        // here we set the map with the close peers. If we get data by a
        // sender and the sender is closer than us, we assume that the sender has
        // the data and we don't need to transfer data to the closest (sender)
        // peer.

        for (Map.Entry<Number640, Data> entry : dataMap.dataMap().entrySet()) {
            Enum<?> status = doAdd(protectDomain, entry, publicKey, list, storageLayer, peerBean().serverPeerAddress());
            result.put(entry.getKey(), (byte) status.ordinal());

            // check the responsibility of the newly added data, do something
            // (notify) if we are responsible
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.