Skip to content

Commit 3cdb0ba

Browse files
authored
Merge branch 'xlab-uiuc:main' into main
2 parents 2f36a2a + 57708a1 commit 3cdb0ba

File tree

3 files changed

+164
-1
lines changed

3 files changed

+164
-1
lines changed

core/identify_param/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def traceInTestCode(self, trace):
6161
return False
6262

6363
def skipTrace(self, trace):
64-
if trace == "java.lang.Thread":
64+
if "java.lang.Thread" in trace:
6565
return True
6666
if "sun.reflect" in trace:
6767
return True

core/patch/hadoop/interception.patch

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml
2+
index 8a9ba175..470126c0 100644
3+
--- a/hadoop-common-project/hadoop-common/pom.xml
4+
+++ b/hadoop-common-project/hadoop-common/pom.xml
5+
@@ -513,6 +513,7 @@
6+
<plugin>
7+
<groupId>org.apache.maven.plugins</groupId>
8+
<artifactId>maven-surefire-plugin</artifactId>
9+
+ <version>3.0.0-M4</version>
10+
<configuration>
11+
<systemPropertyVariables>
12+
<runningWithNative>${runningWithNative}</runningWithNative>
13+
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
14+
index aedde6b5..24df9481 100755
15+
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
16+
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
17+
@@ -786,6 +786,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
18+
// Add default resources
19+
addDefaultResource("core-default.xml");
20+
addDefaultResource("core-site.xml");
21+
+ addDefaultResource("core-ctest.xml"); //CTEST
22+
23+
// print deprecation warning if hadoop-site.xml is found in classpath
24+
ClassLoader cL = Thread.currentThread().getContextClassLoader();
25+
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
26+
new file mode 100644
27+
index 00000000..d0ff3399
28+
--- /dev/null
29+
+++ b/hadoop-common-project/hadoop-common/src/main/resources/core-ctest.xml
30+
@@ -0,0 +1,6 @@
31+
+<?xml version="1.0"?>
32+
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
33+
+
34+
+<configuration>
35+
+
36+
+</configuration>
37+
diff --git a/pom.xml b/pom.xml
38+
index 74a036e3..bedccf28 100644
39+
--- a/pom.xml
40+
+++ b/pom.xml
41+
@@ -142,6 +142,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
42+
<build>
43+
<pluginManagement>
44+
<plugins>
45+
+ <plugin>
46+
+ <groupId>org.apache.maven.plugins</groupId>
47+
+ <artifactId>maven-surefire-plugin</artifactId>
48+
+ <configuration>
49+
+ <reportFormat>plain</reportFormat>
50+
+ </configuration>
51+
+ </plugin>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-dependency-plugin</artifactId>
55+

core/patch/hadoop/logging.patch

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
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
2+
index 24df9481..6451a97d 100755
3+
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
4+
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
5+
@@ -1196,6 +1196,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
6+
+ MAX_SUBST + " " + expr);
7+
}
8+
9+
+ private String getStackTrace() {
10+
+ String stacktrace = " ";
11+
+ for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
12+
+ stacktrace = stacktrace.concat(element.getClassName() + "\t");
13+
+ }
14+
+ return stacktrace;
15+
+ }
16+
+
17+
String getenv(String name) {
18+
return System.getenv(name);
19+
}
20+
@@ -1220,11 +1228,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
21+
* or null if no such property exists.
22+
*/
23+
public String get(String name) {
24+
+ String ctestParam = name; //CTEST
25+
String[] names = handleDeprecation(deprecationContext.get(), name);
26+
String result = null;
27+
for(String n : names) {
28+
+ ctestParam = n; //CTEST
29+
result = substituteVars(getProps().getProperty(n));
30+
}
31+
+ LOG.warn("[CTEST][GET-PARAM] " + ctestParam); //CTEST
32+
return result;
33+
}
34+
35+
@@ -1312,11 +1323,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
36+
* its replacing property and null if no such property exists.
37+
*/
38+
public String getRaw(String name) {
39+
+ String ctestParam = name; //CTEST
40+
String[] names = handleDeprecation(deprecationContext.get(), name);
41+
String result = null;
42+
for(String n : names) {
43+
+ ctestParam = n; //CTEST
44+
result = getProps().getProperty(n);
45+
}
46+
+ LOG.warn("[CTEST][GET-PARAM] " + ctestParam); //CTEST
47+
return result;
48+
}
49+
50+
@@ -1364,6 +1378,10 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
51+
set(name, value, null);
52+
}
53+
54+
+ public void set(String name, String value, String source) {
55+
+ set(name, value, source, true);
56+
+ }
57+
+
58+
/**
59+
* Set the <code>value</code> of the <code>name</code> property. If
60+
* <code>name</code> is deprecated, it also sets the <code>value</code> to
61+
@@ -1376,7 +1394,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
62+
* (For debugging).
63+
* @throws IllegalArgumentException when the value or name is null.
64+
*/
65+
- public void set(String name, String value, String source) {
66+
+ public void set(String name, String value, String source, boolean log_enabled) {
67+
Preconditions.checkArgument(
68+
name != null,
69+
"Property name must not be null");
70+
@@ -1388,6 +1406,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
71+
if (deprecations.getDeprecatedKeyMap().isEmpty()) {
72+
getProps();
73+
}
74+
+ if(log_enabled) LOG.warn("[CTEST][SET-PARAM] " + name + getStackTrace()); //CTEST
75+
getOverlay().setProperty(name, value);
76+
getProps().setProperty(name, value);
77+
String newSource = (source == null ? "programmatically" : source);
78+
@@ -1398,6 +1417,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
79+
if(altNames != null) {
80+
for(String n: altNames) {
81+
if(!n.equals(name)) {
82+
+ if(log_enabled) LOG.warn("[CTEST][SET-PARAM] " + n + getStackTrace()); //CTEST
83+
getOverlay().setProperty(n, value);
84+
getProps().setProperty(n, value);
85+
putIntoUpdatingResource(n, new String[] {newSource});
86+
@@ -1409,6 +1429,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
87+
String[] names = handleDeprecation(deprecationContext.get(), name);
88+
String altSource = "because " + name + " is deprecated";
89+
for(String n : names) {
90+
+ if(log_enabled) LOG.warn("[CTEST][SET-PARAM] " + n + getStackTrace()); //CTEST
91+
getOverlay().setProperty(n, value);
92+
getProps().setProperty(n, value);
93+
putIntoUpdatingResource(n, new String[] {altSource});
94+
@@ -1481,11 +1502,14 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
95+
* doesn't exist.
96+
*/
97+
public String get(String name, String defaultValue) {
98+
+ String ctestParam = name; //CTEST
99+
String[] names = handleDeprecation(deprecationContext.get(), name);
100+
String result = null;
101+
for(String n : names) {
102+
+ ctestParam = n; //CTEST
103+
result = substituteVars(getProps().getProperty(n, defaultValue));
104+
}
105+
+ LOG.warn("[CTEST][GET-PARAM] " + ctestParam); //CTEST
106+
return result;
107+
}
108+

0 commit comments

Comments
 (0)