Example usage for org.apache.hadoop.io ShortWritable set

List of usage examples for org.apache.hadoop.io ShortWritable set

Introduction

In this page you can find the example usage for org.apache.hadoop.io ShortWritable set.

Prototype

public void set(short value) 

Source Link

Document

Set the value of this ShortWritable.

Usage

From source file:org.apache.orc.mapred.OrcMapredRecordReader.java

License:Apache License

static ShortWritable nextShort(ColumnVector vector, int row, Object previous) {
    if (vector.isRepeating) {
        row = 0;//  w ww.  ja v  a 2  s  .  c om
    }
    if (vector.noNulls || !vector.isNull[row]) {
        ShortWritable result;
        if (previous == null || previous.getClass() != ShortWritable.class) {
            result = new ShortWritable();
        } else {
            result = (ShortWritable) previous;
        }
        result.set((short) ((LongColumnVector) vector).vector[row]);
        return result;
    } else {
        return null;
    }
}