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

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

Introduction

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

Prototype

public void setDecommissioned() 

Source Link

Document

Sets the admin state to indicate that decommission is complete.

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