/** {@inheritDoc} */ public void setOwner(String src, String username, String groupname ) throws IOException { namesystem.setOwner(src, username, groupname); myMetrics.numSetOwner.inc(); }
/** */ public FileStatus[] getListing(String src) throws IOException { FileStatus[] files = namesystem.getListing(src); if (files != null) { myMetrics.numGetListingOps.inc(); } return files; }
@Override public HdfsFileStatus[] getHdfsListing(String src) throws IOException { HdfsFileStatus[] files = namesystem.getHdfsListing(src); if (files != null) { myMetrics.numGetListingOps.inc(); } return files; }
/** {@inheritDoc} */ public void setPermission(String src, FsPermission permissions ) throws IOException { namesystem.setPermission(src, permissions); myMetrics.numSetPermission.inc(); }
/** {@inheritDoc} */ public boolean delete(String src, boolean recursive) throws IOException { if (stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* Namenode.delete: src=" + src + ", recursive=" + recursive); } boolean ret = namesystem.delete(src, recursive); if (ret) myMetrics.numDeleteFileOps.inc(); return ret; }
/** {@inheritDoc} */ public boolean setReplication(String src, short replication ) throws IOException { boolean value = namesystem.setReplication(src, replication); if (value) { myMetrics.numSetReplication.inc(); } return value; }
/** {@inheritDoc} */ public long nextGenerationStamp(Block block, boolean fromNN) throws IOException{ myMetrics.numNextGenerationStamp.inc(); return namesystem.nextGenerationStampForBlock(block, fromNN); }
/** */ public void renewLease(String clientName) throws IOException { myMetrics.numRenewLease.inc(); namesystem.renewLease(clientName); }
/** * Get the file info for a specific file. * @param src The string representation of the path to the file * @throws IOException if permission to access file is denied by the system * @return object containing information regarding the file * or null if file not found */ public FileStatus getFileInfo(String src) throws IOException { myMetrics.numFileInfoOps.inc(); return namesystem.getFileInfo(src); }
@Override public HdfsFileStatus getHdfsFileInfo(String src) throws IOException { HdfsFileStatus value = namesystem.getHdfsFileInfo(src); myMetrics.numFileInfoOps.inc(); return value; }
/** {@inheritDoc} */ public void setQuota(String path, long namespaceQuota, long diskspaceQuota) throws IOException { namesystem.setQuota(path, namespaceQuota, diskspaceQuota); myMetrics.numSetQuota.inc(); }
/** @inheritDoc */ public void setTimes(String src, long mtime, long atime) throws IOException { namesystem.setTimes(src, mtime, atime); myMetrics.numSetTimes.inc(); }
private void incErrorCounts(TaskError error, TaskTracker tt, long now) { Map<TaskError, Integer> current = getCurrentErrorCounts(now); current.put(error, current.get(error) + 1); errorCountsMetrics.get(error).inc(); sinceStartErrorCounts.put(error, sinceStartErrorCounts.get(error) + 1); }
private LocatedBlock appendInternal(String src, String clientName, BlockMetaInfoType type) throws IOException { String clientMachine = getClientMachine(); if (stateChangeLog.isDebugEnabled()) { stateChangeLog.debug("*DIR* NameNode.append: file " +src+" for "+clientName+" at "+clientMachine); } LocatedBlock info = namesystem.appendFile(src, clientName, clientMachine, type); myMetrics.numFilesAppended.inc(); return info; }
public VersionedLocatedBlocks open(String src, long offset, long length) throws IOException { myMetrics.numGetBlockLocations.inc(); return (VersionedLocatedBlocks)namesystem.getBlockLocations( getClientMachine(), src, offset, length, BlockMetaInfoType.VERSION); }
public LocatedBlocksWithMetaInfo openAndFetchMetaInfo(String src, long offset, long length) throws IOException { myMetrics.numGetBlockLocations.inc(); return (LocatedBlocksWithMetaInfo)namesystem.getBlockLocations( getClientMachine(), src, offset, length, BlockMetaInfoType.VERSION_AND_NAMESPACEID); }
@Override public void blockReceivedAndDeleted(DatanodeRegistration nodeReg, Block receivedAndDeletedBlocks[]) throws IOException { verifyRequest(nodeReg); myMetrics.numBlockReceived.inc(); namesystem.blockReceivedAndDeleted(nodeReg, receivedAndDeletedBlocks); }
@Override public void blockReceivedAndDeleted(DatanodeRegistration nodeReg, IncrementalBlockReport receivedAndDeletedBlocks) throws IOException { verifyRequest(nodeReg); myMetrics.numBlockReceived.inc(); namesystem.blockReceivedAndDeleted(nodeReg, receivedAndDeletedBlocks); }
/** */ @Override public DatanodeRegistration register(DatanodeRegistration nodeReg ) throws IOException { verifyVersion(nodeReg.getVersion(), LAYOUT_VERSION, "layout"); namesystem.registerDatanode(nodeReg); myMetrics.numRegister.inc(); return nodeReg; }
protected Collection<Block> blockReportWithRetries( DatanodeRegistration nodeReg, BlockReport blocks) throws IOException { verifyRequest(nodeReg); myMetrics.numBlockReport.inc(); BlockListAsLongs blist = new BlockListAsLongs(blocks.getBlockReportInLongs()); stateChangeLog.debug("*BLOCK* NameNode.blockReport: " + "from " + nodeReg.getName() + " " + blist.getNumberOfBlocks() + " blocks"); return namesystem.processReport(nodeReg, blist); }