Skip to content

Commit e2a4822

Browse files
committed
HDFS-17172. Fix checkstytle
1 parent e10a62f commit e2a4822

2 files changed

Lines changed: 28 additions & 29 deletions

File tree

  • hadoop-hdfs-project/hadoop-hdfs/src

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,35 +2754,35 @@ private String reconfigureFSNamesystemLockMetricsParameters(final String propert
27542754
String result;
27552755
try {
27562756
switch (property) {
2757-
case DFS_NAMENODE_LOCK_DETAILED_METRICS_KEY: {
2758-
if (newVal != null && !newVal.equalsIgnoreCase("true") &&
2759-
!newVal.equalsIgnoreCase("false")) {
2760-
throw new IllegalArgumentException(newVal + " is not boolean value");
2761-
}
2762-
boolean enable = (newVal == null ?
2763-
DFS_NAMENODE_LOCK_DETAILED_METRICS_DEFAULT : Boolean.parseBoolean(newVal));
2764-
result = Boolean.toString(enable);
2765-
namesystem.setMetricsEnabled(enable);
2766-
break;
2767-
}
2768-
case DFS_NAMENODE_READ_LOCK_REPORTING_THRESHOLD_MS_KEY: {
2769-
long readLockReportingThresholdMs = (newVal == null ?
2770-
DFS_NAMENODE_READ_LOCK_REPORTING_THRESHOLD_MS_DEFAULT : Long.parseLong(newVal));
2771-
result = Long.toString(readLockReportingThresholdMs);
2772-
namesystem.setReadLockReportingThresholdMs(readLockReportingThresholdMs);
2773-
break;
2774-
}
2775-
case DFS_NAMENODE_WRITE_LOCK_REPORTING_THRESHOLD_MS_KEY: {
2776-
long writeLockReportingThresholdMs = (newVal == null ?
2777-
DFS_NAMENODE_WRITE_LOCK_REPORTING_THRESHOLD_MS_DEFAULT : Long.parseLong(newVal));
2778-
result = Long.toString(writeLockReportingThresholdMs);
2779-
namesystem.setWriteLockReportingThresholdMs(writeLockReportingThresholdMs);
2780-
break;
2781-
}
2782-
default: {
2783-
throw new IllegalArgumentException("Unexpected property " + property + " in " +
2784-
"reconfigureFSNamesystemLockMetricsParameters");
2757+
case DFS_NAMENODE_LOCK_DETAILED_METRICS_KEY: {
2758+
if (newVal != null && !newVal.equalsIgnoreCase("true") &&
2759+
!newVal.equalsIgnoreCase("false")) {
2760+
throw new IllegalArgumentException(newVal + " is not boolean value");
27852761
}
2762+
boolean enable = (newVal == null ?
2763+
DFS_NAMENODE_LOCK_DETAILED_METRICS_DEFAULT : Boolean.parseBoolean(newVal));
2764+
result = Boolean.toString(enable);
2765+
namesystem.setMetricsEnabled(enable);
2766+
break;
2767+
}
2768+
case DFS_NAMENODE_READ_LOCK_REPORTING_THRESHOLD_MS_KEY: {
2769+
long readLockReportingThresholdMs = (newVal == null ?
2770+
DFS_NAMENODE_READ_LOCK_REPORTING_THRESHOLD_MS_DEFAULT : Long.parseLong(newVal));
2771+
result = Long.toString(readLockReportingThresholdMs);
2772+
namesystem.setReadLockReportingThresholdMs(readLockReportingThresholdMs);
2773+
break;
2774+
}
2775+
case DFS_NAMENODE_WRITE_LOCK_REPORTING_THRESHOLD_MS_KEY: {
2776+
long writeLockReportingThresholdMs = (newVal == null ?
2777+
DFS_NAMENODE_WRITE_LOCK_REPORTING_THRESHOLD_MS_DEFAULT : Long.parseLong(newVal));
2778+
result = Long.toString(writeLockReportingThresholdMs);
2779+
namesystem.setWriteLockReportingThresholdMs(writeLockReportingThresholdMs);
2780+
break;
2781+
}
2782+
default: {
2783+
throw new IllegalArgumentException("Unexpected property " + property + " in " +
2784+
"reconfigureFSNamesystemLockMetricsParameters");
2785+
}
27862786
}
27872787
LOG.info("RECONFIGURE* changed FSNamesystemLockMetricsParameters {} to {}", property, result);
27882788
return result;

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDFSAdmin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@
100100
import org.slf4j.LoggerFactory;
101101

102102
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_NAMENODE_LOCK_DETAILED_METRICS_KEY;
103-
import static org.apache.hadoop.hdfs.DFSConfigKeys.DFS_NAMENODE_MAX_SLOWPEER_COLLECT_NODES_KEY;
104103
import static org.apache.hadoop.hdfs.client.HdfsAdmin.TRASH_PERMISSION;
105104
import static org.hamcrest.CoreMatchers.allOf;
106105
import static org.hamcrest.CoreMatchers.anyOf;

0 commit comments

Comments
 (0)