Example usage for org.apache.hadoop.io ObjectWritable readObject

List of usage examples for org.apache.hadoop.io ObjectWritable readObject

Introduction

In this page you can find the example usage for org.apache.hadoop.io ObjectWritable readObject.

Prototype

public static Object readObject(DataInput in, Configuration conf) throws IOException 

Source Link

Document

Read a Writable , String , primitive type, or an array of the preceding.

Usage

From source file:org.apache.gora.filter.MapFieldValueFilter.java

License:Apache License

@Override
public void readFields(DataInput in) throws IOException {
    fieldName = Text.readString(in);
    mapKey = new Utf8(Text.readString(in));
    filterOp = WritableUtils.readEnum(in, FilterOp.class);
    operands.clear();/*  www  . j a v a 2  s .  c o m*/
    int operandsSize = WritableUtils.readVInt(in);
    for (int i = 0; i < operandsSize; i++) {
        Object operand = ObjectWritable.readObject(in, conf);
        if (operand instanceof String) {
            operand = new Utf8((String) operand);
        }
        operands.add(operand);
    }
    filterIfMissing = in.readBoolean();
}

From source file:org.apache.gora.filter.SingleFieldValueFilter.java

License:Apache License

@Override
public void readFields(DataInput in) throws IOException {
    fieldName = Text.readString(in);
    filterOp = WritableUtils.readEnum(in, FilterOp.class);
    operands.clear();/*  ww  w. j a  v  a2 s  .  c o m*/
    int operandsSize = WritableUtils.readVInt(in);
    for (int i = 0; i < operandsSize; i++) {
        Object operand = ObjectWritable.readObject(in, conf);
        if (operand instanceof String) {
            operand = new Utf8((String) operand);
        }
        operands.add(operand);
    }
    filterIfMissing = in.readBoolean();
}