Blob Blame History Raw
From f45850a74f511870d74e47e51e7c2795bdc2955e Mon Sep 17 00:00:00 2001
From: Marek Goldmann <marek.goldmann@gmail.com>
Date: Thu, 1 Aug 2013 09:17:16 +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 22c4b61..83bf12e 100644
--- a/client/hotrod-client/pom.xml
+++ b/client/hotrod-client/pom.xml
@@ -25,7 +25,7 @@
       </dependency>
 
       <dependency>
-         <groupId>org.apache.hadoop</groupId>
+         <groupId>org.apache.avro</groupId>
          <artifactId>avro</artifactId>
          <scope>provided</scope>
       </dependency>
@@ -80,4 +80,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 13595f3..3463437 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
@@ -26,7 +26,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;
@@ -125,7 +125,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 ByteBuffer(baos.getRawBuffer(), 0, baos.size());
    }
-- 
1.8.3.1