giraph-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ach...@apache.org
Subject svn commit: r1362291 - in /giraph/trunk: CHANGELOG src/main/java/org/apache/giraph/GiraphRunner.java
Date Mon, 16 Jul 2012 22:26:47 GMT
Author: aching
Date: Mon Jul 16 22:26:47 2012
New Revision: 1362291

URL: http://svn.apache.org/viewvc?rev=1362291&view=rev
Log:
GIRAPH-251: Allow to access the distributed cache from Vertexes and
WorkerContext (Gianmarco De Francisci Morales via aching).


Modified:
    giraph/trunk/CHANGELOG
    giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java

Modified: giraph/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/giraph/trunk/CHANGELOG?rev=1362291&r1=1362290&r2=1362291&view=diff
==============================================================================
--- giraph/trunk/CHANGELOG (original)
+++ giraph/trunk/CHANGELOG Mon Jul 16 22:26:47 2012
@@ -2,6 +2,9 @@ Giraph Change Log
 
 Release 0.2.0 - unreleased
 
+  GIRAPH-251: Allow to access the distributed cache from Vertexes and
+  WorkerContext (Gianmarco De Francisci Morales via aching).
+
   GIRAPH-261: Rename isQuiet variable. (Gianmarco De Francisci Morales 
   via jghoman).
 

Modified: giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java
URL: http://svn.apache.org/viewvc/giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java?rev=1362291&r1=1362290&r2=1362291&view=diff
==============================================================================
--- giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java (original)
+++ giraph/trunk/src/main/java/org/apache/giraph/GiraphRunner.java Mon Jul 16 22:26:47 2012
@@ -17,8 +17,8 @@
  */
 package org.apache.giraph;
 
-import com.google.common.base.Splitter;
-import com.google.common.collect.Iterables;
+import java.net.URI;
+
 import org.apache.commons.cli.BasicParser;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
@@ -29,6 +29,7 @@ import org.apache.giraph.graph.BasicVert
 import org.apache.giraph.graph.GiraphJob;
 import org.apache.giraph.utils.AnnotationUtils;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.filecache.DistributedCache;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
@@ -40,6 +41,9 @@ import org.apache.zookeeper.ZooKeeper;
 
 import java.util.List;
 
+import com.google.common.base.Splitter;
+import com.google.common.collect.Iterables;
+
 /**
  * Helper class to run Giraph applications by specifying the actual class name
  * to use (i.e. vertex, vertex input/output format, combiner, etc.).
@@ -80,6 +84,7 @@ public class GiraphRunner implements Too
     options.addOption("c", "combiner", true, "VertexCombiner class");
     options.addOption("wc", "workerContext", true, "WorkerContext class");
     options.addOption("aw", "aggregatorWriter", true, "AggregatorWriter class");
+    options.addOption("cf", "cacheFile", true, "Files for distributed cache");
     options.addOption("ca", "customArguments", true, "provide custom" +
         " arguments for the job configuration in the form:" +
         " <param1>=<value1>,<param2>=<value2> etc.");
@@ -190,6 +195,11 @@ public class GiraphRunner implements Too
       job.setAggregatorWriterClass(Class.forName(cmd.getOptionValue("aw")));
     }
 
+    if (cmd.hasOption("cf")) {
+      DistributedCache.addCacheFile(new URI(cmd.getOptionValue("cf")),
+          job.getConfiguration());
+    }
+
     if (cmd.hasOption("ca")) {
       Configuration jobConf = job.getConfiguration();
       for (String paramValue :



Mime
View raw message