|
@@ -296,6 +296,7 @@ public class NameNode implements ClientProtocol, DatanodeProtocol,
|
|
|
null, masked),
|
|
|
clientName, clientMachine, overwrite, replication, blockSize);
|
|
|
myMetrics.numFilesCreated.inc();
|
|
|
+ myMetrics.numCreateFileOps.inc();
|
|
|
}
|
|
|
|
|
|
/** Coming in a future release.... */
|
|
@@ -336,7 +337,10 @@ public class NameNode implements ClientProtocol, DatanodeProtocol,
|
|
|
String clientName) throws IOException {
|
|
|
stateChangeLog.debug("*BLOCK* NameNode.addBlock: file "
|
|
|
+src+" for "+clientName);
|
|
|
- return namesystem.getAdditionalBlock(src, clientName);
|
|
|
+ LocatedBlock locatedBlock = namesystem.getAdditionalBlock(src, clientName);
|
|
|
+ if (locatedBlock != null)
|
|
|
+ myMetrics.numAddBlockOps.inc();
|
|
|
+ return locatedBlock;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -428,7 +432,10 @@ public class NameNode implements ClientProtocol, DatanodeProtocol,
|
|
|
stateChangeLog.debug("*DIR* Namenode.delete: src=" + src
|
|
|
+ ", recursive=" + recursive);
|
|
|
}
|
|
|
- return namesystem.delete(src, recursive);
|
|
|
+ boolean ret = namesystem.delete(src, recursive);
|
|
|
+ if (ret)
|
|
|
+ myMetrics.numDeleteFileOps.inc();
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -466,7 +473,7 @@ public class NameNode implements ClientProtocol, DatanodeProtocol,
|
|
|
public DFSFileInfo[] getListing(String src) throws IOException {
|
|
|
DFSFileInfo[] files = namesystem.getListing(src);
|
|
|
if (files != null) {
|
|
|
- myMetrics.numFilesListed.inc(files.length);
|
|
|
+ myMetrics.numGetListingOps.inc();
|
|
|
}
|
|
|
return files;
|
|
|
}
|