Example usage for org.apache.hadoop.hdfs.server.namenode NameNode stop

List of usage examples for org.apache.hadoop.hdfs.server.namenode NameNode stop

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.server.namenode NameNode stop.

Prototype

public void stop() 

Source Link

Document

Stop all NameNode threads and wait for all to finish.

Usage

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

License:Apache License

/**
 * Shutdown all the nodes in the cluster.
 *//*from  ww w .j  a va  2 s  . 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();
    }
}

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

License:Apache License

/**
 * Shutdown the namenode at a given index.
 *///from  w w w  .j a  va  2 s .c  o  m
public synchronized void shutdownNameNode(int nnIndex) {
    NameNode nn = nameNodes[nnIndex].nameNode;
    if (nn != null) {
        LOG.info("Shutting down the namenode");
        nn.stop();
        nn.join();
        Configuration conf = nameNodes[nnIndex].conf;
        nameNodes[nnIndex] = new NameNodeInfo(null, null, null, null, conf);
    }
}

From source file:io.fabric8.hadoop.hdfs.NameNodeFactory.java

License:Apache License

@Override
protected void doDelete(NameNode service) throws Exception {
    service.stop();
}