Examples of MD5Hash


Examples of org.apache.hadoop.io.MD5Hash

  }

  @Test
  public void testMD5HashForBytesWritableKey() throws IOException {
    BytesWritable key = new BytesWritable("abc123".getBytes());
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

  }

  @Test
  public void testMD5HashForIntWritableKey() throws IOException {
    IntWritable key = new IntWritable(123);
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

  }

  @Test
  public void testMD5HashForArrayWritableKey() throws IOException {
    ArrayWritable key = new ArrayWritable(new String[] { "abc123" });
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

  }

  @Test
  public void testMD5HashForBooleanWritableKey() throws IOException {
    BooleanWritable key = new BooleanWritable(true);
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

  }

  @Test
  public void testMD5HashForFloatWritableKey() throws IOException {
    FloatWritable key = new FloatWritable(1.025f);
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

  }

  @Test
  public void testMD5HashForByteWritableKey() throws IOException {
    ByteWritable key = new ByteWritable(new Byte("123"));
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

  }

  @Test
  public void testMD5HashForDoubleWritableKey() throws IOException {
    DoubleWritable key = new DoubleWritable(123d);
    MD5Hash md5HashKey1 = HashUtility.getMD5Hash(key);
    MD5Hash md5HashKey2 = HashUtility.getMD5Hash(key);
    assertEquals(md5HashKey1, md5HashKey2);
  }
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

  }

  @Test
  public void testSetMD5Hash() throws IOException {
    Text key = new Text("abc123");
    MD5Hash hash = HashUtility.getMD5Hash(key);
    HihoTuple hihoTuple = new HihoTuple();
    hihoTuple.setHash(hash);
    assertEquals(hash, hihoTuple.getHash());
  }
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

  }

  @Override
  public void readFields(DataInput in) throws IOException {
    logger.debug("Reading fields");
    hash = new MD5Hash();
    hash.readFields(in);
    keyClass = new Text();
    keyClass.readFields(in);
    try {
      logger.debug("Key class in readField() of HihoTuple class is :"
View Full Code Here

Examples of org.apache.hadoop.io.MD5Hash

      final int bytesPerCRC = checksum.getBytesPerChecksum();
      final long crcPerBlock = (metadataIn.getLength()
          - BlockMetadataHeader.getHeaderSize())/checksum.getChecksumSize();
     
      //compute block checksum
      final MD5Hash md5 = MD5Hash.digest(checksumIn);

      if (LOG.isDebugEnabled()) {
        LOG.debug("block=" + block + ", bytesPerCRC=" + bytesPerCRC
            + ", crcPerBlock=" + crcPerBlock + ", md5=" + md5);
      }

      //write reply
      out.writeShort(DataTransferProtocol.OP_STATUS_SUCCESS);
      out.writeInt(bytesPerCRC);
      out.writeLong(crcPerBlock);
      md5.write(out);
      out.flush();
    } finally {
      IOUtils.closeStream(out);
      IOUtils.closeStream(checksumIn);
      IOUtils.closeStream(metadataIn);
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.