incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tjungb...@apache.org
Subject svn commit: r1293826 - /incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJob.java
Date Sun, 26 Feb 2012 12:57:54 GMT
Author: tjungblut
Date: Sun Feb 26 12:57:54 2012
New Revision: 1293826

URL: http://svn.apache.org/viewvc?rev=1293826&view=rev
Log:
Add convenience method for setting compressors in BSPJob.

Modified:
    incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJob.java

Modified: incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJob.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJob.java?rev=1293826&r1=1293825&r2=1293826&view=diff
==============================================================================
--- incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJob.java (original)
+++ incubator/hama/trunk/core/src/main/java/org/apache/hama/bsp/BSPJob.java Sun Feb 26 12:57:54
2012
@@ -28,6 +28,8 @@ import org.apache.hadoop.io.Text;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.util.ReflectionUtils;
 import org.apache.hama.HamaConfiguration;
+import org.apache.hama.bsp.message.compress.BSPMessageCompressor;
+import org.apache.hama.bsp.message.compress.BSPMessageCompressorFactory;
 
 /**
  * A BSP job configuration.
@@ -248,6 +250,14 @@ public class BSPJob extends BSPJobContex
   }
 
   /**
+   * Sets the compression codec that should be used to compress messages.
+   */
+  public void setCompressionCodec(Class<? extends BSPMessageCompressor<?>> clazz)
{
+    conf.setClass(BSPMessageCompressorFactory.COMPRESSION_CODEC_CLASS, clazz,
+        BSPMessageCompressor.class);
+  }
+
+  /**
    * Get the key class for the job input data.
    * 
    * @return the key class for the job input data.



Mime
View raw message