Example usage for org.apache.hadoop.hdfs.protocol DatanodeInfo setXceiverCount

List of usage examples for org.apache.hadoop.hdfs.protocol DatanodeInfo setXceiverCount

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.protocol DatanodeInfo setXceiverCount.

Prototype

public void setXceiverCount(int xceiverCount) 

Source Link

Document

Sets number of active connections

Usage

From source file:org.openflamingo.remote.thrift.thriftfs.ThriftUtils.java

License:Apache License

public static org.apache.hadoop.hdfs.protocol.DatanodeInfo fromThrift(DatanodeInfo node) {
    if (node == null) {
        return null;
    }//from w  w  w .  jav  a2  s .c  om

    org.apache.hadoop.hdfs.protocol.DatanodeInfo ret = new org.apache.hadoop.hdfs.protocol.DatanodeInfo();
    ret.name = node.name;
    ret.storageID = node.storageID;
    ret.setCapacity(node.capacity);
    ret.setHostName(node.host);
    ret.setXceiverCount(node.xceiverCount);
    ret.setRemaining(node.remaining);
    if (node.state == DatanodeState.DECOMMISSIONED) {
        ret.setDecommissioned();
    }
    return ret;
}