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 2012/10/18 09:37:26 UTC

svn commit: r1399543 - in /giraph/trunk: CHANGELOG giraph-formats-contrib/src/main/java/org/apache/giraph/io/hcatalog/HiveGiraphRunner.java

Author: aching
Date: Thu Oct 18 07:37:25 2012
New Revision: 1399543

URL: http://svn.apache.org/viewvc?rev=1399543&view=rev
Log:
GIRAPH-379: HiveGiraphRunner should have a skipOutput option for
testing (aching)

Modified:
    giraph/trunk/CHANGELOG
    giraph/trunk/giraph-formats-contrib/src/main/java/org/apache/giraph/io/hcatalog/HiveGiraphRunner.java

Modified: giraph/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/giraph/trunk/CHANGELOG?rev=1399543&r1=1399542&r2=1399543&view=diff
==============================================================================
--- giraph/trunk/CHANGELOG (original)
+++ giraph/trunk/CHANGELOG Thu Oct 18 07:37:25 2012
@@ -1,6 +1,9 @@
 Giraph Change Log
 
 Release 0.2.0 - unreleased
+  GIRAPH-379: HiveGiraphRunner should have a skipOutput option for
+  testing (aching)
+
   GIRAPH-380: Hadoop_non_secure is broken (majakabiljo)
 
   GIRAPH-372: Write worker addresses to Zookeeper; 

Modified: giraph/trunk/giraph-formats-contrib/src/main/java/org/apache/giraph/io/hcatalog/HiveGiraphRunner.java
URL: http://svn.apache.org/viewvc/giraph/trunk/giraph-formats-contrib/src/main/java/org/apache/giraph/io/hcatalog/HiveGiraphRunner.java?rev=1399543&r1=1399542&r2=1399543&view=diff
==============================================================================
--- giraph/trunk/giraph-formats-contrib/src/main/java/org/apache/giraph/io/hcatalog/HiveGiraphRunner.java (original)
+++ giraph/trunk/giraph-formats-contrib/src/main/java/org/apache/giraph/io/hcatalog/HiveGiraphRunner.java Thu Oct 18 07:37:25 2012
@@ -46,44 +46,44 @@ import org.apache.log4j.Logger;
 
 /**
  * Hive Giraph Runner
- *
  */
 public class HiveGiraphRunner implements Tool {
   /**
-  * logger
-  */
+   * logger
+   */
   private static final Logger LOG = Logger.getLogger(HiveGiraphRunner.class);
   /**
-  * workers
-  */
+   * workers
+   */
   protected int workers;
   /**
-  * is verbose
-  */
+   * is verbose
+   */
   protected boolean isVerbose;
   /**
-  * output table partitions
-  */
+   * output table partitions
+   */
   protected Map<String, String> outputTablePartitionValues;
   /**
-  * dbName
-  */
+   * dbName
+   */
   protected String dbName;
   /**
-  * input table name
-  */
+   * input table name
+   */
   protected String inputTableName;
   /**
-  * input table filter
-  */
+   * input table filter
+   */
   protected String inputTableFilterExpr;
   /**
-  * output table name
-  */
+   * output table name
+   */
   protected String outputTableName;
-
   /** Configuration */
   private Configuration conf;
+  /** Skip output? (Useful for testing without writing) */
+  private boolean skipOutput = false;
 
   /**
   * vertex class.
@@ -160,7 +160,12 @@ public class HiveGiraphRunner implements
                 dbName, outputTableName, outputTablePartitionValues));
     HCatOutputFormat.setSchema(job.getInternalJob(),
                 HCatOutputFormat.getTableSchema(job.getInternalJob()));
-    job.getConfiguration().setVertexOutputFormatClass(vertexOutputFormatClass);
+    if (skipOutput) {
+      LOG.warn("run: Warning - Output will be skipped!");
+    } else {
+      job.getConfiguration().setVertexOutputFormatClass(
+          vertexOutputFormatClass);
+    }
 
     job.getConfiguration().setWorkerConfiguration(workers, workers, 100.0f);
     initGiraphJob(job);
@@ -234,6 +239,8 @@ public class HiveGiraphRunner implements
     options.addOption("o", "outputTable", true, "Output table name");
     options.addOption("O", "outputPartition", true,
                 "Output table partition values (e.g., \"a=1,b=two\")");
+    options.addOption("s", "skipOutput", false, "Skip output?");
+
     addMoreOptions(options);
 
     CommandLineParser parser = new GnuParser();
@@ -259,6 +266,10 @@ public class HiveGiraphRunner implements
               HCatalogVertexOutputFormat.class);
     }
 
+    if (cmdln.hasOption("skipOutput")) {
+      skipOutput = true;
+    }
+
     if (vertexClass == null) {
       throw new IllegalArgumentException(
                 "Need the Giraph Vertex class name (-vertexClass) to use");