hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r899866 - in /hadoop/common/trunk: ./ src/java/org/apache/hadoop/io/serializer/ src/java/org/apache/hadoop/io/serializer/avro/
Date Sat, 16 Jan 2010 01:06:57 GMT
Author: cutting
Date: Sat Jan 16 01:06:57 2010
New Revision: 899866

URL: http://svn.apache.org/viewvc?rev=899866&view=rev
Log:
HADOOP-6492.  Make some Avro serialization APIs public.  Contributed by Aaron Kimball.

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/SerializationBase.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroGenericSerialization.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
    hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=899866&r1=899865&r2=899866&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Sat Jan 16 01:06:57 2010
@@ -101,6 +101,9 @@
 
     HADOOP-6155. Deprecate RecordIO anticipating Avro. (Tom White via cdouglas)
 
+    HADOOP-6492. Make some Avro serialization APIs public.
+    (Aaron Kimball via cutting)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/SerializationBase.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/SerializationBase.java?rev=899866&r1=899865&r2=899866&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/SerializationBase.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/SerializationBase.java Sat
Jan 16 01:06:57 2010
@@ -77,8 +77,8 @@
    */
   public abstract DeserializerBase<T> getDeserializer(
       Map<String, String> metadata);
-  
-  protected Class<?> getClassFromMetadata(Map<String, String> metadata) {
+
+  public Class<?> getClassFromMetadata(Map<String, String> metadata) {
     String classname = metadata.get(CLASS_KEY);
     if (classname == null) {
       return null;

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroGenericSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroGenericSerialization.java?rev=899866&r1=899865&r2=899866&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroGenericSerialization.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroGenericSerialization.java
Sat Jan 16 01:06:57 2010
@@ -46,18 +46,18 @@
   }
 
   @Override
-  protected DatumReader getReader(Map<String, String> metadata) {
+  public DatumReader getReader(Map<String, String> metadata) {
     Schema schema = Schema.parse(metadata.get(AVRO_SCHEMA_KEY));
     return new GenericDatumReader<Object>(schema);
   }
 
   @Override
-  protected Schema getSchema(Map<String, String> metadata) {
+  public Schema getSchema(Map<String, String> metadata) {
     return Schema.parse(metadata.get(AVRO_SCHEMA_KEY));
   }
 
   @Override
-  protected DatumWriter getWriter(Map<String, String> metadata) {
+  public DatumWriter getWriter(Map<String, String> metadata) {
     return new GenericDatumWriter<Object>();
   }
 

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java?rev=899866&r1=899865&r2=899866&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroReflectSerialization.java
Sat Jan 16 01:06:57 2010
@@ -76,7 +76,7 @@
   }
 
   @Override
-  protected DatumReader getReader(Map<String, String> metadata) {
+  public DatumReader getReader(Map<String, String> metadata) {
     try {
       return new ReflectDatumReader(getClassFromMetadata(metadata));
     } catch (Exception e) {
@@ -85,13 +85,13 @@
   }
 
   @Override
-  protected Schema getSchema(Map<String, String> metadata) {
+  public Schema getSchema(Map<String, String> metadata) {
     Class<?> c = getClassFromMetadata(metadata);
     return ReflectData.get().getSchema(c);
   }
 
   @Override
-  protected DatumWriter getWriter(Map<String, String> metadata) {
+  public DatumWriter getWriter(Map<String, String> metadata) {
     return new ReflectDatumWriter();
   }
 

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java?rev=899866&r1=899865&r2=899866&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSerialization.java
Sat Jan 16 01:06:57 2010
@@ -51,17 +51,17 @@
   /**
    * Return an Avro Schema instance for the given class and metadata.
    */
-  protected abstract Schema getSchema(Map<String, String> metadata);
+  public abstract Schema getSchema(Map<String, String> metadata);
 
   /**
    * Create and return Avro DatumWriter for the given metadata.
    */
-  protected abstract DatumWriter<T> getWriter(Map<String, String> metadata);
+  public abstract DatumWriter<T> getWriter(Map<String, String> metadata);
 
   /**
    * Create and return Avro DatumReader for the given metadata.
    */
-  protected abstract DatumReader<T> getReader(Map<String, String> metadata);
+  public abstract DatumReader<T> getReader(Map<String, String> metadata);
 
   class AvroSerializer extends SerializerBase<T> {
 

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java?rev=899866&r1=899865&r2=899866&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/serializer/avro/AvroSpecificSerialization.java
Sat Jan 16 01:06:57 2010
@@ -47,7 +47,7 @@
   }
 
   @Override
-  protected DatumReader getReader(Map<String, String> metadata) {
+  public DatumReader getReader(Map<String, String> metadata) {
     try {
       return new SpecificDatumReader(getClassFromMetadata(metadata));
     } catch (Exception e) {
@@ -56,13 +56,13 @@
   }
 
   @Override
-  protected Schema getSchema(Map<String, String> metadata) {
+  public Schema getSchema(Map<String, String> metadata) {
     Class<?> c = getClassFromMetadata(metadata);
     return SpecificData.get().getSchema(c);
   }
 
   @Override
-  protected DatumWriter getWriter(Map<String, String> metadata) {
+  public DatumWriter getWriter(Map<String, String> metadata) {
     return new SpecificDatumWriter();
   }
 



Mime
View raw message