/** * Check whether we tolerate IO error this time. If the duration of IOEngine * throwing errors exceeds ioErrorsDurationTimeTolerated, we will disable the * cache */ private void checkIOErrorIsTolerated() { long now = EnvironmentEdgeManager.currentTime(); if (this.ioErrorStartTime > 0) { if (cacheEnabled && (now - ioErrorStartTime) > this.ioErrorsTolerationDuration) { LOG.error("IO errors duration time has exceeded " + ioErrorsTolerationDuration + "ms, disabling cache, please check your IOEngine"); disableCache(); } } else { this.ioErrorStartTime = now; } }
@Override public void shutdown() { disableCache(); LOG.info("Shutdown bucket cache: IO persistent=" + ioEngine.isPersistent() + "; path to write=" + persistencePath); if (ioEngine.isPersistent() && persistencePath != null) { try { join(); persistToFile(); } catch (IOException ex) { LOG.error("Unable to persist data on exit: " + ex.toString(), ex); } catch (InterruptedException e) { LOG.warn("Failed to persist data on exit", e); } } }
/** * Check whether we tolerate IO error this time. If the duration of IOEngine * throwing errors exceeds ioErrorsDurationTimeTolerated, we will disable the * cache */ private void checkIOErrorIsTolerated() { long now = EnvironmentEdgeManager.currentTime(); if (this.ioErrorStartTime > 0) { if (cacheEnabled && (now - ioErrorStartTime) > this.ioErrorsTolerationDuration) { LOG.error("IO errors duration time has exceeded " + ioErrorsTolerationDuration + "ms, disabing cache, please check your IOEngine"); disableCache(); } } else { this.ioErrorStartTime = now; } }
@Override public void shutdown() { disableCache(); LOG.info("Shutdown bucket cache: IO persistent=" + ioEngine.isPersistent() + "; path to write=" + persistencePath); if (ioEngine.isPersistent() && persistencePath != null) { try { join(); persistToFile(); } catch (IOException ex) { LOG.error("Unable to persist data on exit: " + ex.toString(), ex); } catch (InterruptedException e) { LOG.warn("Failed to persist data on exit", e); } } }