Example usage for org.apache.hadoop.util ExitUtil getFirstExitException

List of usage examples for org.apache.hadoop.util ExitUtil getFirstExitException

Introduction

In this page you can find the example usage for org.apache.hadoop.util ExitUtil getFirstExitException.

Prototype

public static ExitException getFirstExitException() 

Source Link

Usage

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

License:Apache License

/**
 * Shutdown all the nodes in the cluster.
 *///from  www  . j av a 2  s  .com
public void shutdown(boolean deleteDfsDir) {
    LOG.info("Shutting down the Mini HDFS Cluster");
    if (checkExitOnShutdown) {
        if (ExitUtil.terminateCalled()) {
            LOG.fatal("Test resulted in an unexpected exit", ExitUtil.getFirstExitException());
            ExitUtil.resetFirstExitException();
            throw new AssertionError("Test resulted in an unexpected exit");
        }
    }
    shutdownDataNodes();
    for (NameNodeInfo nnInfo : nameNodes) {
        if (nnInfo == null)
            continue;
        NameNode nameNode = nnInfo.nameNode;
        if (nameNode != null) {
            nameNode.stop();
            nameNode.join();
            nameNode = null;
        }
    }
    if (deleteDfsDir) {
        base_dir.delete();
    } else {
        base_dir.deleteOnExit();
    }
}