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

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

Introduction

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

Prototype

public static String readString(DataInput in) throws IOException 

Source Link

Document

Read a UTF8 encoded string from in

Usage

From source file:com.soteradefense.dga.hbse.HighBetweennessList.java

License:Apache License

/**
 * Read fields//from  ww  w  . java  2 s  . c  o m
 */
public void readFields(DataInput in) throws IOException {
    maxSize = in.readInt();
    highBetweennessQueue = new PriorityQueue<BcTuple>(maxSize, comparator);
    int size = in.readInt();
    for (int i = 0; i < size; i++) {
        highBetweennessQueue.add(new BcTuple(Text.readString(in), in.readDouble()));
    }
}

From source file:com.soteradefense.dga.hbse.PathData.java

License:Apache License

@Override
public void readFields(DataInput in) throws IOException {

    source = Text.readString(in);
    from = Text.readString(in);/*from  ww w  .  j a  v a2 s .  c om*/

    distance = new BigInteger(Text.readString(in));
    numPaths = new BigInteger(Text.readString(in));

    dependency = in.readDouble();
}

From source file:com.soteradefense.dga.hbse.PivotList.java

License:Apache License

@Override
public void readFields(DataInput dataInput) throws IOException {
    pivots.clear();//from  w  w w . j  a v  a  2 s  .  c  om

    int size = dataInput.readInt();
    for (int i = 0; i < size; ++i) {
        pivots.add(Text.readString(dataInput));
    }
}

From source file:com.soteradefense.dga.hbse.ShortestPathList.java

License:Apache License

@Override
public void readFields(DataInput in) throws IOException {
    this.predecessorPathCountMap.clear();
    setDistance(new BigInteger(Text.readString(in)));
    int size = in.readInt();
    for (int i = 0; i < size; i++) {
        predecessorPathCountMap.put(Text.readString(in), new BigInteger(Text.readString(in)));
    }//from www . j  a  va 2 s.  c  o  m
}

From source file:com.soteradefense.dga.hbse.VertexData.java

License:Apache License

@Override
public void readFields(DataInput in) throws IOException {
    //Reset Maps/* ww w. jav a 2 s  . c  o  m*/
    pathDataMap.clear();
    partialDepMap.clear();
    setWasPivotPoint(in.readBoolean());
    setApproxBetweenness(in.readDouble());
    // read the path data map
    int size = in.readInt();
    for (int i = 0; i < size; i++) {
        String key = Text.readString(in);
        ShortestPathList list = new ShortestPathList();
        list.readFields(in);
        pathDataMap.put(key, list);
    }

    size = in.readInt();
    for (int i = 0; i < size; i++) {
        String src = Text.readString(in);
        PartialDependency dep = new PartialDependency();
        dep.readFields(in);
        partialDepMap.put(src, dep);
    }

}

From source file:com.telefonica.iot.tidoop.apiext.hadoop.ckan.CKANInputSplit.java

License:Open Source License

@Override
public void readFields(DataInput in) {
    try {//from w w w . j  a va2s .c  o m
        resId = Text.readString(in);
        firstRecordIndex = in.readLong();
        length = in.readLong();
    } catch (Exception e) {
        logger.error("Unable to read CKANInputSplit fields when deserializing. Details: " + e.getMessage());
    } // try catch
}

From source file:com.toshiba.mwcloud.gs.hadoop.mapred.GSContainerSplit.java

License:Apache License

/**
 * <div lang="ja">/* w w  w  .  j a v a2  s . com*/
 * {@inheritDoc}
 * @see Writable#readFields(DataInput)
 * @throws IOException DataInput???????????
 * </div><div lang="en">
 * {@inheritDoc}
 * @see Writable#readFields(DataInput)
 * @throws IOException error occurred when reading from DataInput object
 * </div>
 */
@Override
public void readFields(final DataInput in) throws IOException {
    containerInfoLength_ = in.readInt();

    if (containerInfoLength_ > 0) {
        partitionHost_ = new String[containerInfoLength_];
        containerNameListLength_ = new int[containerInfoLength_];
        containerNameList_ = new String[containerInfoLength_][];

        for (int i = 0; i < containerInfoLength_; i++) {
            partitionHost_[i] = Text.readString(in);
            containerNameListLength_[i] = in.readInt();

            if (containerNameListLength_[i] > 0) {
                containerNameList_[i] = new String[containerNameListLength_[i]];

                for (int j = 0; j < containerNameListLength_[i]; j++) {
                    containerNameList_[i][j] = Text.readString(in);
                }
            }
        }
    }
}

From source file:com.twitter.elephanttwin.retrieval.IndexedFileSplit.java

License:Apache License

@Override
public void readFields(DataInput in) throws IOException {
    first_start = in.readLong();//from www .  jav  a  2 s  . c om
    total_bytes = in.readLong();
    file = new Path(Text.readString(in));
    indexedBlocks = new ListLongPair();
    indexedBlocks.readFields(in);
}

From source file:com.twitter.hraven.AppKey.java

License:Apache License

@Override
public void readFields(DataInput in) throws IOException {
    this.cluster = Text.readString(in);
    this.userName = Text.readString(in);
    this.appId = Text.readString(in);
}

From source file:com.twitter.hraven.etl.JobFile.java

License:Apache License

@Override
public void readFields(DataInput in) throws IOException {
    this.filename = Text.readString(in);
    this.jobid = Text.readString(in);
    this.isJobConfFile = in.readBoolean();
    this.isJobHistoryFile = in.readBoolean();
}