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

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

Introduction

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

Prototype

public static void resetFirstExitException() 

Source Link

Document

Reset the tracking of process termination.

Usage

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

License:Apache License

/**
 * Shutdown all the nodes in the cluster.
 *//*from  w  ww  .  j a v  a2s  . c o m*/
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();
    }
}