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

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

Introduction

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

Prototype

public void setRemaining(long remaining) 

Source Link

Document

Sets raw free space.

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  ww. java 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;
}