Permalink
Browse files

Changed AvroResolvingGenericSerializer to be generic

Rather than requiring a GenericData.Record
  • Loading branch information...
1 parent ad8e344 commit 622c2ec89edcf08d7d3dfc8f60c27144143aab66 David Arthur committed Sep 9, 2011
@@ -19,7 +19,6 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.avro.generic.GenericData;
import org.apache.avro.specific.SpecificRecord;
import org.apache.thrift.TBase;
@@ -85,9 +84,9 @@
} else if(name.equals(AVRO_REFLECTIVE_TYPE_NAME)) {
return new AvroReflectiveSerializer<Object>(serializerDef.getCurrentSchemaInfo());
} else if(name.equals(AVRO_RESOLVING_SPECIFIC_TYPE_NAME)) {
- return new AvroResolvingSpecificSerializer(serializerDef);
+ return new AvroResolvingSpecificSerializer<SpecificRecord>(serializerDef);
} else if(name.equals(AVRO_RESOLVING_GENERIC_TYPE_NAME)) {
- return new AvroResolvingGenericSerializer<GenericData.Record>(serializerDef);
+ return new AvroResolvingGenericSerializer(serializerDef);
} else {
throw new IllegalArgumentException("No known serializer type: "
+ serializerDef.getName());
@@ -4,16 +4,14 @@
import java.util.Map;
import org.apache.avro.Schema;
-import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericDatumReader;
import org.apache.avro.generic.GenericDatumWriter;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DatumWriter;
import voldemort.serialization.SerializerDefinition;
-public class AvroResolvingGenericSerializer<T extends GenericData.Record> extends
- AvroResolvingSerializer<T> {
+public class AvroResolvingGenericSerializer<T> extends AvroResolvingSerializer<T> {
public AvroResolvingGenericSerializer(SerializerDefinition serializerDef) {
super(serializerDef);
@@ -6,7 +6,6 @@
import java.util.Map;
import org.apache.avro.Schema;
-import org.apache.avro.generic.IndexedRecord;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DatumReader;
@@ -17,7 +16,7 @@
import voldemort.serialization.Serializer;
import voldemort.serialization.SerializerDefinition;
-public abstract class AvroResolvingSerializer<T extends IndexedRecord> implements Serializer<T> {
+public abstract class AvroResolvingSerializer<T> implements Serializer<T> {
private final Map<Integer, Schema> schemaVersions;
private final Schema currentSchema;

0 comments on commit 622c2ec

Please sign in to comment.