Example usage for org.apache.hadoop.io Text writeString

List of usage examples for org.apache.hadoop.io Text writeString

Introduction

In this page you can find the example usage for org.apache.hadoop.io Text writeString.

Prototype

public static int writeString(DataOutput out, String s) throws IOException 

Source Link

Document

Write a UTF8 encoded string to out

Usage

From source file:com.yahoo.druid.hadoop.DruidInputSplit.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    Text.writeString(out, path);
}

From source file:com.yahoo.glimmer.indexing.generator.TermKey.java

License:Open Source License

public void write(DataOutput out) throws IOException {
    value.write(out);
    out.writeInt(index);
    Text.writeString(out, term);
}

From source file:cosmos.records.impl.MapRecord.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    Text.writeString(out, this.docId);

    byte[] cvBytes = this.docVisibility.flatten();
    WritableUtils.writeVInt(out, cvBytes.length);
    out.write(cvBytes);/*from   w  ww . j a  v  a 2s.c  o  m*/

    WritableUtils.writeVInt(out, this.document.size());
    for (Entry<Column, RecordValue<?>> entry : this.document.entrySet()) {
        entry.getKey().write(out);
        entry.getValue().write(out);
    }
}

From source file:cosmos.records.impl.MultimapRecord.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    Text.writeString(out, this.docId);

    byte[] cvBytes = this.docVisibility.getExpression();
    WritableUtils.writeVInt(out, cvBytes.length);
    out.write(cvBytes);/*from ww  w.  j  ava2  s.c om*/

    WritableUtils.writeVInt(out, this.document.size());
    for (Entry<Column, RecordValue<?>> entry : this.document.entries()) {
        entry.getKey().write(out);
        entry.getValue().write(out);
    }
}

From source file:cosmos.results.Column.java

License:Apache License

public void write(DataOutput out) throws IOException {
    Text.writeString(out, this.name);
}

From source file:crunch.MaxTemperature.java

License:Apache License

public void write(DataOutput __dataOut) throws IOException {
        if (null == this.id) {
            __dataOut.writeBoolean(true);
        } else {/*from   w w w . j  av a2s .  c o  m*/
            __dataOut.writeBoolean(false);
            __dataOut.writeInt(this.id);
        }
        if (null == this.widget_name) {
            __dataOut.writeBoolean(true);
        } else {
            __dataOut.writeBoolean(false);
            Text.writeString(__dataOut, widget_name);
        }
        if (null == this.price) {
            __dataOut.writeBoolean(true);
        } else {
            __dataOut.writeBoolean(false);
            com.cloudera.sqoop.lib.BigDecimalSerializer.write(this.price, __dataOut);
        }
        if (null == this.design_date) {
            __dataOut.writeBoolean(true);
        } else {
            __dataOut.writeBoolean(false);
            __dataOut.writeLong(this.design_date.getTime());
        }
        if (null == this.version) {
            __dataOut.writeBoolean(true);
        } else {
            __dataOut.writeBoolean(false);
            __dataOut.writeInt(this.version);
        }
        if (null == this.design_comment) {
            __dataOut.writeBoolean(true);
        } else {
            __dataOut.writeBoolean(false);
            Text.writeString(__dataOut, design_comment);
        }
    }

From source file:edu.iu.common.MultiFileSplit.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    out.writeInt(files.size());/*from  w ww  .  ja  va  2s. c om*/
    for (Path file : files) {
        Text.writeString(out, file.toString());
    }
    out.writeLong(length);
}

From source file:edu.uci.ics.hyracks.dataflow.hadoop.mapreduce.InputFileSplit.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    Text.writeString(out, file.toString());
    out.writeLong(start);//  ww  w .j a v  a2s  .  co  m
    out.writeLong(length);
    out.writeInt(blockId);
    out.writeLong(this.scheduleTime);
}

From source file:edu.umd.cloud9.io.pair.PairOfFloatString.java

License:Apache License

/**
 * Serializes this pair./*from ww  w. ja  v a2s  . co m*/
 *
 * @param out where to write the raw byte representation
 */
public void write(DataOutput out) throws IOException {
    out.writeFloat(leftElement);
    Text.writeString(out, rightElement);
}

From source file:edu.umd.cloud9.io.pair.PairOfIntString.java

License:Apache License

/**
 * Serializes this pair.//from  w ww  .j av  a2 s  . c o m
 *
 * @param out where to write the raw byte representation
 */
public void write(DataOutput out) throws IOException {
    out.writeInt(leftElement);
    Text.writeString(out, rightElement);
}