Example #1
0
 private void stopCommonServices() {
   if (namesystem != null) {
     namesystem.close();
   }
   if (rpcServer != null) {
     rpcServer.stop();
   }
   if (leaderElection != null && leaderElection.isRunning()) {
     leaderElection.stopElectionThread();
   }
   if (plugins != null) {
     for (ServicePlugin p : plugins) {
       try {
         p.stop();
       } catch (Throwable t) {
         LOG.warn("ServicePlugin " + p + " could not be stopped", t);
       }
     }
   }
   stopHttpServer();
 }
Example #2
0
  /** Start the services common to active and standby states */
  private void startCommonServices(Configuration conf) throws IOException {
    startHttpServer(conf);

    startLeaderElectionService();

    namesystem.startCommonServices(conf);

    rpcServer.start();
    plugins = conf.getInstances(DFS_NAMENODE_PLUGINS_KEY, ServicePlugin.class);
    for (ServicePlugin p : plugins) {
      try {
        p.start(this);
      } catch (Throwable t) {
        LOG.warn("ServicePlugin " + p + " could not be started", t);
      }
    }
    LOG.info(getRole() + " RPC up at: " + rpcServer.getRpcAddress());
    if (rpcServer.getServiceRpcAddress() != null) {
      LOG.info(getRole() + " service RPC up at: " + rpcServer.getServiceRpcAddress());
    }
  }