Skip to content

Commit

Permalink
Fixed bug JUM-77 :- Performance degradation of debugger jobs after in…
Browse files Browse the repository at this point in the history
…strumentation 1.Removed recursive invocation of method while instrumented logging in debugger. 2.Used inmemory loggig using MemoryMappedIO in log4j2.xml 2.Upgraded log4j2 apis to log4j2.1
  • Loading branch information
ashishdoneriya committed Feb 13, 2015
1 parent 26eb913 commit e12f7a1
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 87 deletions.
8 changes: 4 additions & 4 deletions assembly.xml
Expand Up @@ -45,8 +45,8 @@
<includes>
<include>${project.groupId}:jumbune-deploy</include>
<include>com.jcraft:jsch:jar:0.1.51</include>
<include>org.apache.logging.log4j:log4j-api:jar:2.0</include>
<include>org.apache.logging.log4j:log4j-core:jar:2.0</include>
<include>org.apache.logging.log4j:log4j-api:jar:2.1</include>
<include>org.apache.logging.log4j:log4j-core:jar:2.1</include>
</includes>
</dependencySet>

Expand Down Expand Up @@ -85,8 +85,8 @@
<include>io.netty:netty-common:jar:4.0.20.Final</include>
<include>io.netty:netty-codec:jar:4.0.20.Final</include>
<include>io.netty:netty-transport:jar:4.0.20.Final</include>
<include>org.apache.logging.log4j:log4j-api:jar:2.0</include>
<include>org.apache.logging.log4j:log4j-core:jar:2.0</include>
<include>org.apache.logging.log4j:log4j-api:jar:2.1</include>
<include>org.apache.logging.log4j:log4j-core:jar:2.1</include>
<include>org.apache.poi:poi:jar:3.8:</include>
<include>commons-logging:commons-logging:jar:1.2:</include>
<include>commons-configuration:commons-configuration:jar:1.6:</include>
Expand Down
Expand Up @@ -381,7 +381,7 @@ public static void updateXmlDocumentOnFile(Document doc, String filePath) throws
*/
public static ClasspathElement loadJumbuneSuppliedJarList() throws JumbuneException {
ClasspathElement classpathElement = new ClasspathElement();
String[] files = {"AGENT_HOMElib/jumbune-utils-1.4.1-SNAPSHOT.jar","AGENT_HOMElib/log4j-api-2.0.jar","AGENT_HOMElib/log4j-core-2.0.jar"};
String[] files = {"AGENT_HOMElib/jumbune-utils-1.4.1-SNAPSHOT.jar","AGENT_HOMElib/log4j-api-2.1.jar","AGENT_HOMElib/log4j-core-2.1.jar"};
classpathElement.setFiles(files);
classpathElement.setSource(-1);
return classpathElement;
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/org/jumbune/common/utils/Constants.java
Expand Up @@ -77,10 +77,10 @@ public interface Constants {
String JOB_JARS_LOC = "jobJars/";

/** The LO g4 j2_ ap i_ jar. */
String LOG4J2_API_JAR = "/lib/log4j-api-2.0.jar";
String LOG4J2_API_JAR = "/lib/log4j-api-2.1.jar";

/** The LO g4 j2_ cor e_ jar. */
String LOG4J2_CORE_JAR = "/lib/log4j-core-2.0.jar";
String LOG4J2_CORE_JAR = "/lib/log4j-core-2.1.jar";

/** The echo agent home. */
String ECHO_AGENT_HOME = "echo $AGENT_HOME \n \n";
Expand Down
Expand Up @@ -112,6 +112,9 @@ public Map<String, JobBean> analyzeLogs(final String nodeIP,
while ((line = bufferedReader.readLine()) != null) {

// parses the line and stores the result in lineMap
if(line==null || line.trim().isEmpty()){
continue;
}
parseLine(line,props);

if ((LPConstants.NOT_AVAILABLE.equals(currentExpCounter))
Expand Down Expand Up @@ -1026,4 +1029,4 @@ private void addJobLevelCounters(AbstractLogAnalysisBean logAnalysisBean,
logAnalysisBean.setTotalUnmatchedValues(totalUnmatchedValues);
}

}
}
Expand Up @@ -318,7 +318,7 @@ else if (LPConstants.JOB_CHAIN.equals(chainResult)) {
String line = null;
while (true) {
line = bufferedReader.readLine();
if (line == null) {
if (line == null || line.trim().isEmpty()) {
break;
}
ChainingInfoBean chainingInfoBean = new ChainingInfoBean();
Expand Down Expand Up @@ -387,7 +387,7 @@ private Map<String, Map<String, List<String>>> makeJobWiseList(Map<String, Map<S
String line = null;
while (true) {
line = bufferedReader.readLine();
if (line == null) {
if (line == null || line.trim().isEmpty()) {
break;
}

Expand Down Expand Up @@ -868,4 +868,4 @@ private String getReduceNameFromChainList(
public static Properties getSystemTable(){
return props;
}
}
}
Expand Up @@ -43,8 +43,8 @@ public final class SessionEstablisher {
private static List<String> jars = new ArrayList<String>(2);

static {
jars.add("/lib/log4j-api-2.0.jar");
jars.add("/lib/log4j-core-2.0.jar");
jars.add("/lib/log4j-api-2.1.jar");
jars.add("/lib/log4j-core-2.1.jar");
}
public SessionEstablisher(Deployer deployer){
this.deployerInstance = deployer;
Expand Down
4 changes: 2 additions & 2 deletions examples/debugger/bankdefaulters/pom.xml
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>

<dependency>
Expand All @@ -32,7 +32,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
4 changes: 2 additions & 2 deletions examples/debugger/clickstreamanalysis/pom.xml
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>

<dependency>
Expand All @@ -32,7 +32,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
4 changes: 2 additions & 2 deletions examples/debugger/pom.xml
Expand Up @@ -21,14 +21,14 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>


<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
4 changes: 2 additions & 2 deletions examples/debugger/usregionportouts/pom.xml
Expand Up @@ -20,14 +20,14 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>


<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
4 changes: 2 additions & 2 deletions examples/profiling/movierating/pom.xml
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand All @@ -30,7 +30,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
Expand Down
4 changes: 2 additions & 2 deletions examples/profiling/pom.xml
Expand Up @@ -21,14 +21,14 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>


<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
4 changes: 2 additions & 2 deletions examples/wordcount/pom.xml
Expand Up @@ -20,14 +20,14 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>


<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -248,14 +248,14 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>


<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0</version>
<version>2.1</version>
</dependency>


Expand Down
4 changes: 2 additions & 2 deletions remoting/remotingassembly.xml
Expand Up @@ -14,8 +14,8 @@
<useTransitiveDependencies>false</useTransitiveDependencies>
<includes>

<include>org.apache.logging.log4j:log4j-api:jar:2.0</include>
<include>org.apache.logging.log4j:log4j-core:jar:2.0</include>
<include>org.apache.logging.log4j:log4j-api:jar:2.1</include>
<include>org.apache.logging.log4j:log4j-core:jar:2.1</include>
<include>io.netty:netty-handler:jar:4.0.20.Final</include>
<include>io.netty:netty-buffer:jar:4.0.20.Final</include>
<include>io.netty:netty-common:jar:4.0.20.Final</include>
Expand Down
Expand Up @@ -107,8 +107,8 @@ public final class JumbuneAgent {
private JumbuneAgent() {
}
static {
jars.add("/lib/log4j-api-2.0.jar");
jars.add("/lib/log4j-core-2.0.jar");
jars.add("/lib/log4j-api-2.1.jar");
jars.add("/lib/log4j-core-2.1.jar");
}

/**
Expand Down Expand Up @@ -569,4 +569,4 @@ private static void shutTopCmdOnSlaves(BasicYamlConfig config) {
}
}

}
}
4 changes: 2 additions & 2 deletions utilities/src/main/java/org/jumbune/utils/LogUtil.java
Expand Up @@ -319,12 +319,12 @@ private static void getLogMsg(Object... msgParts) {
StringBuilder msg = new StringBuilder();

for (Object msgPart : msgParts) {
msg.append(separateMessage(msgPart));
msg.append(DEFAULT_MESSAGE_SEPARATOR).append(msgPart);
}

// add fillers
for (int i = MAX_VALUES_IN_LOG - msgParts.length; i > 0; i--) {
msg.append(separateMessage(UtilitiesConstants.EMPTY_STRING));
msg.append(DEFAULT_MESSAGE_SEPARATOR).append(UtilitiesConstants.EMPTY_STRING);
}

logMessage(LoggerUtil.getMapReduceLogger(MapReduceExecutionUtil
Expand Down

0 comments on commit e12f7a1

Please sign in to comment.