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:40:26 UTC
svn commit: r1075938 - in /avro/trunk: ./
lang/java/avro/src/main/java/org/apache/avro/io/
Author: cutting
Date: Tue Mar 1 17:40:25 2011
New Revision: 1075938
URL: http://svn.apache.org/viewvc?rev=1075938&view=rev
Log:
AVRO-769. Update javadoc and fix return type of ValidatingEncoder#configure(). Contributed by scottcarey.
Modified:
avro/trunk/CHANGES.txt
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java
avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/package.html
Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Tue Mar 1 17:40:25 2011
@@ -14,7 +14,7 @@ Avro 1.5.1 (unreleased)
BUG FIXES
-Avro 1.5.0 (unreleased)
+Avro 1.5.0 (4 March 2011)
INCOMPATIBLE CHANGES
Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Decoder.java Tue Mar 1 17:40:25 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/trunk/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/DecoderFactory.java Tue Mar 1 17:40:25 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/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/Encoder.java Tue Mar 1 17:40:25 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/trunk/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/EncoderFactory.java Tue Mar 1 17:40:25 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/trunk/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/JsonDecoder.java Tue Mar 1 17:40:25 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/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingDecoder.java Tue Mar 1 17:40:25 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/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/ValidatingEncoder.java Tue Mar 1 17:40:25 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/trunk/lang/java/avro/src/main/java/org/apache/avro/io/package.html
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/package.html?rev=1075938&r1=1075937&r2=1075938&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/package.html (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/io/package.html Tue Mar 1 17:40:25 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>