incubator-giraph-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgho...@apache.org
Subject svn commit: r1242629 - in /incubator/giraph/trunk: ./ bin/ conf/ src/main/assembly/ src/main/java/org/apache/giraph/ src/main/java/org/apache/giraph/graph/ src/main/java/org/apache/giraph/zk/
Date Fri, 10 Feb 2012 00:52:41 GMT
Author: jghoman
Date: Fri Feb 10 00:52:41 2012
New Revision: 1242629

URL: http://svn.apache.org/viewvc?rev=1242629&view=rev
Log:
GIRAPH-143: Add support for giraph to have a conf file.

Added:
    incubator/giraph/trunk/conf/
    incubator/giraph/trunk/conf/giraph-site.xml
Modified:
    incubator/giraph/trunk/CHANGELOG
    incubator/giraph/trunk/bin/giraph
    incubator/giraph/trunk/src/main/assembly/assembly.xml
    incubator/giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/GiraphJob.java
    incubator/giraph/trunk/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java

Modified: incubator/giraph/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/CHANGELOG?rev=1242629&r1=1242628&r2=1242629&view=diff
==============================================================================
--- incubator/giraph/trunk/CHANGELOG (original)
+++ incubator/giraph/trunk/CHANGELOG Fri Feb 10 00:52:41 2012
@@ -2,6 +2,8 @@ Giraph Change Log
 
 Release 0.2.0 - unreleased
 
+  GIRAPH-143: Add support for giraph to have a conf file. (jghoman)
+
   GIRAPH-142: _hadoopBsp should be prefixable via configuration. (jghoman)
 
   GIRAPH-145. Change partition request log level to debug rather than info.

Modified: incubator/giraph/trunk/bin/giraph
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/bin/giraph?rev=1242629&r1=1242628&r2=1242629&view=diff
==============================================================================
--- incubator/giraph/trunk/bin/giraph (original)
+++ incubator/giraph/trunk/bin/giraph Fri Feb 10 00:52:41 2012
@@ -57,6 +57,9 @@ fi
 # add user jar to classpath
 CLASSPATH=${USER_JAR}
 
+# add Giraph conf dir to classpath
+CLASSPATH=$CLASSPATH:$GIRAPH_HOME/conf
+
 CLASS=org.apache.giraph.GiraphRunner
 
 # so that filenames w/ spaces are handled correctly in loops below
@@ -109,4 +112,4 @@ fi
 GIRAPH_JARS=`echo ${JAR}:${CLASSPATH}|sed s/:/,/g`
 export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$CLASSPATH
 
-exec "$HADOOP_HOME/bin/hadoop" --config $HADOOP_CONF_DIR jar $JAR $CLASS $HADOOP_PROPERTIES
-libjars $GIRAPH_JARS  "$@"
\ No newline at end of file
+exec "$HADOOP_HOME/bin/hadoop" --config $HADOOP_CONF_DIR jar $JAR $CLASS $HADOOP_PROPERTIES
-libjars $GIRAPH_JARS  "$@"

Added: incubator/giraph/trunk/conf/giraph-site.xml
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/conf/giraph-site.xml?rev=1242629&view=auto
==============================================================================
--- incubator/giraph/trunk/conf/giraph-site.xml (added)
+++ incubator/giraph/trunk/conf/giraph-site.xml Fri Feb 10 00:52:41 2012
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+
+<!-- This configuration is for Giraph-specific configs that should be set across runs
-->
+
+<configuration>
+
+</configuration>

Modified: incubator/giraph/trunk/src/main/assembly/assembly.xml
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/assembly/assembly.xml?rev=1242629&r1=1242628&r2=1242629&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/assembly/assembly.xml (original)
+++ incubator/giraph/trunk/src/main/assembly/assembly.xml Fri Feb 10 00:52:41 2012
@@ -74,6 +74,9 @@
       <outputDirectory>docs</outputDirectory>
     </fileSet>
 
+    <fileSet>
+      <directory>conf</directory>
+    </fileSet>
   </fileSets>
   <dependencySets>
     <dependencySet>

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java?rev=1242629&r1=1242628&r2=1242629&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java (original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java Fri Feb 10 00:52:41
2012
@@ -32,6 +32,10 @@ import org.apache.hadoop.util.ToolRunner
 import org.apache.log4j.Logger;
 
 public class GiraphRunner implements Tool {
+  static {
+    Configuration.addDefaultResource("giraph-site.xml");
+  }
+
   private static final Logger LOG = Logger.getLogger(GiraphRunner.class);
   private Configuration conf;
 

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/GiraphJob.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/GiraphJob.java?rev=1242629&r1=1242628&r2=1242629&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/GiraphJob.java (original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/graph/GiraphJob.java Fri Feb 10
00:52:41 2012
@@ -33,6 +33,10 @@ import java.io.IOException;
  * for our needs.  For instance, our job should not have any reduce tasks.
  */
 public class GiraphJob extends Job {
+    static {
+        Configuration.addDefaultResource("giraph-site.xml");
+    }
+
     /** Vertex class - required */
     public static final String VERTEX_CLASS = "giraph.vertexClass";
     /** VertexInputFormat class - required */

Modified: incubator/giraph/trunk/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
URL: http://svn.apache.org/viewvc/incubator/giraph/trunk/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java?rev=1242629&r1=1242628&r2=1242629&view=diff
==============================================================================
--- incubator/giraph/trunk/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java (original)
+++ incubator/giraph/trunk/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java Fri Feb
10 00:52:41 2012
@@ -141,7 +141,7 @@ public class ZooKeeperManager {
    */
     public static String getBasePath(Configuration conf) {
         String result = conf.get(BASE_ZNODE_KEY, "");
-        if(!result.equals("") && !result.startsWith("/")) {
+        if (!result.equals("") && !result.startsWith("/")) {
             throw new IllegalArgumentException("Value for " +
                 BASE_ZNODE_KEY + " must start with /: " + result);
         }



Mime
View raw message