Пример #1
0
 /// <summary>Stop the daemon with the given status code</summary>
 /// <param name="rc">
 /// the status code with which to exit (non-zero
 /// should indicate an error)
 /// </param>
 public virtual void Stop(int rc)
 {
     this.resultCode = rc;
     if (rpcServer != null)
     {
         rpcServer.Stop();
     }
     if (httpServer != null)
     {
         try
         {
             httpServer.Stop();
         }
         catch (IOException ioe)
         {
             Log.Warn("Unable to stop HTTP server for " + this, ioe);
         }
     }
     foreach (Journal j in journalsById.Values)
     {
         IOUtils.Cleanup(Log, j);
     }
     if (journalNodeInfoBeanName != null)
     {
         MBeans.Unregister(journalNodeInfoBeanName);
         journalNodeInfoBeanName = null;
     }
 }
Пример #2
0
 internal virtual void StopMBeans()
 {
     lock (this)
     {
         if (mbeanName != null)
         {
             MBeans.Unregister(mbeanName);
             mbeanName = null;
         }
     }
 }
Пример #3
0
 /// <summary>Shut down this instance of the datanode.</summary>
 /// <remarks>
 /// Shut down this instance of the datanode.
 /// Returns only after shutdown is complete.
 /// </remarks>
 public virtual void Shutdown()
 {
     shouldRun = false;
     if (checkpointThread != null)
     {
         checkpointThread.Interrupt();
         try
         {
             checkpointThread.Join(10000);
         }
         catch (Exception)
         {
             Log.Info("Interrupted waiting to join on checkpointer thread");
             Sharpen.Thread.CurrentThread().Interrupt();
         }
     }
     // maintain status
     try
     {
         if (infoServer != null)
         {
             infoServer.Stop();
             infoServer = null;
         }
     }
     catch (Exception e)
     {
         Log.Warn("Exception shutting down SecondaryNameNode", e);
     }
     if (nameNodeStatusBeanName != null)
     {
         MBeans.Unregister(nameNodeStatusBeanName);
         nameNodeStatusBeanName = null;
     }
     try
     {
         if (checkpointImage != null)
         {
             checkpointImage.Close();
             checkpointImage = null;
         }
     }
     catch (IOException e)
     {
         Log.Warn("Exception while closing CheckpointStorage", e);
     }
     if (namesystem != null)
     {
         namesystem.Shutdown();
         namesystem = null;
     }
 }
Пример #4
0
 public override bool Shutdown()
 {
     lock (this)
     {
         Log.Debug("refCount=" + refCount);
         if (refCount <= 0)
         {
             Log.Debug("Redundant shutdown", new Exception());
             return(true);
         }
         // already shutdown
         if (--refCount > 0)
         {
             return(false);
         }
         if (monitoring)
         {
             try
             {
                 Stop();
             }
             catch (Exception e)
             {
                 Log.Warn("Error stopping the metrics system", e);
             }
         }
         allSources.Clear();
         allSinks.Clear();
         callbacks.Clear();
         namedCallbacks.Clear();
         if (mbeanName != null)
         {
             MBeans.Unregister(mbeanName);
             mbeanName = null;
         }
         Log.Info(prefix + " metrics system shutdown complete.");
         return(true);
     }
 }
Пример #5
0
 public virtual void Shutdown()
 {
     MBeans.Unregister(mxBeanName);
     mxBeanName = null;
 }