static void incrDeletedFileCount(long count) { NameNode.getNameNodeMetrics().incrFilesDeleted(count); }
/** * Iterate through all items and detect timed-out items */ void pendingReconstructionCheck() { synchronized (pendingReconstructions) { Iterator<Map.Entry<BlockInfo, PendingBlockInfo>> iter = pendingReconstructions.entrySet().iterator(); long now = monotonicNow(); LOG.debug("PendingReconstructionMonitor checking Q"); while (iter.hasNext()) { Map.Entry<BlockInfo, PendingBlockInfo> entry = iter.next(); PendingBlockInfo pendingBlock = entry.getValue(); if (now > pendingBlock.getTimeStamp() + timeout) { BlockInfo block = entry.getKey(); synchronized (timedOutItems) { timedOutItems.add(block); } LOG.warn("PendingReconstructionMonitor timed out " + block); NameNode.getNameNodeMetrics().incTimeoutReReplications(); iter.remove(); } } } } }
/** * Constructor for FSEditLog. Underlying journals are constructed, but * no streams are opened until open() is called. * * @param conf The namenode configuration * @param storage Storage object used by namenode * @param editsDirs List of journals to use */ FSEditLog(Configuration conf, NNStorage storage, List<URI> editsDirs) { isSyncRunning = false; this.conf = conf; this.storage = storage; metrics = NameNode.getNameNodeMetrics(); lastPrintTime = monotonicNow(); // If this list is empty, an error will be thrown on first use // of the editlog, as no journals will exist this.editsDirs = Lists.newArrayList(editsDirs); this.sharedEditsDirs = FSNamesystem.getSharedEditsDirs(conf); }
/** * Perform resource checks and cache the results. */ void checkAvailableResources() { long resourceCheckTime = monotonicNow(); Preconditions.checkState(nnResourceChecker != null, "nnResourceChecker not initialized"); hasResourcesAvailable = nnResourceChecker.hasAvailableDiskSpace(); resourceCheckTime = monotonicNow() - resourceCheckTime; NameNode.getNameNodeMetrics().addResourceCheckTime(resourceCheckTime); }
NameNode.getNameNodeMetrics().addWarmUpEDEKTime(warmUpEDEKTime); if (!success) { NameNode.LOG.warn("Unable to warm up EDEKs.");
private void processQueue() { while (namesystem.isRunning()) { NameNodeMetrics metrics = NameNode.getNameNodeMetrics(); try { Runnable action = queue.take();
final Configuration conf = (Configuration) context .getAttribute(JspHelper.CURRENT_CONF); final NameNodeMetrics metrics = NameNode.getNameNodeMetrics();
return; } finally { NameNode.getNameNodeMetrics().addEditLogFetchTime( Time.monotonicNow() - startTime); editsLoaded, lastTxnId)); NameNode.getNameNodeMetrics().addNumEditLogLoaded(editsLoaded);
final NameNodeMetrics metrics = NameNode.getNameNodeMetrics(); if (metrics != null) { metrics.addCacheBlockReport((int) (endTime - startTime));
final PutImageParams parsedParams = new PutImageParams(request, response, conf); final NameNodeMetrics metrics = NameNode.getNameNodeMetrics();
private static INodesInPath createSingleDirectory(FSDirectory fsd, INodesInPath existing, byte[] localName, PermissionStatus perm) throws IOException { assert fsd.hasWriteLock(); existing = unprotectedMkdir(fsd, fsd.allocateNewInodeId(), existing, localName, perm, null, now()); if (existing == null) { return null; } final INode newNode = existing.getLastINode(); // Directory creation also count towards FilesCreated // to match count of FilesDeleted metric. NameNode.getNameNodeMetrics().incrFilesCreated(); String cur = existing.getPath(); fsd.getEditLog().logMkDir(cur, newNode); if (NameNode.stateChangeLog.isDebugEnabled()) { NameNode.stateChangeLog.debug("mkdirs: created directory " + cur); } return existing; }
long startTime = Time.monotonicNow(); try { NameNode.getNameNodeMetrics().addEditLogTailInterval( startTime - lastLoadTimeMs); doTailEdits(); } finally { namesystem.cpUnlock(); NameNode.getNameNodeMetrics().addEditLogTailTime( Time.monotonicNow() - startTime);
block.getGenerationStamp() == storedBlock.getGenerationStamp()) { if (pendingReconstruction.decrement(storedBlock, node)) { NameNode.getNameNodeMetrics().incSuccessfulReReplications();
NameNode.getNameNodeMetrics().incNumTimesReReplicationNotScheduled(); return null; blockLog.debug("BLOCK* Removing {} from neededReconstruction as" + " it has enough replicas", block); NameNode.getNameNodeMetrics().incNumTimesReReplicationNotScheduled(); return null; if (pendingNum > 0) { NameNode.getNameNodeMetrics().incNumTimesReReplicationNotScheduled(); return null;
NameNode.getNameNodeMetrics().addGenerateEDEKTime(generateEDEKTime); Preconditions.checkNotNull(edek); return edek;
NameNode.stateChangeLog.info("STATE* Leaving safe mode after {} secs", timeInSafemode / 1000); NameNode.getNameNodeMetrics().setSafeModeTime(timeInSafemode);
fsd.writeUnlock(); NameNode.getNameNodeMetrics().incrCreateSymlinkOps(); return fsd.getAuditFileInfo(iip);
NameNodeMetrics nnMetrics = NameNode.getNameNodeMetrics(); if (nnMetrics != null) { nnMetrics.setFsImageLoadTime((int) timeTakenToLoadFSImage);
final NameNodeMetrics metrics = NameNode.getNameNodeMetrics(); if (metrics != null) { metrics.addStorageBlockReport((int) (endTime - startTime));
this.namesystem = nn.getNamesystem(); this.retryCache = namesystem.getRetryCache(); this.metrics = NameNode.getNameNodeMetrics();