Return-Path: X-Original-To: apmail-giraph-commits-archive@www.apache.org Delivered-To: apmail-giraph-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 968BEDD1E for ; Mon, 16 Jul 2012 22:27:14 +0000 (UTC) Received: (qmail 73374 invoked by uid 500); 16 Jul 2012 22:27:14 -0000 Delivered-To: apmail-giraph-commits-archive@giraph.apache.org Received: (qmail 73342 invoked by uid 500); 16 Jul 2012 22:27:14 -0000 Mailing-List: contact commits-help@giraph.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@giraph.apache.org Delivered-To: mailing list commits@giraph.apache.org Received: (qmail 73334 invoked by uid 99); 16 Jul 2012 22:27:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2012 22:27:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2012 22:27:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C5C502388A3D; Mon, 16 Jul 2012 22:26:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1362291 - in /giraph/trunk: CHANGELOG src/main/java/org/apache/giraph/GiraphRunner.java Date: Mon, 16 Jul 2012 22:26:47 -0000 To: commits@giraph.apache.org From: aching@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120716222647.C5C502388A3D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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:" + " =,= 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 :