Example usage for org.apache.hadoop.io ByteWritable toString

List of usage examples for org.apache.hadoop.io ByteWritable toString

Introduction

In this page you can find the example usage for org.apache.hadoop.io ByteWritable toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:co.nubetech.hiho.dedup.HashUtility.java

License:Apache License

public static MD5Hash getMD5Hash(ByteWritable key) throws IOException {
    return MD5Hash.digest(key.toString());
}

From source file:com.ibm.bi.dml.runtime.matrix.mapred.CSVAssignRowIDReducer.java

License:Open Source License

@Override
@SuppressWarnings("unchecked")
public void reduce(ByteWritable key, Iterator<OffsetCount> values,
        OutputCollector<ByteWritable, OffsetCount> out, Reporter report) throws IOException {
    //need to sort the values by filename and fileoffset
    while (values.hasNext())
        list.add(new OffsetCount(values.next()));
    Collections.sort(list);// w w w .  ja  v  a2s  . c  o  m

    long lineOffset = 0;
    for (OffsetCount oc : list) {
        long count = oc.count;
        oc.count = lineOffset;
        out.collect(key, oc);
        lineOffset += count;
    }
    report.incrCounter(CSVReblockMR.NUM_ROWS_IN_MATRIX, key.toString(), lineOffset);
    list.clear();
}