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:org.goldenorb.io.input.RawSplit.java

License:Apache License

/**
 * Writes to the given DataOutput./*from   ww w  . java 2 s . c o m*/
 * 
 * @param out
 *          - DataOutput
 */
public void write(DataOutput out) throws IOException {
    Text.writeString(out, splitClass);
    out.writeLong(dataLength);
    bytes.write(out);
    WritableUtils.writeVInt(out, locations.length);
    for (int i = 0; i < locations.length; i++) {
        Text.writeString(out, locations[i]);
    }
}

From source file:org.goldenorb.jet.OrbPartitionMember.java

License:Apache License

/**
 * /*from w  ww. j  a v a2 s.c  o  m*/
 * @param  DataOutput out
 */
public void write(DataOutput out) throws IOException {
    out.writeInt(partitionID);
    out.writeInt(numberOfVertices);
    out.writeInt(superStep);
    out.writeInt(messagesSent);
    out.writeFloat(percentComplete);
    Text.writeString(out, hostname);
    out.writeBoolean(leader);
    out.writeInt(port);
}

From source file:org.goldenorb.jet.OrbTrackerMember.java

License:Apache License

/**
 * /*  ww  w.j a  v  a 2s . c o  m*/
 * @param DataOutput
 *          out
 */
public void write(DataOutput out) throws IOException {
    out.writeInt(partitionCapacity);
    out.writeInt(availablePartitions);
    out.writeInt(reservedPartitions);
    out.writeInt(inUsePartitions);
    Text.writeString(out, hostname);
    out.writeBoolean(leader);
    out.writeInt(port);
}

From source file:org.goldenorb.jet.PartitionRequest.java

License:Apache License

/**
 * /* w w w  . ja  va  2  s . c  o m*/
 * @param  DataOutput out
 */
public void write(DataOutput out) throws IOException {
    out.writeInt(reservedPartitions);
    out.writeInt(activePartitions);
    Text.writeString(out, jobID);
    out.writeInt(basePartitionID);
    jobConf.write(out);
}

From source file:org.sf.xrime.algorithms.BC.BCLabel.java

License:Apache License

public void write(DataOutput out) throws IOException {

    out.writeInt(status);//  ww  w .  ja  v a 2  s  .c  o m
    out.writeInt(distance);
    out.writeInt(number);
    out.writeFloat(bc);
    int prosize = precessor.size();
    //    int sucsize=successor.size();
    out.writeInt(prosize);
    if (prosize != 0) {
        for (String item : precessor) {
            Text.writeString(out, item);
        }
    }
}

From source file:org.sf.xrime.algorithms.BFS.BFSLabel.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    out.writeInt(status);//from ww  w . jav  a2s. co  m

    if (preps == null) {
        out.writeInt(0);
        return;
    }

    out.writeInt(preps.size());
    for (String item : preps) {
        Text.writeString(out, item);
    }
}

From source file:org.sf.xrime.algorithms.layout.radialtree.RadialTreeLabel.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    out.writeInt(status);/*from   w w  w  .  j  a v  a2s.c o  m*/
    out.writeDouble(weight);
    out.writeInt(coordinate_x);
    out.writeInt(coordinate_y);
    out.writeDouble(angle_from);
    out.writeDouble(angle_to);
    out.writeDouble(angle_begin);
    out.writeLong(distance);
    out.writeInt(end);
    Text.writeString(out, pre);
    out.writeLong(predistance);
    out.writeLong(next);
    out.writeDouble(succ_angle_from);
    out.writeDouble(succ_angle_to);
    if (preps == null) {
        out.writeInt(0);
    } else {
        out.writeInt(preps.size());
        for (String item : preps) {
            Text.writeString(out, item);
        }
    }
    if (succ == null) {
        out.writeInt(0);
    } else {
        out.writeInt(succ.size());
        for (String item : succ) {
            Text.writeString(out, item);
        }
    }
}

From source file:org.sf.xrime.algorithms.MST.MSTLabel.MSTMessageInitiateLabel.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    // TODO Auto-generated method stub
    out.writeInt(fragLevel);/*from  w  ww. j  a  va  2  s.  c  om*/
    Text.writeString(out, fragIdentity);
    out.writeInt(state);
}

From source file:org.sf.xrime.algorithms.MST.MSTLabel.MSTMessageReportLabel.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    // TODO Auto-generated method stub
    bestWeight.write(out);//from   w  ww  .j  a  va 2 s  .com
    Text.writeString(out, edgeIdentity);
}

From source file:org.sf.xrime.algorithms.MST.MSTLabel.MSTMessageTestLabel.java

License:Apache License

@Override
public void write(DataOutput out) throws IOException {
    // TODO Auto-generated method stub
    out.writeInt(fragLevel);//  w w w  .ja v a  2  s .  co  m
    Text.writeString(out, fragIdentity);
}