/*
  * Shuts down the pending replication monitor thread. Waits for the thread
  * to exit.
  */
 void stop() {
   fsRunning = false;
   timerThread.interrupt();
   try {
     timerThread.join(3000);
   } catch (InterruptedException ie) {
   }
 }
예제 #2
0
  /**
   * main() has some simple utility methods.
   *
   * @param argv Command line parameters.
   * @exception Exception if the filesystem does not exist.
   */
  public static void main(String[] argv) throws Exception {
    StringUtils.startupShutdownMessage(SecondaryNameNode.class, argv, LOG);
    Configuration tconf = new Configuration();
    if (argv.length >= 1) {
      SecondaryNameNode secondary = new SecondaryNameNode(tconf);
      int ret = secondary.processArgs(argv);
      System.exit(ret);
    }

    // Create a never ending deamon
    Daemon checkpointThread = new Daemon(new SecondaryNameNode(tconf));
    checkpointThread.start();
  }
 /** Wait for service to finish. (Normally, it runs forever.) */
 public void join() {
   try {
     if (server != null) server.join();
     if (aggregateDaemon != null) aggregateDaemon.join();
   } catch (InterruptedException ie) {
     // do nothing
   }
 }
 /** {@inheritDocs} */
 @Override
 public void stop() {
   if (stopRequested) {
     return;
   }
   super.stop();
   if (jobMonitor != null) jobMonitor.running = false;
   if (jobMonitorThread != null) jobMonitorThread.interrupt();
 }
 /** {@inheritDocs} */
 @Override
 public void join() {
   super.join();
   try {
     if (jobMonitorThread != null) jobMonitorThread.join();
   } catch (InterruptedException ie) {
     // do nothing
   }
 }
 void init() {
   pendingReplications = new HashMap<Block, PendingBlockInfo>();
   timedOutItems = new ArrayList<Block>();
   this.timerThread = new Daemon(new PendingReplicationMonitor());
   timerThread.start();
 }
 /** Stop all Collector threads and wait for all to finish. */
 public void stop() {
   running = false;
   if (server != null) server.stop();
   if (aggregateDaemon != null) aggregateDaemon.interrupt();
 }
예제 #8
0
 void start() {
   daemon.start();
 }
예제 #9
0
 void join() throws InterruptedException {
   daemon.join();
 }
예제 #10
0
 boolean isAlive() {
   return daemon.isAlive();
 }
예제 #11
0
 public void shutdown() {
   LOG.info("Stopping HealthMonitor thread");
   shouldRun = false;
   daemon.interrupt();
 }