/** * Used to shut down the cache -or- turn it off in the case of something broken. */ private void disableCache() { if (!cacheEnabled) return; cacheEnabled = false; ioEngine.shutdown(); this.scheduleThreadPool.shutdown(); for (int i = 0; i < writerThreads.length; ++i) writerThreads[i].interrupt(); this.ramCache.clear(); if (!ioEngine.isPersistent() || persistencePath == null) { // If persistent ioengine and a path, we will serialize out the backingMap. this.backingMap.clear(); } }
/** * Used to shut down the cache -or- turn it off in the case of something * broken. */ private void disableCache() { if (!cacheEnabled) return; cacheEnabled = false; ioEngine.shutdown(); this.scheduleThreadPool.shutdown(); for (int i = 0; i < writerThreads.length; ++i) writerThreads[i].interrupt(); this.ramCache.clear(); if (!ioEngine.isPersistent() || persistencePath == null) { this.backingMap.clear(); } }
/** * Only used in test * @throws InterruptedException */ void stopWriterThreads() throws InterruptedException { for (WriterThread writerThread : writerThreads) { writerThread.disableWriter(); writerThread.interrupt(); writerThread.join(); } }
/** * Only used in test * @throws InterruptedException */ void stopWriterThreads() throws InterruptedException { for (WriterThread writerThread : writerThreads) { writerThread.disableWriter(); writerThread.interrupt(); writerThread.join(); } }