lazyWriter = new Daemon(new LazyWriter(conf)); lazyWriter.start(); } else {
/** * Attempt to evict blocks from cache Manager to free the requested * bytes. * * @param bytesNeeded */ @VisibleForTesting public void evictLazyPersistBlocks(long bytesNeeded) { try { ((LazyWriter) lazyWriter.getRunnable()).evictBlocks(bytesNeeded); } catch(IOException ioe) { LOG.info("Ignoring exception ", ioe); } }
@Override public void run() { int numSuccessiveFailures = 0; while (fsRunning && shouldRun) { try { numSuccessiveFailures = saveNextReplica() ? 0 : (numSuccessiveFailures + 1); // Sleep if we have no more work to do or if it looks like we are not // making any forward progress. This is to ensure that if all persist // operations are failing we don't keep retrying them in a tight loop. if (numSuccessiveFailures >= ramDiskReplicaTracker.numReplicasNotPersisted()) { Thread.sleep(checkpointerInterval * 1000); numSuccessiveFailures = 0; } } catch (InterruptedException e) { LOG.info("LazyWriter was interrupted, exiting"); break; } catch (Exception e) { LOG.warn("Ignoring exception in LazyWriter:", e); } } }
lazyWriter = new Daemon(new LazyWriter(conf)); lazyWriter.start(); registerMBean(datanode.getDatanodeUuid());
lazyWriter = new Daemon(new LazyWriter(conf)); lazyWriter.start(); registerMBean(datanode.getDatanodeUuid());
transientFreeSpaceBelowThreshold()) { RamDiskReplica replicaState = ramDiskReplicaTracker.getNextCandidateForEviction();
transientFreeSpaceBelowThreshold()) { RamDiskReplica replicaState = ramDiskReplicaTracker.getNextCandidateForEviction();
@Override // FsDatasetSpi public void shutdown() { fsRunning = false; ((LazyWriter) lazyWriter.getRunnable()).stop(); lazyWriter.interrupt(); if (mbeanName != null) { MBeans.unregister(mbeanName); } if (asyncDiskService != null) { asyncDiskService.shutdown(); } if (asyncLazyPersistService != null) { asyncLazyPersistService.shutdown(); } if(volumes != null) { volumes.shutdown(); } try { lazyWriter.join(); } catch (InterruptedException ie) { LOG.warn("FsDatasetImpl.shutdown ignoring InterruptedException " + "from LazyWriter.join"); } }
@Override // FsDatasetSpi public void shutdown() { fsRunning = false; ((LazyWriter) lazyWriter.getRunnable()).stop(); lazyWriter.interrupt(); if (mbeanName != null) { MBeans.unregister(mbeanName); } if (asyncDiskService != null) { asyncDiskService.shutdown(); } if (asyncLazyPersistService != null) { asyncLazyPersistService.shutdown(); } if(volumes != null) { volumes.shutdown(); } try { lazyWriter.join(); } catch (InterruptedException ie) { LOG.warn("FsDatasetImpl.shutdown ignoring InterruptedException " + "from LazyWriter.join"); } }
@Override public void run() { int numSuccessiveFailures = 0; while (fsRunning && shouldRun) { try { numSuccessiveFailures = saveNextReplica() ? 0 : (numSuccessiveFailures + 1); evictBlocks(); // Sleep if we have no more work to do or if it looks like we are not // making any forward progress. This is to ensure that if all persist // operations are failing we don't keep retrying them in a tight loop. if (numSuccessiveFailures >= ramDiskReplicaTracker.numReplicasNotPersisted()) { Thread.sleep(checkpointerInterval * 1000); numSuccessiveFailures = 0; } } catch (InterruptedException e) { LOG.info("LazyWriter was interrupted, exiting"); break; } catch (Exception e) { LOG.warn("Ignoring exception in LazyWriter:", e); } } }
@Override public void run() { int numSuccessiveFailures = 0; while (fsRunning && shouldRun) { try { numSuccessiveFailures = saveNextReplica() ? 0 : (numSuccessiveFailures + 1); evictBlocks(); // Sleep if we have no more work to do or if it looks like we are not // making any forward progress. This is to ensure that if all persist // operations are failing we don't keep retrying them in a tight loop. if (numSuccessiveFailures >= ramDiskReplicaTracker.numReplicasNotPersisted()) { Thread.sleep(checkpointerInterval * 1000); numSuccessiveFailures = 0; } } catch (InterruptedException e) { LOG.info("LazyWriter was interrupted, exiting"); break; } catch (Exception e) { LOG.warn("Ignoring exception in LazyWriter:", e); } } }
/** * Stop the lazy writer daemon that saves RAM disk files to persistent storage. * @param dn */ public static void stopLazyWriter(DataNode dn) { FsDatasetImpl fsDataset = ((FsDatasetImpl) dn.getFSDataset()); ((FsDatasetImpl.LazyWriter) fsDataset.lazyWriter.getRunnable()).stop(); }
@Override // FsDatasetSpi public void shutdown() { fsRunning = false; if (lazyWriter != null) { ((LazyWriter) lazyWriter.getRunnable()).stop(); lazyWriter.interrupt(); } if (mbeanName != null) { MBeans.unregister(mbeanName); } if (asyncDiskService != null) { asyncDiskService.shutdown(); } if (asyncLazyPersistService != null) { asyncLazyPersistService.shutdown(); } if(volumes != null) { volumes.shutdown(); } if (lazyWriter != null) { try { lazyWriter.join(); } catch (InterruptedException ie) { LOG.warn("FsDatasetImpl.shutdown ignoring InterruptedException " + "from LazyWriter.join"); } } }