List of usage examples for org.apache.hadoop.hdfs.server.namenode NameNodeAdapter getStats
public static long[] getStats(final FSNamesystem fsn)
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 ww w .j ava2 s . com*/ 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; }