You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by ac...@apache.org on 2013/05/09 07:43:53 UTC
git commit: updated refs/heads/trunk to 5782139
Updated Branches:
refs/heads/trunk bc066fa43 -> 57821392a
GIRAPH-665: Reduce ZooKeeper output in tests by changing log level from INFO to ERROR (aching)
Project: http://git-wip-us.apache.org/repos/asf/giraph/repo
Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/57821392
Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/57821392
Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/57821392
Branch: refs/heads/trunk
Commit: 57821392a9dedafe3f6cc02d89ebd5624ba1a7e1
Parents: bc066fa
Author: Avery Ching <ac...@fb.com>
Authored: Wed May 8 14:36:45 2013 -0700
Committer: Avery Ching <ac...@fb.com>
Committed: Wed May 8 22:43:34 2013 -0700
----------------------------------------------------------------------
CHANGELOG | 3 +
.../org/apache/giraph/graph/GraphTaskManager.java | 55 ++++++++-------
.../src/test/java/org/apache/giraph/BspCase.java | 4 +-
3 files changed, 36 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/giraph/blob/57821392/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 14ec5a6..947f12d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,9 @@
Giraph Change Log
Release 1.1.0 - unreleased
+ GIRAPH-665: Reduce ZooKeeper output in tests by changing log level from
+ INFO to ERROR (aching)
+
GIRAPH-664: Bump HiveIO dep - fixes tests with hadoop facebook
(nitayj via majakabiljo)
http://git-wip-us.apache.org/repos/asf/giraph/blob/57821392/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java b/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
index 5dbf977..9caf1b9 100644
--- a/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
+++ b/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
@@ -54,6 +54,7 @@ import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.log4j.Appender;
import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
@@ -593,37 +594,35 @@ public class GraphTaskManager<I extends WritableComparable, V extends Writable,
*/
private void locateZookeeperClasspath(Path[] fileClassPaths)
throws IOException {
- if (!conf.getLocalTestMode()) {
- String zkClasspath = null;
- if (fileClassPaths == null) {
- if (LOG.isInfoEnabled()) {
- LOG.info("Distributed cache is empty. Assuming fatjar.");
- }
- String jarFile = context.getJar();
- if (jarFile == null) {
- jarFile = findContainingJar(getClass());
- }
- // Pure YARN profiles will use unpacked resources, so calls
- // to "findContainingJar()" in that context can return NULL!
- zkClasspath = null == jarFile ?
+ String zkClasspath = null;
+ if (fileClassPaths == null) {
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Distributed cache is empty. Assuming fatjar.");
+ }
+ String jarFile = context.getJar();
+ if (jarFile == null) {
+ jarFile = findContainingJar(getClass());
+ }
+ // Pure YARN profiles will use unpacked resources, so calls
+ // to "findContainingJar()" in that context can return NULL!
+ zkClasspath = null == jarFile ?
"./*" : jarFile.replaceFirst("file:", "");
- } else {
- StringBuilder sb = new StringBuilder();
- sb.append(fileClassPaths[0]);
+ } else {
+ StringBuilder sb = new StringBuilder();
+ sb.append(fileClassPaths[0]);
- for (int i = 1; i < fileClassPaths.length; i++) {
- sb.append(":");
- sb.append(fileClassPaths[i]);
- }
- zkClasspath = sb.toString();
+ for (int i = 1; i < fileClassPaths.length; i++) {
+ sb.append(":");
+ sb.append(fileClassPaths[i]);
}
+ zkClasspath = sb.toString();
+ }
- if (LOG.isInfoEnabled()) {
- LOG.info("setup: classpath @ " + zkClasspath + " for job " +
+ if (LOG.isInfoEnabled()) {
+ LOG.info("setup: classpath @ " + zkClasspath + " for job " +
context.getJobName());
- }
- conf.setZooKeeperJar(zkClasspath);
}
+ conf.setZooKeeperJar(zkClasspath);
}
/**
@@ -652,6 +651,12 @@ public class GraphTaskManager<I extends WritableComparable, V extends Writable,
appenderEnum.nextElement().setLayout(layout);
}
}
+ // Change ZooKeeper logging level to error (info is quite verbose) for
+ // testing only
+ if (conf.getLocalTestMode()) {
+ LogManager.getLogger(org.apache.zookeeper.server.PrepRequestProcessor.
+ class.getName()).setLevel(Level.ERROR);
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/giraph/blob/57821392/giraph-core/src/test/java/org/apache/giraph/BspCase.java
----------------------------------------------------------------------
diff --git a/giraph-core/src/test/java/org/apache/giraph/BspCase.java b/giraph-core/src/test/java/org/apache/giraph/BspCase.java
index dbee7f0..137cb6e 100644
--- a/giraph-core/src/test/java/org/apache/giraph/BspCase.java
+++ b/giraph-core/src/test/java/org/apache/giraph/BspCase.java
@@ -30,6 +30,8 @@ import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.junit.After;
@@ -98,6 +100,7 @@ public class BspCase implements Watcher {
conf.setWorkerConfiguration(1, 1, 100.0f);
// Single node testing
GiraphConstants.SPLIT_MASTER_WORKER.set(conf, false);
+ GiraphConstants.LOCAL_TEST_MODE.set(conf, true);
}
conf.setMaxMasterSuperstepWaitMsecs(30 * 1000);
conf.setEventWaitMsecs(3 * 1000);
@@ -180,7 +183,6 @@ public class BspCase implements Watcher {
*/
public BspCase(String testName) {
this.testName = testName;
-
}
/**