Repository: hadoop Updated Branches: refs/heads/trunk 04c14b5dc -> 822869785
HDFS-9024. Deprecate the TotalFiles metric. Contributed by Akira Ahisaka. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/82286978 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/82286978 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/82286978 Branch: refs/heads/trunk Commit: 822869785707b5665962ec0c699cd383dc767345 Parents: 04c14b5 Author: Haohui Mai <[email protected]> Authored: Sun Nov 22 23:02:50 2015 -0800 Committer: Haohui Mai <[email protected]> Committed: Sun Nov 22 23:02:50 2015 -0800 ---------------------------------------------------------------------- .../hadoop-common/src/site/markdown/Metrics.md | 2 +- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../java/org/apache/hadoop/hdfs/server/namenode/FSImage.java | 2 +- .../org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 2 ++ .../org/apache/hadoop/hdfs/server/namenode/NameNodeMXBean.java | 5 ++++- 5 files changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/82286978/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md b/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md index 2e24aba..9e02ffa 100644 --- a/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md +++ b/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md @@ -231,7 +231,7 @@ Each metrics record contains tags such as HAState and Hostname as additional inf | `MillisSinceLastLoadedEdits` | (HA-only) Time in milliseconds since the last time standby NameNode load edit log. In active NameNode, set to 0 | | `BlockCapacity` | Current number of block capacity | | `StaleDataNodes` | Current number of DataNodes marked stale due to delayed heartbeat | -| `TotalFiles` | Current number of files and directories (same as FilesTotal) | +| `TotalFiles` | Deprecated: Use FilesTotal instead | | `MissingReplOneBlocks` | Current number of missing blocks with replication factor 1 | | `NumFilesUnderConstruction` | Current number of files under construction | | `NumActiveClients` | Current number of active clients holding lease | http://git-wip-us.apache.org/repos/asf/hadoop/blob/82286978/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 4ce94a8..2b56361 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -2351,6 +2351,8 @@ Release 2.8.0 - UNRELEASED HDFS-9356. Decommissioning node does not have Last Contact value in the UI. (Surendra Singh Lilhore via wheat9) + HDFS-9024. Deprecate the TotalFiles metric. (Akira Ajisaka via wheat9) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/82286978/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java index 341dd98..dedbb32 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java @@ -145,7 +145,7 @@ public class FSImage implements Closeable { } void format(FSNamesystem fsn, String clusterId) throws IOException { - long fileCount = fsn.getTotalFiles(); + long fileCount = fsn.getFilesTotal(); // Expect 1 file, which is the root inode Preconditions.checkState(fileCount == 1, "FSImage.format should be called with an uninitialized namesystem, has " + http://git-wip-us.apache.org/repos/asf/hadoop/blob/82286978/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index e86ff96..8d77630 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -6001,6 +6001,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean, return getBlocksTotal(); } + /** @deprecated Use {@link #getFilesTotal()} instead. */ + @Deprecated @Override // NameNodeMXBean @Metric public long getTotalFiles() { http://git-wip-us.apache.org/repos/asf/hadoop/blob/82286978/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeMXBean.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeMXBean.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeMXBean.java index d127c98..3f78155 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeMXBean.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeMXBean.java @@ -140,9 +140,12 @@ public interface NameNodeMXBean { /** * Gets the total number of files on the cluster - * + * * @return the total number of files on the cluster + * @deprecated Use + * {@link org.apache.hadoop.hdfs.server.namenode.metrics.FSNamesystemMBean#getFilesTotal()} instead. */ + @Deprecated public long getTotalFiles(); /**
