From b60c38039b30d2a63325d58f6acb63c5fcfd5907 Mon Sep 17 00:00:00 2001
From: Marek Goldmann <marek.goldmann@gmail.com>
Date: Tue, 8 Oct 2013 15:28:21 +0200
Subject: [PATCH] Avro 1.6.2 support
---
client/hotrod-client/pom.xml | 4 ++--
.../org/infinispan/client/hotrod/marshall/ApacheAvroMarshaller.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/client/hotrod-client/pom.xml b/client/hotrod-client/pom.xml
index 1d56c79..7f7f48a 100644
--- a/client/hotrod-client/pom.xml
+++ b/client/hotrod-client/pom.xml
@@ -30,7 +30,7 @@
</dependency>
<dependency>
- <groupId>org.apache.hadoop</groupId>
+ <groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<scope>provided</scope>
</dependency>
@@ -108,4 +108,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git a/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/marshall/ApacheAvroMarshaller.java b/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/marshall/ApacheAvroMarshaller.java
index c4a99d7..1b8d06b 100644
--- a/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/marshall/ApacheAvroMarshaller.java
+++ b/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/marshall/ApacheAvroMarshaller.java
@@ -4,7 +4,7 @@
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericDatumReader;
import org.apache.avro.generic.GenericDatumWriter;
-import org.apache.avro.io.BinaryEncoder;
+import org.apache.avro.io.EncoderFactory;
import org.apache.avro.io.Decoder;
import org.apache.avro.io.DecoderFactory;
import org.apache.avro.io.Encoder;
@@ -104,7 +104,7 @@ private MarshallableType getType(int type) {
@Override
protected ByteBuffer objectToBuffer(Object o, int estimatedSize) throws IOException {
ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(estimatedSize);
- Encoder encoder = new BinaryEncoder(baos);
+ Encoder encoder = new EncoderFactory().binaryEncoder(baos, null);
objectToBuffer(o, encoder);
return new ByteBufferImpl(baos.getRawBuffer(), 0, baos.size());
}
--
1.9.0