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

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

Introduction

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

Prototype

public void endMap(TreeMap m, String tag) throws IOException;

Source Link

Document

Mark the end of a serialized map.

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");
    {/*  w  w  w . j  ava2 s. c  o  m*/
        _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: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");
    {//  www.j  ava  2s  .  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));
    }/*w  w  w.jav  a  2s  .  com*/
    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);
}