avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1241678 - in /avro/trunk: ./ lang/java/avro/src/main/java/org/apache/avro/file/ lang/java/mapred/src/main/java/org/apache/avro/mapred/
Date Tue, 07 Feb 2012 22:49:34 GMT
Author: cutting
Date: Tue Feb  7 22:49:34 2012
New Revision: 1241678

URL: http://svn.apache.org/viewvc?rev=1241678&view=rev
Log:
AVRO-1010. Java: Improve codec javadoc.  Contributed by Lars Francke.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/CodecFactory.java
    avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroJob.java
    avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroOutputFormat.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1241678&r1=1241677&r2=1241678&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Tue Feb  7 22:49:34 2012
@@ -54,6 +54,8 @@ Avro 1.6.2 (unreleased)
     AVRO-1005. Java: Extend HttpTransceiver to permit specification of
     a Proxy. (Craig Landry via cutting)
 
+    AVRO-1010. Java: Improve codec javadoc. (Lars Francke via cutting)
+
   BUG FIXES
 
     AVRO-962. Java: Fix Maven plugin to support string type override.

Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/CodecFactory.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/CodecFactory.java?rev=1241678&r1=1241677&r2=1241678&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/CodecFactory.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/CodecFactory.java Tue Feb
 7 22:49:34 2012
@@ -23,24 +23,35 @@ import java.util.zip.Deflater;
 
 import org.apache.avro.AvroRuntimeException;
 
-/** Encapsulates the ability to specify and configure a compression codec. */
+/**  Encapsulates the ability to specify and configure a compression codec.
+ *
+ * Currently there are three codecs registered by default:
+ * <ul>
+ *   <li>{@code null}</li>
+ *   <li>{@code deflate}</li>
+ *   <li>{@code snappy}</li>
+ * </ul>
+ *
+ * New and custom codecs can be registered using {@link #addCodec(String,
+ * CodecFactory)}.
+ */
 public abstract class CodecFactory {
   /** Null codec, for no compression. */
-  public static CodecFactory nullCodec() { 
-    return NullCodec.OPTION; 
-  };
-  
+  public static CodecFactory nullCodec() {
+    return NullCodec.OPTION;
+  }
+
   /** Deflate codec, with specific compression.
    * compressionLevel should be between 1 and 9, inclusive. */
-  public static CodecFactory deflateCodec(int compressionLevel) { 
-    return new DeflateCodec.Option(compressionLevel); 
-  };
-  
+  public static CodecFactory deflateCodec(int compressionLevel) {
+    return new DeflateCodec.Option(compressionLevel);
+  }
+
   /** Snappy codec.*/
-  public static CodecFactory snappyCodec() { 
-    return new SnappyCodec.Option(); 
-  };
-  
+  public static CodecFactory snappyCodec() {
+    return new SnappyCodec.Option();
+  }
+
   /** Creates internal Codec. */
   protected abstract Codec createInstance();
   
@@ -58,7 +69,15 @@ public abstract class CodecFactory {
     addCodec("snappy", snappyCodec());
   }
 
-  /** Maps a codec name into a CodecOption. */
+  /** Maps a codec name into a CodecFactory.
+   *
+   * Currently there are three codecs registered by default:
+   * <ul>
+   *   <li>{@code null}</li>
+   *   <li>{@code deflate}</li>
+   *   <li>{@code snappy}</li>
+   * </ul>
+   */
   public static CodecFactory fromString(String s) {
     CodecFactory o = REGISTERED.get(s);
     if (o == null) {

Modified: avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroJob.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroJob.java?rev=1241678&r1=1241677&r2=1241678&view=diff
==============================================================================
--- avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroJob.java (original)
+++ avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroJob.java Tue Feb
 7 22:49:34 2012
@@ -42,7 +42,8 @@ public class AvroJob {
   public static final String MAP_OUTPUT_SCHEMA = "avro.map.output.schema";
   /** The configuration key for a job's output schema. */
   public static final String OUTPUT_SCHEMA = "avro.output.schema";
-  /** The configuration key for a job's output compression codec. */
+  /** The configuration key for a job's output compression codec.
+   *  This takes one of the strings registered in {@link org.apache.avro.file.CodecFactory}
*/
   public static final String OUTPUT_CODEC = "avro.output.codec";
   /** The configuration key prefix for a text output metadata. */
   public static final String TEXT_PREFIX = "avro.meta.text.";

Modified: avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroOutputFormat.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroOutputFormat.java?rev=1241678&r1=1241677&r2=1241678&view=diff
==============================================================================
--- avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroOutputFormat.java
(original)
+++ avro/trunk/lang/java/mapred/src/main/java/org/apache/avro/mapred/AvroOutputFormat.java
Tue Feb  7 22:49:34 2012
@@ -39,7 +39,13 @@ import org.apache.avro.file.CodecFactory
 import static org.apache.avro.file.DataFileConstants.DEFAULT_SYNC_INTERVAL;
 import static org.apache.avro.file.DataFileConstants.DEFLATE_CODEC;
 
-/** An {@link org.apache.hadoop.mapred.OutputFormat} for Avro data files. */
+/**
+ * An {@link org.apache.hadoop.mapred.OutputFormat} for Avro data files.
+ * <p/>
+ * You can specify various options using Job Configuration properties.
+ * Look at the fields in {@link AvroJob} as well as this class to get
+ * an overview of the supported options.
+ */
 public class AvroOutputFormat <T>
   extends FileOutputFormat<AvroWrapper<T>, NullWritable> {
 



Mime
View raw message