Example usage for org.apache.hadoop.record RecordInput readInt

List of usage examples for org.apache.hadoop.record RecordInput readInt

Introduction

In this page you can find the example usage for org.apache.hadoop.record RecordInput readInt.

Prototype

int readInt(String tag) throws IOException;

Source Link

Document

Read an integer from serialized record.

Usage

From source file:crunch.MaxTemperature.java

License:Apache License

private void deserializeWithoutFilter(final org.apache.hadoop.record.RecordInput _rio_a, final String _rio_tag)
            throws java.io.IOException {
        _rio_a.startRecord(_rio_tag);/*w ww . j  ava  2s.  c o  m*/
        listeners = _rio_a.readInt("listeners");
        plays = _rio_a.readInt("plays");
        scrobbles = _rio_a.readInt("scrobbles");
        radioPlays = _rio_a.readInt("radioPlays");
        skips = _rio_a.readInt("skips");
        _rio_a.endRecord(_rio_tag);
    }

From source file:crunch.MaxTemperature.java

License:Apache License

public void deserialize(final org.apache.hadoop.record.RecordInput _rio_a, final String _rio_tag)
            throws java.io.IOException {
        if (null == _rio_rtiFilter) {
            deserializeWithoutFilter(_rio_a, _rio_tag);
            return;
        }//  ww w.j  a v a 2  s. co m
        // if we're here, we need to read based on version info
        _rio_a.startRecord(_rio_tag);
        setupRtiFields();
        for (int _rio_i = 0; _rio_i < _rio_rtiFilter.getFieldTypeInfos().size(); _rio_i++) {
            if (1 == _rio_rtiFilterFields[_rio_i]) {
                listeners = _rio_a.readInt("listeners");
            } else if (2 == _rio_rtiFilterFields[_rio_i]) {
                plays = _rio_a.readInt("plays");
            } else if (3 == _rio_rtiFilterFields[_rio_i]) {
                scrobbles = _rio_a.readInt("scrobbles");
            } else if (4 == _rio_rtiFilterFields[_rio_i]) {
                radioPlays = _rio_a.readInt("radioPlays");
            } else if (5 == _rio_rtiFilterFields[_rio_i]) {
                skips = _rio_a.readInt("skips");
            } else {
                java.util.ArrayList<org.apache.hadoop.record.meta.FieldTypeInfo> typeInfos = (java.util.ArrayList<org.apache.hadoop.record.meta.FieldTypeInfo>) (_rio_rtiFilter
                        .getFieldTypeInfos());
                org.apache.hadoop.record.meta.Utils.skip(_rio_a, typeInfos.get(_rio_i).getFieldID(),
                        typeInfos.get(_rio_i).getTypeID());
            }
        }
        _rio_a.endRecord(_rio_tag);
    }

From source file:net.thecubic.mockbi.MockBISummaryKey.java

License:Apache License

@Override
public void deserialize(RecordInput ri, String ctx) throws IOException {
    ri.startRecord(ctx);// w w  w. java2s . c o  m
    timeSeriesBin = new Date(ri.readLong("timeSeriesBin") * 1000L);
    timeSeriesInterval = new Long(ri.readLong("timeSeriesInterval") * 1000L);
    binLevel = ri.readInt("binLevel");
    //analysisParams = new LinkedHashMap<String,String>();
    for (Index ad_idx = ri.startMap("analysisParams"); !ad_idx.done(); ad_idx.incr()) {
        analysisParams.put(ri.readString("key"), ri.readString("value"));
    }
    ri.endMap("analysisParams");
    ri.endRecord(ctx);
}