Examples of BSPCompressedBundle


Examples of org.apache.hama.bsp.message.compress.BSPCompressedBundle

          + " to transfer messages to!");
    } else {
      if (compressor != null
          && (bundle.getApproximateSize() > conf.getLong(
              "hama.messenger.compression.threshold", 1048576))) {
        BSPCompressedBundle compMsgBundle = compressor.compressBundle(bundle);
        bspPeerConnection.put(compMsgBundle);
        peer.incrementCounter(BSPPeerImpl.PeerCounter.COMPRESSED_MESSAGES, 1L);
      } else {
        bspPeerConnection.put(bundle);
      }
View Full Code Here

Examples of org.apache.hama.bsp.message.compress.BSPCompressedBundle

      DataInputStream in = new DataInputStream(inArray);
      msg.readFields(in);
    } else {
      peer.incrementCounter(BSPPeerImpl.PeerCounter.COMPRESSED_BYTES_RECEIVED,
          byteArray.length);
      msg = compressor.decompressBundle(new BSPCompressedBundle(byteArray));
    }

    return msg;
  }
View Full Code Here

Examples of org.apache.hama.bsp.message.compress.BSPCompressedBundle

      byte[] byteArray = outArray.toByteArray();
      peer.incrementCounter(BSPPeerImpl.PeerCounter.MESSAGE_BYTES_TRANSFERED,
          byteArray.length);
      return ByteBuffer.wrap(byteArray);
    } else {
      BSPCompressedBundle compMsgBundle = compressor.compressBundle(msg);
      byte[] data = compMsgBundle.getData();
      peer.incrementCounter(BSPPeerImpl.PeerCounter.COMPRESSED_BYTES_SENT,
          data.length);
      return ByteBuffer.wrap(data);
    }
  }
View Full Code Here

Examples of org.apache.hama.bsp.message.compress.BSPCompressedBundle

    } else {
      if (compressor != null
          && (bundle.getApproximateSize() > conf.getLong(
              "hama.messenger.compression.threshold", 1048576))) {
       
        BSPCompressedBundle compMsgBundle = compressor.compressBundle(bundle);
        bspPeerConnection.put(compMsgBundle);
        peer.incrementCounter(BSPPeerImpl.PeerCounter.COMPRESSED_MESSAGES, 1L);
      } else {
        bspPeerConnection.put(bundle);
      }
View Full Code Here

Examples of org.apache.hama.bsp.message.compress.BSPCompressedBundle

    if (bspPeerConnection == null) {
      throw new IllegalArgumentException("Can not find " + addr.toString()
          + " to transfer messages to!");
    } else {
      if (compressor != null) {
        BSPCompressedBundle compMsgBundle = compressor.compressBundle(bundle);
        if (CompressionUtil.getCompressionRatio(compMsgBundle, bundle) < 1.0) {
          bspPeerConnection.put(compMsgBundle);
        } else {
          bspPeerConnection.put(bundle);
        }
View Full Code Here

Examples of org.apache.hama.bsp.message.compress.BSPCompressedBundle

      DataInputStream in = new DataInputStream(inArray);
      msg.readFields(in);
    } else {
      peer.incrementCounter(BSPPeerImpl.PeerCounter.COMPRESSED_BYTES_RECEIVED,
          byteArray.length);
      msg = compressor.decompressBundle(new BSPCompressedBundle(byteArray));
    }

    return msg;
  }
View Full Code Here

Examples of org.apache.hama.bsp.message.compress.BSPCompressedBundle

      byte[] byteArray = outArray.toByteArray();
      peer.incrementCounter(BSPPeerImpl.PeerCounter.MESSAGE_BYTES_TRANSFERED,
          byteArray.length);
      return ByteBuffer.wrap(byteArray);
    } else {
      BSPCompressedBundle compMsgBundle = compressor.compressBundle(msg);
      byte[] data = compMsgBundle.getData();
      peer.incrementCounter(BSPPeerImpl.PeerCounter.COMPRESSED_BYTES_SENT,
          data.length);
      return ByteBuffer.wrap(data);
    }
  }
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.