/** * Indicates if shutdown is in progress or not. * * @return TRUE if the shutdown is in progress, otherwise FALSE. */ public static boolean isShutdownInProgress() { return MGR.isShutdownInProgress(); }
/** * deregister file from delete-on-exit hook */ public static void cancelDeleteOnExit(File file) { if (MGR.isShutdownInProgress()) { LOG.warn("Shutdown in progress, cannot cancel a deleteOnExit"); } DELETE_ON_EXIT_HOOK.deleteTargets.remove(file); }
/** * register file to delete-on-exit hook * * {@link org.apache.hadoop.hive.common.FileUtils#createTempFile} */ public static void deleteOnExit(File file) { if (MGR.isShutdownInProgress()) { LOG.warn("Shutdown in progress, cannot add a deleteOnExit"); } DELETE_ON_EXIT_HOOK.deleteTargets.add(file); }
&& !ShutdownHookManager.get().isShutdownInProgress()) { ShutdownHookManager.get().addShutdownHook(clientFinalizer, SHUTDOWN_HOOK_PRIORITY);
if (ShutdownHookManager.get().isShutdownInProgress()) { LOG.error("Thread {} threw an error during shutdown: {}.", thread.toString(),
/** * Indicates if shutdown is in progress or not. * * @return TRUE if the shutdown is in progress, otherwise FALSE. */ public static boolean isShutdownInProgress() { return MGR.isShutdownInProgress(); }
/** * register file to delete-on-exit hook * * {@link org.apache.hadoop.hive.common.FileUtils#createTempFile} */ public static void deleteOnExit(File file) { if (MGR.isShutdownInProgress()) { LOG.warn("Shutdown in progress, cannot add a deleteOnExit"); } DELETE_ON_EXIT_HOOK.deleteTargets.add(file); }
/** * deregister file from delete-on-exit hook */ public static void cancelDeleteOnExit(File file) { if (MGR.isShutdownInProgress()) { LOG.warn("Shutdown in progress, cannot cancel a deleteOnExit"); } DELETE_ON_EXIT_HOOK.deleteTargets.remove(file); }
@Override public synchronized void delete() throws IOException { stopped = true; if (ShutdownHookManager.get().isShutdownInProgress()) return; String fileName = masterName.replaceAll(":", "_"); fs.delete(new Path(activePath, fileName), false); fs.delete(new Path(activePath, HAConstants.ACTIVE_LOCK_FILE), false); fs.delete(new Path(backupPath, fileName), false); }
@Override public synchronized void delete() throws IOException { stopped = true; if (ShutdownHookManager.get().isShutdownInProgress()) return; String fileName = masterName.replaceAll(":", "_"); fs.delete(new Path(activePath, fileName), false); fs.delete(new Path(activePath, HAConstants.ACTIVE_LOCK_FILE), false); fs.delete(new Path(backupPath, fileName), false); }
protected boolean isShuttingDown() { return ShutdownHookManager.get().isShutdownInProgress(); }
@Override public void run() { try { NodeManager.this.stop(); } catch (Throwable t) { LOG.error("Error while shutting down NodeManager", t); } finally { if (shouldExitOnShutdownEvent && !ShutdownHookManager.get().isShutdownInProgress()) { ExitUtil.terminate(-1); } } } }.start();
@Override public void run() { try { NodeManager.this.stop(); } catch (Throwable t) { LOG.error("Error while shutting down NodeManager", t); } finally { if (shouldExitOnShutdownEvent && !ShutdownHookManager.get().isShutdownInProgress()) { ExitUtil.terminate(-1); } } } }.start();
@Override public void run() { try { NodeManager.this.stop(); } catch (Throwable t) { LOG.error("Error while shutting down NodeManager", t); } finally { if (shouldExitOnShutdownEvent && !ShutdownHookManager.get().isShutdownInProgress()) { ExitUtil.terminate(-1); } } } }.start();
@Override public void run() { try { NodeManager.this.stop(); } catch (Throwable t) { LOG.error("Error while shutting down NodeManager", t); } finally { if (shouldExitOnShutdownEvent && !ShutdownHookManager.get().isShutdownInProgress()) { ExitUtil.terminate(exitCode); } } } }.start();
/** * Report a fatal error to the parent (task) tracker. */ protected void reportFatalError(TaskAttemptID id, Throwable throwable, String logMsg) { LOG.fatal(logMsg); if (ShutdownHookManager.get().isShutdownInProgress()) { return; } Throwable tCause = throwable.getCause(); String cause = tCause == null ? StringUtils.stringifyException(throwable) : StringUtils.stringifyException(tCause); try { umbilical.fatalError(id, cause); } catch (IOException ioe) { LOG.fatal("Failed to contact the tasktracker", ioe); System.exit(-1); } }
/** * Report a fatal error to the parent (task) tracker. */ protected void reportFatalError(TaskAttemptID id, Throwable throwable, String logMsg) { LOG.fatal(logMsg); if (ShutdownHookManager.get().isShutdownInProgress()) { return; } Throwable tCause = throwable.getCause(); String cause = tCause == null ? StringUtils.stringifyException(throwable) : StringUtils.stringifyException(tCause); try { umbilical.fatalError(id, cause); } catch (IOException ioe) { LOG.fatal("Failed to contact the tasktracker", ioe); System.exit(-1); } }
protected void checkForSafeError(Exception e) { boolean safeError = ShutdownHookManager.get().isShutdownInProgress(); if (safeError) { // IOException because of closed file system. This happens when member is // shutting down if (logger.isDebugEnabled()) logger.debug("IO error caused by filesystem shutdown", e); throw new CacheClosedException("IO error caused by filesystem shutdown", e); } if(isClosed()) { //If the hoplog organizer is closed, throw an exception to indicate the //caller should retry on the new primary. throw new PrimaryBucketException(e); } }
/** * Report a fatal error to the parent (task) tracker. */ protected void reportFatalError(TaskAttemptID id, Throwable throwable, String logMsg) { LOG.fatal(logMsg); if (ShutdownHookManager.get().isShutdownInProgress()) { return; } Throwable tCause = throwable.getCause(); String cause = tCause == null ? StringUtils.stringifyException(throwable) : StringUtils.stringifyException(tCause); try { umbilical.fatalError(id, cause); } catch (IOException ioe) { LOG.fatal("Failed to contact the tasktracker", ioe); System.exit(-1); } }
protected void checkForSafeError(Exception e) { boolean safeError = ShutdownHookManager.get().isShutdownInProgress(); if (safeError) { // IOException because of closed file system. This happens when member is // shutting down logger.fine("IO error caused by filesystem shutdown", e); throw new CacheClosedException("IO error caused by filesystem shutdown", e); } if(isClosed()) { //If the hoplog organizer is closed, throw an exception to indicate the //caller should retry on the new primary. throw new PrimaryBucketException(e); } }