void start() { daemon.start(); }
void tryStart() { final Thread current = Thread.currentThread(); if (running.compareAndSet(null, current)) { final Daemon daemon = new Daemon() { @Override public void run() { for (; isRunning(this);) { final long waitTime = checkCalls(); tryStop(this); try { synchronized (AsyncCallHandler.this) { AsyncCallHandler.this.wait(waitTime); } } catch (InterruptedException e) { kill(this); } } } }; final boolean set = running.compareAndSet(current, daemon); Preconditions.checkState(set); if (LOG.isDebugEnabled()) { LOG.debug("Starting AsyncCallQueue.Processor " + daemon); } daemon.start(); } }
public void startBlockKeyUpdater() { if (blockKeyUpdater != null) { blockKeyUpdater.daemon.start(); } }
void activate() { heartbeatThread.start(); }
public Daemon recoverBlocks(final String who, final Collection<RecoveringBlock> blocks) { Daemon d = new Daemon(datanode.threadGroup, new Runnable() { @Override public void run() { for(RecoveringBlock b : blocks) { try { logRecoverBlock(who, b); if (b.isStriped()) { new RecoveryTaskStriped((RecoveringStripedBlock) b).recover(); } else { new RecoveryTaskContiguous(b).recover(); } } catch (IOException e) { LOG.warn("recoverBlocks FAILED: " + b, e); } } } }); d.start(); return d; } }
/** * Initializes block movement tracker daemon and starts the thread. */ private void startMovementTracker() { movementTrackerThread = new Daemon(this.blkMovementTracker); movementTrackerThread.setName("BlockStorageMovementTracker"); movementTrackerThread.start(); }
public void activate() { pathIdCollector = new Daemon(pathIDProcessor); pathIdCollector.setName("SPSPathIdProcessor"); pathIdCollector.start(); }
void startMonitor() { Preconditions.checkState(lmthread == null, "Lease Monitor already running"); shouldRunMonitor = true; lmthread = new Daemon(new Monitor()); lmthread.start(); }
slowDiskDetectionDaemon.start();
/** Start a single datanode daemon and wait for it to finish. * If this thread is specifically interrupted, it will stop waiting. */ public void runDatanodeDaemon() throws IOException { blockPoolManager.startAll(); // start dataXceiveServer dataXceiverServer.start(); if (localDataXceiverServer != null) { localDataXceiverServer.start(); } ipcServer.setTracer(tracer); ipcServer.start(); startPlugins(getConf()); }
void start() { timerThread = new Daemon(new PendingReconstructionMonitor()); timerThread.start(); }
public void activate(Configuration conf, long blockTotal) { pendingReconstruction.start(); datanodeManager.activate(conf); this.redundancyThread.setName("RedundancyMonitor"); this.redundancyThread.start(); storageInfoDefragmenterThread.setName("StorageInfoMonitor"); storageInfoDefragmenterThread.start(); this.blockReportThread.start(); mxBeanName = MBeans.register("NameNode", "BlockStats", this); bmSafeMode.activate(blockTotal); }
trashCleaner.start();
/** * Starts the monitor thread. */ public synchronized void start() { monitorRunning = true; timerThread = new Daemon(new BlocksStorageMovementAttemptMonitor()); timerThread.setName("BlocksStorageMovementAttemptMonitor"); timerThread.start(); }
/** * Start storage policy satisfier demon thread. Also start block storage * movements monitor for retry the attempts if needed. */ @Override public synchronized void start(StoragePolicySatisfierMode serviceMode) { if (serviceMode == StoragePolicySatisfierMode.NONE) { LOG.error("Can't start StoragePolicySatisfier for the given mode:{}", serviceMode); return; } LOG.info("Starting {} StoragePolicySatisfier.", StringUtils.toLowerCase(serviceMode.toString())); isRunning = true; storagePolicySatisfierThread = new Daemon(this); storagePolicySatisfierThread.setName("StoragePolicySatisfier"); storagePolicySatisfierThread.start(); this.storageMovementsMonitor.start(); this.storageMovementNeeded.activate(); dnCacheMgr = new DatanodeCacheManager(conf); }
/** * For each block in the name-node verify whether it belongs to any file, * extra or low redundancy. Place it into the respective queue. */ public void processMisReplicatedBlocks() { assert namesystem.hasWriteLock(); stopReconstructionInitializer(); neededReconstruction.clear(); reconstructionQueuesInitializer = new Daemon() { @Override public void run() { try { processMisReplicatesAsync(); } catch (InterruptedException ie) { LOG.info("Interrupted while processing reconstruction queues."); } catch (Exception e) { LOG.error("Error while processing reconstruction queues async", e); } } }; reconstructionQueuesInitializer .setName("Reconstruction Queue Initializer"); reconstructionQueuesInitializer.start(); }
return "Finalize " + dataDirPath; }).start();
smmthread.start(); initializeReplQueuesIfNecessary(); reportStatus("STATE* Safe mode extension entered.", true);
new DataTransfer(targets, targetStorageTypes, targetStorageIds, b, stage, client)); daemon.start(); try { daemon.join();