Example usage for org.apache.hadoop.record RecordOutput endRecord

List of usage examples for org.apache.hadoop.record RecordOutput endRecord

Introduction

In this page you can find the example usage for org.apache.hadoop.record RecordOutput endRecord.

Prototype

public void endRecord(Record r, String tag) throws IOException;

Source Link

Document

Mark the end of a serialized record.

Usage

From source file:com.nexr.data.sdp.rolling.hdfs.LogRecordJT.java

License:Apache License

public void serialize(final org.apache.hadoop.record.RecordOutput _rio_a, final String _rio_tag)
        throws java.io.IOException {
    _rio_a.startRecord(this, _rio_tag);
    _rio_a.writeLong(time, "time");
    {//from w w  w  .  j  av  a2s. com
        _rio_a.startMap(mapFields, "mapFields");
        java.util.Set<java.util.Map.Entry<String, org.apache.hadoop.record.Buffer>> _rio_es1 = mapFields
                .entrySet();
        for (java.util.Iterator<java.util.Map.Entry<String, org.apache.hadoop.record.Buffer>> _rio_midx1 = _rio_es1
                .iterator(); _rio_midx1.hasNext();) {
            java.util.Map.Entry<String, org.apache.hadoop.record.Buffer> _rio_me1 = _rio_midx1.next();
            String _rio_k1 = _rio_me1.getKey();
            org.apache.hadoop.record.Buffer _rio_v1 = _rio_me1.getValue();
            _rio_a.writeString(_rio_k1, "_rio_k1");
            _rio_a.writeBuffer(_rio_v1, "_rio_v1");
        }
        _rio_a.endMap(mapFields, "mapFields");
    }
    _rio_a.endRecord(this, _rio_tag);
}

From source file:crunch.MaxTemperature.java

License:Apache License

public void serialize(final org.apache.hadoop.record.RecordOutput _rio_a, final String _rio_tag)
            throws java.io.IOException {
        _rio_a.startRecord(this, _rio_tag);
        _rio_a.writeInt(listeners, "listeners");
        _rio_a.writeInt(plays, "plays");
        _rio_a.writeInt(scrobbles, "scrobbles");
        _rio_a.writeInt(radioPlays, "radioPlays");
        _rio_a.writeInt(skips, "skips");
        _rio_a.endRecord(this, _rio_tag);
    }/*  w  ww .  j  ava2 s.  c o  m*/

From source file:fm.last.darling.io.records.NSpacePoint.java

License:Apache License

public void serialize(final org.apache.hadoop.record.RecordOutput _rio_a, final String _rio_tag)
        throws java.io.IOException {
    _rio_a.startRecord(this, _rio_tag);
    _rio_a.writeLong(timestamp, "timestamp");
    {/*from   w  ww  .  ja va2 s . c  o m*/
        _rio_a.startMap(dimensions, "dimensions");
        java.util.Set<java.util.Map.Entry<String, String>> _rio_es1 = dimensions.entrySet();
        for (java.util.Iterator<java.util.Map.Entry<String, String>> _rio_midx1 = _rio_es1
                .iterator(); _rio_midx1.hasNext();) {
            java.util.Map.Entry<String, String> _rio_me1 = _rio_midx1.next();
            String _rio_k1 = _rio_me1.getKey();
            String _rio_v1 = _rio_me1.getValue();
            _rio_a.writeString(_rio_k1, "_rio_k1");
            _rio_a.writeString(_rio_v1, "_rio_v1");
        }
        _rio_a.endMap(dimensions, "dimensions");
    }
    _rio_a.writeString(unit, "unit");
    _rio_a.endRecord(this, _rio_tag);
}

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

License:Apache License

@Override
public void serialize(RecordOutput ro, String ctx) throws IOException {
    ro.startRecord(this, ctx);
    ro.writeLong(timeSeriesBin.getTime() / 1000L, "timeSeriesBin");
    ro.writeLong(timeSeriesInterval.longValue() / 1000L, "timeSeriesInterval");
    ro.writeInt(binLevel, "binLevel");
    // HADOOP-7889
    TreeMap<String, String> tempmap = new TreeMap<String, String>();
    for (String key : analysisParams.keySet()) {
        tempmap.put(key, analysisParams.get(key));
    }//from   w  w w .j  a va  2s.  c o m
    ro.startMap(tempmap, "analysisParams");
    for (String key : analysisParams.keySet()) {
        ro.writeString(key, "key");
        ro.writeString(analysisParams.get(key), "value");
    }
    ro.endMap(tempmap, "analysisParams");
    ro.endRecord(this, ctx);
}