avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r882736 - in /hadoop/avro/trunk: CHANGES.txt src/java/org/apache/avro/file/DataFileWriter.java src/java/org/apache/avro/io/Encoder.java src/java/org/apache/avro/ipc/Transceiver.java
Date Fri, 20 Nov 2009 22:14:45 GMT
Author: cutting
Date: Fri Nov 20 22:14:44 2009
New Revision: 882736

URL: http://svn.apache.org/viewvc?rev=882736&view=rev
Log:
AVRO-229. Change Java to implement Flushable and Closeable interfaces where appropriate. 
Contributed by tomwhite.

Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/src/java/org/apache/avro/file/DataFileWriter.java
    hadoop/avro/trunk/src/java/org/apache/avro/io/Encoder.java
    hadoop/avro/trunk/src/java/org/apache/avro/ipc/Transceiver.java

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=882736&r1=882735&r2=882736&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Fri Nov 20 22:14:44 2009
@@ -88,6 +88,9 @@
     AVRO-202. Add __all__ listing to Python module, to ease import.
     (Jeff Hammerbacher via cutting)
 
+    AVRO-229. Change Java to implement Flushable and Closeable
+    interfaces where appropriate.  (tomwhite via cutting)
+
   OPTIMIZATIONS
 
     AVRO-172. More efficient schema processing (massie)

Modified: hadoop/avro/trunk/src/java/org/apache/avro/file/DataFileWriter.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/src/java/org/apache/avro/file/DataFileWriter.java?rev=882736&r1=882735&r2=882736&view=diff
==============================================================================
--- hadoop/avro/trunk/src/java/org/apache/avro/file/DataFileWriter.java (original)
+++ hadoop/avro/trunk/src/java/org/apache/avro/file/DataFileWriter.java Fri Nov 20 22:14:44
2009
@@ -19,7 +19,9 @@
 
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
 import java.io.FilterOutputStream;
+import java.io.Flushable;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
@@ -51,7 +53,7 @@
  * stored at the end of the file.  Files may be appended to.
  * @see DataFileReader
  */
-public class DataFileWriter<D> {
+public class DataFileWriter<D> implements Closeable, Flushable {
   private Schema schema;
   private DatumWriter<D> dout;
 

Modified: hadoop/avro/trunk/src/java/org/apache/avro/io/Encoder.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/src/java/org/apache/avro/io/Encoder.java?rev=882736&r1=882735&r2=882736&view=diff
==============================================================================
--- hadoop/avro/trunk/src/java/org/apache/avro/io/Encoder.java (original)
+++ hadoop/avro/trunk/src/java/org/apache/avro/io/Encoder.java Fri Nov 20 22:14:44 2009
@@ -17,6 +17,7 @@
  */
 package org.apache.avro.io;
 
+import java.io.Flushable;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
@@ -41,17 +42,12 @@
  *
  *  @see Decoder
  */
-public abstract class Encoder {
+public abstract class Encoder implements Flushable {
 
   /** Redirect output (and reset the parser state if we're checking). */
   public abstract void init(OutputStream out) throws IOException;
 
   /**
-   * Writes any buffered output to the underlying stream.
-   */
-  public abstract void flush() throws IOException;
-
-  /**
    * "Writes" a null value.  (Doesn't actually write anything, but
    * advances the state of the parser if this class is stateful.)
    * @throws AvroTypeException If this is a stateful writer and a

Modified: hadoop/avro/trunk/src/java/org/apache/avro/ipc/Transceiver.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/src/java/org/apache/avro/ipc/Transceiver.java?rev=882736&r1=882735&r2=882736&view=diff
==============================================================================
--- hadoop/avro/trunk/src/java/org/apache/avro/ipc/Transceiver.java (original)
+++ hadoop/avro/trunk/src/java/org/apache/avro/ipc/Transceiver.java Fri Nov 20 22:14:44 2009
@@ -18,12 +18,13 @@
 
 package org.apache.avro.ipc;
 
+import java.io.Closeable;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.List;
 
 /** Base class for transmitters and recievers of raw binary messages. */
-public abstract class Transceiver {
+public abstract class Transceiver implements Closeable {
 
   public abstract String getRemoteName();
 



Mime
View raw message