Skip to content

Commit b854a4b

Browse files
committed
Reverting HADOOP-9241. To be fixed and reviewed.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1439748 13f79535-47bb-0310-9956-ffa450edef68
1 parent b7d3769 commit b854a4b

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

hadoop-common-project/hadoop-common/CHANGES.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,6 @@ Release 2.0.3-alpha - Unreleased
459459
HADOOP-9231. Parametrize staging URL for the uniformity of
460460
distributionManagement. (Konstantin Boudnik via suresh)
461461

462-
HADOOP-9241. DU refresh interval is not configurable (harsh)
463-
464462
OPTIMIZATIONS
465463

466464
HADOOP-8866. SampleQuantiles#query is O(N^2) instead of O(N). (Andrew Wang

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CommonConfigurationKeysPublic.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ public class CommonConfigurationKeysPublic {
5454
public static final String FS_DF_INTERVAL_KEY = "fs.df.interval";
5555
/** Default value for FS_DF_INTERVAL_KEY */
5656
public static final long FS_DF_INTERVAL_DEFAULT = 60000;
57-
/** See <a href="{@docRoot}/../core-default.html">core-default.xml</a> */
58-
public static final String FS_DU_INTERVAL_KEY = "fs.du.interval";
59-
/** Default value for FS_DU_INTERVAL_KEY */
60-
public static final long FS_DU_INTERVAL_DEFAULT = 60000;
6157

6258

6359
//Defaults are not specified for following keys

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DU.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.apache.hadoop.classification.InterfaceAudience;
2121
import org.apache.hadoop.classification.InterfaceStability;
2222
import org.apache.hadoop.conf.Configuration;
23-
import org.apache.hadoop.fs.CommonConfigurationKeys;
2423
import org.apache.hadoop.util.Shell;
2524

2625
import java.io.BufferedReader;
@@ -65,8 +64,8 @@ public DU(File path, long interval) throws IOException {
6564
* @throws IOException if we fail to refresh the disk usage
6665
*/
6766
public DU(File path, Configuration conf) throws IOException {
68-
this(path, conf.getLong(CommonConfigurationKeys.FS_DU_INTERVAL_KEY,
69-
CommonConfigurationKeys.FS_DU_INTERVAL_DEFAULT));
67+
this(path, 600000L);
68+
//10 minutes default refresh interval
7069
}
7170

7271
/**

hadoop-common-project/hadoop-common/src/main/resources/core-default.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,12 @@
445445
<description>File space usage statistics refresh interval in msec.</description>
446446
</property>
447447

448+
<property>
449+
<name>fs.du.interval</name>
450+
<value>60000</value>
451+
<description>File space usage statistics refresh interval in msec.</description>
452+
</property>
453+
448454
<property>
449455
<name>fs.s3.block.size</name>
450456
<value>67108864</value>

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestDU.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
import java.io.RandomAccessFile;
2525
import java.util.Random;
2626

27-
import org.apache.hadoop.conf.Configuration;
28-
import org.apache.hadoop.fs.CommonConfigurationKeys;
29-
3027
/** This test makes sure that "DU" does not get to run on each call to getUsed */
3128
public class TestDU extends TestCase {
3229
final static private File DU_DIR = new File(
@@ -109,9 +106,7 @@ public void testDU() throws IOException, InterruptedException {
109106
public void testDUGetUsedWillNotReturnNegative() throws IOException {
110107
File file = new File(DU_DIR, "data");
111108
assertTrue(file.createNewFile());
112-
Configuration conf = new Configuration();
113-
conf.setLong(CommonConfigurationKeys.FS_DU_INTERVAL_KEY, 10000L);
114-
DU du = new DU(file, conf);
109+
DU du = new DU(file, 10000);
115110
du.decDfsUsed(Long.MAX_VALUE);
116111
long duSize = du.getUsed();
117112
assertTrue(String.valueOf(duSize), duSize >= 0L);

0 commit comments

Comments
 (0)