Example usage for org.apache.hadoop.io WritableUtils writeStringArray

List of usage examples for org.apache.hadoop.io WritableUtils writeStringArray

Introduction

In this page you can find the example usage for org.apache.hadoop.io WritableUtils writeStringArray.

Prototype

public static void writeStringArray(DataOutput out, String[] s) throws IOException 

Source Link

Usage

From source file:org.apache.mahout.df.data.Dataset.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    out.writeInt(attributes.length); // nb attributes
    for (Attribute attr : attributes) {
        WritableUtils.writeString(out, attr.name());
    }// w  w w .ja va2 s.c  o m

    WritableUtils.writeStringArray(out, labels);

    DFUtils.writeArray(out, ignored);

    // only CATEGORICAL attributes have values
    for (String[] vals : values) {
        if (vals != null) {
            WritableUtils.writeStringArray(out, vals);
        }
    }

    out.writeInt(labelId);
    out.writeInt(nbInstances);
}

From source file:org.apache.nutch.parse.ParseStatus.java

License:Apache License

public void write(DataOutput out) throws IOException {
    out.writeByte(VERSION);/*from ww w. ja v a 2  s  . c  om*/
    out.writeByte(majorCode);
    out.writeShort(minorCode);
    if (args == null) {
        out.writeInt(-1);
    } else {
        WritableUtils.writeStringArray(out, args);
    }
}