HDFS-9024. Deprecate the TotalFiles metric. Contributed by Akira Ahisaka.

This commit is contained in:
Haohui Mai 2015-11-22 23:02:50 -08:00
parent 04c14b5dc4
commit 8228697857
5 changed files with 10 additions and 3 deletions

View File

@ -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 | | `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 | | `BlockCapacity` | Current number of block capacity |
| `StaleDataNodes` | Current number of DataNodes marked stale due to delayed heartbeat | | `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 | | `MissingReplOneBlocks` | Current number of missing blocks with replication factor 1 |
| `NumFilesUnderConstruction` | Current number of files under construction | | `NumFilesUnderConstruction` | Current number of files under construction |
| `NumActiveClients` | Current number of active clients holding lease | | `NumActiveClients` | Current number of active clients holding lease |

View File

@ -2351,6 +2351,8 @@ Release 2.8.0 - UNRELEASED
HDFS-9356. Decommissioning node does not have Last Contact value in the UI. HDFS-9356. Decommissioning node does not have Last Contact value in the UI.
(Surendra Singh Lilhore via wheat9) (Surendra Singh Lilhore via wheat9)
HDFS-9024. Deprecate the TotalFiles metric. (Akira Ajisaka via wheat9)
Release 2.7.3 - UNRELEASED Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -145,7 +145,7 @@ public class FSImage implements Closeable {
} }
void format(FSNamesystem fsn, String clusterId) throws IOException { void format(FSNamesystem fsn, String clusterId) throws IOException {
long fileCount = fsn.getTotalFiles(); long fileCount = fsn.getFilesTotal();
// Expect 1 file, which is the root inode // Expect 1 file, which is the root inode
Preconditions.checkState(fileCount == 1, Preconditions.checkState(fileCount == 1,
"FSImage.format should be called with an uninitialized namesystem, has " + "FSImage.format should be called with an uninitialized namesystem, has " +

View File

@ -6001,6 +6001,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
return getBlocksTotal(); return getBlocksTotal();
} }
/** @deprecated Use {@link #getFilesTotal()} instead. */
@Deprecated
@Override // NameNodeMXBean @Override // NameNodeMXBean
@Metric @Metric
public long getTotalFiles() { public long getTotalFiles() {

View File

@ -142,7 +142,10 @@ public interface NameNodeMXBean {
* Gets the total number of files on the cluster * Gets the total number of files on the cluster
* *
* @return 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(); public long getTotalFiles();
/** /**