Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed AvroResolvingGenericSerializer to be generic

Rather than requiring a GenericData.Record
  • Loading branch information...
commit 375221ef74819fb733776354fc1a14e5aae0057b 1 parent d2f8d63
@mumrah authored
View
5 src/java/voldemort/serialization/DefaultSerializerFactory.java
@@ -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());
View
4 src/java/voldemort/serialization/avro/AvroResolvingGenericSerializer.java
@@ -4,7 +4,6 @@
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;
@@ -12,8 +11,7 @@
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);
View
3  src/java/voldemort/serialization/avro/AvroResolvingSerializer.java
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.