Java Code Examples for org.apache.hadoop.hdfs.server.namenode.NameNode#stop()

The following examples show how to use org.apache.hadoop.hdfs.server.namenode.NameNode#stop() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MiniDFSCluster.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown all the nodes in the cluster.
 */
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();
  }
}
 
Example 2
Source File: MiniDFSCluster.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown the namenode at a given index.
 */
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);
  }
}
 
Example 3
Source File: MiniDFSCluster.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown all the nodes in the cluster.
 */
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();
  }
}
 
Example 4
Source File: MiniDFSCluster.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown the namenode at a given index.
 */
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);
  }
}
 
Example 5
Source File: MiniDFSCluster.java    From RDFS with Apache License 2.0 5 votes vote down vote up
/**
 * Shut down all the servers that are up.
 * @param remove: remove datanode information from the dataNodes or not
 */
public void shutdown(boolean remove) {
  System.out.println("Shutting down the Mini HDFS Cluster");
  shutdownDataNodes(remove);
  for (NameNodeInfo nnInfo : nameNodes) {
    NameNode nameNode = nnInfo.nameNode;
    if (nameNode != null) {
      nameNode.stop();
      nameNode.join();
      nameNode = null;
    }
  }
}
 
Example 6
Source File: MiniDFSCluster.java    From RDFS with Apache License 2.0 5 votes vote down vote up
/**
 * Shutdown one namenode
 */
public synchronized void shutdownNameNode(int nnIndex) {
  NameNode nn = nameNodes[nnIndex].nameNode;
  if (nn != null) {
    System.out.println("Shutting down the namenode");
    nn.stop();
    nn.join();
    Configuration conf = nameNodes[nnIndex].conf;
    nameNodes[nnIndex] = new NameNodeInfo(null, conf);
  }
}
 
Example 7
Source File: TestHDFSServerPorts.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public void stopNameNode(NameNode nn) {
  if (nn != null) {
    nn.stop();
  }
}
 
Example 8
Source File: TestHDFSServerPorts.java    From big-c with Apache License 2.0 4 votes vote down vote up
public void stopNameNode(NameNode nn) {
  if (nn != null) {
    nn.stop();
  }
}
 
Example 9
Source File: TestHDFSServerPorts.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public void stopNameNode(NameNode nn) {
  if (nn != null) {
    nn.stop();
  }
}
 
Example 10
Source File: TestHDFSServerPorts.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
public void stopNameNode(NameNode nn) {
  if (nn != null) {
    nn.stop();
  }
}