-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add patch folder to support PR from CS527 students
- Loading branch information
Showing
2 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml | ||
index 8a9ba175..470126c0 100644 | ||
--- a/hadoop-common-project/hadoop-common/pom.xml | ||
+++ b/hadoop-common-project/hadoop-common/pom.xml | ||
@@ -513,6 +513,7 @@ | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
+ <version>3.0.0-M4</version> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<runningWithNative>${runningWithNative}</runningWithNative> | ||
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java | ||
index aedde6b5..24df9481 100755 | ||
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java | ||
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java | ||
@@ -786,6 +786,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
// Add default resources | ||
addDefaultResource("core-default.xml"); | ||
addDefaultResource("core-site.xml"); | ||
+ addDefaultResource("core-ctest.xml"); //CTEST | ||
|
||
// print deprecation warning if hadoop-site.xml is found in classpath | ||
ClassLoader cL = Thread.currentThread().getContextClassLoader(); | ||
diff --git a/hadoop-common-project/hadoop-common/src/main/resources/core-ctest.xml b/hadoop-common-project/hadoop-common/src/main/resources/core-ctest.xml | ||
new file mode 100644 | ||
index 00000000..d0ff3399 | ||
--- /dev/null | ||
+++ b/hadoop-common-project/hadoop-common/src/main/resources/core-ctest.xml | ||
@@ -0,0 +1,6 @@ | ||
+<?xml version="1.0"?> | ||
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> | ||
+ | ||
+<configuration> | ||
+ | ||
+</configuration> | ||
diff --git a/pom.xml b/pom.xml | ||
index 74a036e3..bedccf28 100644 | ||
--- a/pom.xml | ||
+++ b/pom.xml | ||
@@ -142,6 +142,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x | ||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
+ <plugin> | ||
+ <groupId>org.apache.maven.plugins</groupId> | ||
+ <artifactId>maven-surefire-plugin</artifactId> | ||
+ <configuration> | ||
+ <reportFormat>plain</reportFormat> | ||
+ </configuration> | ||
+ </plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java | ||
index 24df9481..6451a97d 100755 | ||
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java | ||
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java | ||
@@ -1196,6 +1196,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
+ MAX_SUBST + " " + expr); | ||
} | ||
|
||
+ private String getStackTrace() { | ||
+ String stacktrace = " "; | ||
+ for (StackTraceElement element : Thread.currentThread().getStackTrace()) { | ||
+ stacktrace = stacktrace.concat(element.getClassName() + "\t"); | ||
+ } | ||
+ return stacktrace; | ||
+ } | ||
+ | ||
String getenv(String name) { | ||
return System.getenv(name); | ||
} | ||
@@ -1220,11 +1228,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
* or null if no such property exists. | ||
*/ | ||
public String get(String name) { | ||
+ String ctestParam = name; //CTEST | ||
String[] names = handleDeprecation(deprecationContext.get(), name); | ||
String result = null; | ||
for(String n : names) { | ||
+ ctestParam = n; //CTEST | ||
result = substituteVars(getProps().getProperty(n)); | ||
} | ||
+ LOG.warn("[CTEST][GET-PARAM] " + ctestParam); //CTEST | ||
return result; | ||
} | ||
|
||
@@ -1312,11 +1323,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
* its replacing property and null if no such property exists. | ||
*/ | ||
public String getRaw(String name) { | ||
+ String ctestParam = name; //CTEST | ||
String[] names = handleDeprecation(deprecationContext.get(), name); | ||
String result = null; | ||
for(String n : names) { | ||
+ ctestParam = n; //CTEST | ||
result = getProps().getProperty(n); | ||
} | ||
+ LOG.warn("[CTEST][GET-PARAM] " + ctestParam); //CTEST | ||
return result; | ||
} | ||
|
||
@@ -1364,6 +1378,10 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
set(name, value, null); | ||
} | ||
|
||
+ public void set(String name, String value, String source) { | ||
+ set(name, value, source, true); | ||
+ } | ||
+ | ||
/** | ||
* Set the <code>value</code> of the <code>name</code> property. If | ||
* <code>name</code> is deprecated, it also sets the <code>value</code> to | ||
@@ -1376,7 +1394,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
* (For debugging). | ||
* @throws IllegalArgumentException when the value or name is null. | ||
*/ | ||
- public void set(String name, String value, String source) { | ||
+ public void set(String name, String value, String source, boolean log_enabled) { | ||
Preconditions.checkArgument( | ||
name != null, | ||
"Property name must not be null"); | ||
@@ -1388,6 +1406,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
if (deprecations.getDeprecatedKeyMap().isEmpty()) { | ||
getProps(); | ||
} | ||
+ if(log_enabled) LOG.warn("[CTEST][SET-PARAM] " + name + getStackTrace()); //CTEST | ||
getOverlay().setProperty(name, value); | ||
getProps().setProperty(name, value); | ||
String newSource = (source == null ? "programmatically" : source); | ||
@@ -1398,6 +1417,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
if(altNames != null) { | ||
for(String n: altNames) { | ||
if(!n.equals(name)) { | ||
+ if(log_enabled) LOG.warn("[CTEST][SET-PARAM] " + n + getStackTrace()); //CTEST | ||
getOverlay().setProperty(n, value); | ||
getProps().setProperty(n, value); | ||
putIntoUpdatingResource(n, new String[] {newSource}); | ||
@@ -1409,6 +1429,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
String[] names = handleDeprecation(deprecationContext.get(), name); | ||
String altSource = "because " + name + " is deprecated"; | ||
for(String n : names) { | ||
+ if(log_enabled) LOG.warn("[CTEST][SET-PARAM] " + n + getStackTrace()); //CTEST | ||
getOverlay().setProperty(n, value); | ||
getProps().setProperty(n, value); | ||
putIntoUpdatingResource(n, new String[] {altSource}); | ||
@@ -1481,11 +1502,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>, | ||
* doesn't exist. | ||
*/ | ||
public String get(String name, String defaultValue) { | ||
+ String ctestParam = name; //CTEST | ||
String[] names = handleDeprecation(deprecationContext.get(), name); | ||
String result = null; | ||
for(String n : names) { | ||
+ ctestParam = n; //CTEST | ||
result = substituteVars(getProps().getProperty(n, defaultValue)); | ||
} | ||
+ LOG.warn("[CTEST][GET-PARAM] " + ctestParam); //CTEST | ||
return result; | ||
} | ||
|