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

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

Introduction

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

Prototype

public void setCapacity(long capacity) 

Source Link

Document

Sets raw capacity.

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;
    }// w ww.j av a 2s  .co  m

    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;
}