You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by cu...@apache.org on 2011/03/01 18:42:29 UTC

svn commit: r1075941 - in /avro/branches/branch-1.5: ./ lang/java/avro/src/main/java/org/apache/avro/io/

Author: cutting
Date: Tue Mar  1 17:42:29 2011
New Revision: 1075941

URL: http://svn.apache.org/viewvc?rev=1075941&view=rev
Log:
Merge -c 1075938 from trunk to 1.5 branch.  Fixes AVRO-769.

Modified:
    avro/branches/branch-1.5/   (props changed)
    avro/branches/branch-1.5/CHANGES.txt
    avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java
    avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java
    avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java
    avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java
    avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java
    avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java
    avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java
    avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/package.html

Propchange: avro/branches/branch-1.5/
------------------------------------------------------------------------------
    svn:mergeinfo = /avro/trunk:1075938

Modified: avro/branches/branch-1.5/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/CHANGES.txt?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/CHANGES.txt (original)
+++ avro/branches/branch-1.5/CHANGES.txt Tue Mar  1 17:42:29 2011
@@ -1,6 +1,6 @@
 Avro Change Log
 
-Avro 1.5.0 (unreleased)
+Avro 1.5.0 (4 March 2011)
 
   INCOMPATIBLE CHANGES
 

Modified: avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java (original)
+++ avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java Tue Mar  1 17:42:29 2011
@@ -24,7 +24,7 @@ import org.apache.avro.util.Utf8;
 
 /**
  * Low-level support for de-serializing Avro values.
- * <p>
+ * <p/>
  *  This class has two types of methods.  One type of methods support
  *  the reading of leaf values (for example, {@link #readLong} and
  *  {@link #readString}).
@@ -34,7 +34,8 @@ import org.apache.avro.util.Utf8;
  *  and similar methods for maps).  See {@link #readArrayStart} for
  *  details on these methods.)
  *  <p/>
- *  {@link DecoderFactory} is used to create and configure Decoder instances.
+ *  {@link DecoderFactory} contains Decoder construction and configuration
+ *  facilities.
  *  @see DecoderFactory
  *  @see Encoder
  */

Modified: avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java (original)
+++ avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java Tue Mar  1 17:42:29 2011
@@ -219,10 +219,10 @@ public class DecoderFactory {
   }
 
   /** @deprecated use {@link #binaryDecoder(byte[], BinaryDecoder)} instead */
-//  @Deprecated
-//  public BinaryDecoder createBinaryDecoder(byte[] bytes, BinaryDecoder reuse) {
-//    return binaryDecoder(bytes, 0, bytes.length, reuse);
-//  }
+  @Deprecated
+  public BinaryDecoder createBinaryDecoder(byte[] bytes, BinaryDecoder reuse) {
+    return binaryDecoder(bytes, 0, bytes.length, reuse);
+  }
   
   /**
    * This method is shorthand for

Modified: avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java (original)
+++ avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java Tue Mar  1 17:42:29 2011
@@ -25,12 +25,12 @@ import org.apache.avro.util.Utf8;
 
 /**
  * Low-level support for serializing Avro values.
- *
+ * <p/>
  * This class has two types of methods.  One type of methods support
  * the writing of leaf values (for example, {@link #writeLong} and
  * {@link #writeString}).  These methods have analogs in {@link
  * Decoder}.
- *
+ * <p/>
  * The other type of methods support the writing of maps and arrays.
  * These methods are {@link #writeArrayStart}, {@link
  * #startItem}, and {@link #writeArrayEnd} (and similar methods for
@@ -38,7 +38,10 @@ import org.apache.avro.util.Utf8;
  * buffering required to break large maps and arrays into blocks,
  * which is necessary for applications that want to do streaming.
  * (See {@link #writeArrayStart} for details on these methods.)
- *
+ * <p/>
+ * {@link EncoderFactory} contains Encoder construction and configuration
+ * facilities.  
+ *  @see EncoderFactory
  *  @see Decoder
  */
 public abstract class Encoder implements Flushable {

Modified: avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java (original)
+++ avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java Tue Mar  1 17:42:29 2011
@@ -138,7 +138,7 @@ public class EncoderFactory {
   }
   
   /**
-   * Creates or reinitializes a {@link BinaryEncoder} to use the OutputStream
+   * Creates or reinitializes a {@link BinaryEncoder} with the OutputStream
    * provided as the destination for written data. If <i>reuse</i> is provided,
    * an attempt will be made to reconfigure <i>reuse</i> rather than construct a
    * new instance, but this is not guaranteed, a new instance may be returned.
@@ -162,7 +162,7 @@ public class EncoderFactory {
    * @return A BinaryEncoder that uses <i>out</i> as its data output. If
    *         <i>reuse</i> is null, this will be a new instance. If <i>reuse</i>
    *         is not null, then the returned instance may be a new instance or
-   *         <i>reuse</i> reconfigured to use <i>out</>.
+   *         <i>reuse</i> reconfigured to use <i>out</i>.
    * @throws IOException 
    * @see BufferedBinaryEncoder
    * @see Encoder
@@ -204,7 +204,7 @@ public class EncoderFactory {
    * @return A BinaryEncoder that uses <i>out</i> as its data output. If
    *         <i>reuse</i> is null, this will be a new instance. If <i>reuse</i>
    *         is not null, then the returned instance may be a new instance or
-   *         <i>reuse</i> reconfigured to use <i>out</>.
+   *         <i>reuse</i> reconfigured to use <i>out</i>.
    * @see DirectBinaryEncoder
    * @see Encoder
    */
@@ -244,7 +244,7 @@ public class EncoderFactory {
    * @return A BinaryEncoder that uses <i>out</i> as its data output. If
    *         <i>reuse</i> is null, this will be a new instance. If <i>reuse</i>
    *         is not null, then the returned instance may be a new instance or
-   *         <i>reuse</i> reconfigured to use <i>out</>.
+   *         <i>reuse</i> reconfigured to use <i>out</i>.
    * @throws IOException
    * @see BlockingBinaryEncoder
    * @see Encoder

Modified: avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java (original)
+++ avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java Tue Mar  1 17:42:29 2011
@@ -32,7 +32,12 @@ import org.codehaus.jackson.JsonFactory;
 import org.codehaus.jackson.JsonParser;
 import org.codehaus.jackson.JsonToken;
 
-/** A {@link Decoder} for Avro's JSON data encoding. */
+/** A {@link Decoder} for Avro's JSON data encoding. 
+ * </p>
+ * Construct using {@link DecoderFactory}.
+ * </p>
+ * JsonDecoder is not thread-safe.
+ * */
 public class JsonDecoder extends ParsingDecoder
   implements Parser.ActionHandler {
   private JsonParser in;

Modified: avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java (original)
+++ avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java Tue Mar  1 17:42:29 2011
@@ -30,6 +30,13 @@ import org.apache.avro.util.Utf8;
 /**
  * An implementation of {@link Decoder} that ensures that the sequence
  * of operations conforms to a schema.
+ * <p/>
+ * Use {@link DecoderFactory#validatingDecoder(Schema, Decoder)} to construct
+ * and configure.
+ * <p/>
+ * ValidatingDecoder is not thread-safe.
+ * @see Decoder
+ * @see DecoderFactory
  */
 public class ValidatingDecoder extends ParsingDecoder
   implements Parser.ActionHandler {

Modified: avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java (original)
+++ avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java Tue Mar  1 17:42:29 2011
@@ -62,10 +62,13 @@ public class ValidatingEncoder extends P
    * Reconfigures this ValidatingEncoder to wrap the encoder provided.
    * @param encoder
    *   The Encoder to wrap for validation.
+   * @return
+   *   This ValidatingEncoder.
    */
-  public void configure(Encoder encoder) {
+  public ValidatingEncoder configure(Encoder encoder) {
     this.parser.reset();
     this.out = encoder;
+    return this;
   }
   
   @Override

Modified: avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/package.html
URL: http://svn.apache.org/viewvc/avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/package.html?rev=1075941&r1=1075940&r2=1075941&view=diff
==============================================================================
--- avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/package.html (original)
+++ avro/branches/branch-1.5/lang/java/avro/src/main/java/org/apache/avro/io/package.html Tue Mar  1 17:42:29 2011
@@ -18,6 +18,14 @@
 -->
 
 <body>
-Input/output utilities.
+Utilities for Encoding and Decoding Avro data.
+<p>
+{@link org.apache.avro.io.Encoder} is the abstract type encapsulating the
+encoding of Avro data.  Encoder instances are created and configured
+with {@link org.apache.avro.io.EncoderFactory}.
+<p>
+{@link org.apache.avro.io.Decoder} is the abstract type encapsulating the
+decoding of Avro data.  Decoder instances are created and configured
+with {@link org.apache.avro.io.DecoderFactory}.
 </body>
 </html>