Revert HADOOP-9241 from branch-2 as well.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1439772 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Harsh J 2013-01-29 08:01:50 +00:00
parent 6f146b15d3
commit e743b0520d
5 changed files with 3 additions and 21 deletions

View File

@ -132,8 +132,6 @@ Release 2.0.3-alpha - Unreleased
HADOOP-9231. Parametrize staging URL for the uniformity of HADOOP-9231. Parametrize staging URL for the uniformity of
distributionManagement. (Konstantin Boudnik via suresh) distributionManagement. (Konstantin Boudnik via suresh)
HADOOP-9241. DU refresh interval is not configurable (harsh)
HADOOP-9247. Parametrize Clover "generateXxx" properties to make them HADOOP-9247. Parametrize Clover "generateXxx" properties to make them
re-definable via -D in mvn calls. (Ivan A. Veselovsky via suresh) re-definable via -D in mvn calls. (Ivan A. Veselovsky via suresh)

View File

@ -54,10 +54,6 @@ public class CommonConfigurationKeysPublic {
public static final String FS_DF_INTERVAL_KEY = "fs.df.interval"; public static final String FS_DF_INTERVAL_KEY = "fs.df.interval";
/** Default value for FS_DF_INTERVAL_KEY */ /** Default value for FS_DF_INTERVAL_KEY */
public static final long FS_DF_INTERVAL_DEFAULT = 60000; public static final long FS_DF_INTERVAL_DEFAULT = 60000;
/** See <a href="{@docRoot}/../core-default.html">core-default.xml</a> */
public static final String FS_DU_INTERVAL_KEY = "fs.du.interval";
/** Default value for FS_DU_INTERVAL_KEY */
public static final long FS_DU_INTERVAL_DEFAULT = 60000;
//Defaults are not specified for following keys //Defaults are not specified for following keys

View File

@ -20,7 +20,6 @@ package org.apache.hadoop.fs;
import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
import org.apache.hadoop.util.Shell; import org.apache.hadoop.util.Shell;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -65,8 +64,8 @@ public class DU extends Shell {
* @throws IOException if we fail to refresh the disk usage * @throws IOException if we fail to refresh the disk usage
*/ */
public DU(File path, Configuration conf) throws IOException { public DU(File path, Configuration conf) throws IOException {
this(path, conf.getLong(CommonConfigurationKeys.FS_DU_INTERVAL_KEY, this(path, 600000L);
CommonConfigurationKeys.FS_DU_INTERVAL_DEFAULT)); //10 minutes default refresh interval
} }
/** /**

View File

@ -431,12 +431,6 @@
<description>Disk usage statistics refresh interval in msec.</description> <description>Disk usage statistics refresh interval in msec.</description>
</property> </property>
<property>
<name>fs.du.interval</name>
<value>60000</value>
<description>File space usage statistics refresh interval in msec.</description>
</property>
<property> <property>
<name>fs.s3.block.size</name> <name>fs.s3.block.size</name>
<value>67108864</value> <value>67108864</value>

View File

@ -24,9 +24,6 @@ import java.io.IOException;
import java.io.RandomAccessFile; import java.io.RandomAccessFile;
import java.util.Random; import java.util.Random;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CommonConfigurationKeys;
/** This test makes sure that "DU" does not get to run on each call to getUsed */ /** This test makes sure that "DU" does not get to run on each call to getUsed */
public class TestDU extends TestCase { public class TestDU extends TestCase {
final static private File DU_DIR = new File( final static private File DU_DIR = new File(
@ -109,9 +106,7 @@ public class TestDU extends TestCase {
public void testDUGetUsedWillNotReturnNegative() throws IOException { public void testDUGetUsedWillNotReturnNegative() throws IOException {
File file = new File(DU_DIR, "data"); File file = new File(DU_DIR, "data");
assertTrue(file.createNewFile()); assertTrue(file.createNewFile());
Configuration conf = new Configuration(); DU du = new DU(file, 10000);
conf.setLong(CommonConfigurationKeys.FS_DU_INTERVAL_KEY, 10000L);
DU du = new DU(file, conf);
du.decDfsUsed(Long.MAX_VALUE); du.decDfsUsed(Long.MAX_VALUE);
long duSize = du.getUsed(); long duSize = du.getUsed();
assertTrue(String.valueOf(duSize), duSize >= 0L); assertTrue(String.valueOf(duSize), duSize >= 0L);