Example usage for org.apache.hadoop.hdfs.protocol ClientProtocol GET_STATS_CAPACITY_IDX

List of usage examples for org.apache.hadoop.hdfs.protocol ClientProtocol GET_STATS_CAPACITY_IDX

Introduction

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

Prototype

int GET_STATS_CAPACITY_IDX

To view the source code for org.apache.hadoop.hdfs.protocol ClientProtocol GET_STATS_CAPACITY_IDX.

Click Source Link

Document

Constants to index the array of aggregated stats returned by #getStats() .

Usage

From source file:com.mellanox.r4h.MiniDFSCluster.java

License:Apache License

/**
 * Returns true if the NameNode is running and is out of Safe Mode
 * or if waiting for safe mode is disabled.
 *///from   w  w w  .  ja  va 2 s .c  om
public boolean isNameNodeUp(int nnIndex) {
    NameNode nameNode = nameNodes[nnIndex].nameNode;
    if (nameNode == null) {
        return false;
    }
    long[] sizes;
    sizes = NameNodeAdapter.getStats(nameNode.getNamesystem());
    boolean isUp = false;
    synchronized (this) {
        isUp = ((!nameNode.isInSafeMode() || !waitSafeMode)
                && sizes[ClientProtocol.GET_STATS_CAPACITY_IDX] != 0);
    }
    return isUp;
}