arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adene...@apache.org
Subject arrow git commit: ARROW-292: [Java] Upgrade Netty to 4.0.41
Date Fri, 16 Sep 2016 18:43:33 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 6f99156c3 -> 3487c2f0c


ARROW-292: [Java] Upgrade Netty to 4.0.41

this closes #137


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/3487c2f0
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/3487c2f0
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/3487c2f0

Branch: refs/heads/master
Commit: 3487c2f0cdc2297a80ba3525c192745313b3da48
Parents: 6f99156
Author: adeneche <adeneche@dremio.com>
Authored: Wed Sep 14 14:46:27 2016 -0700
Committer: adeneche <adeneche@dremio.com>
Committed: Fri Sep 16 11:38:35 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/io/netty/buffer/ArrowBuf.java |  2 +-
 .../netty/buffer/PooledByteBufAllocatorL.java   |  2 +-
 .../netty/buffer/UnsafeDirectLittleEndian.java  | 30 ++++++++++++++++----
 java/pom.xml                                    |  2 +-
 4 files changed, 28 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/3487c2f0/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
----------------------------------------------------------------------
diff --git a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java b/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
index d10f002..b7a268a 100644
--- a/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
+++ b/java/memory/src/main/java/io/netty/buffer/ArrowBuf.java
@@ -452,7 +452,7 @@ public final class ArrowBuf extends AbstractByteBuf implements AutoCloseable
{
       return "";
     }
 
-    return ByteBufUtil.decodeString(nioBuffer(index, length), charset);
+    return ByteBufUtil.decodeString(this, index, length, charset);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/arrow/blob/3487c2f0/java/memory/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
----------------------------------------------------------------------
diff --git a/java/memory/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java b/java/memory/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
index 0b6e3f7..f6feb65 100644
--- a/java/memory/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
+++ b/java/memory/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
@@ -145,7 +145,7 @@ public class PooledByteBufAllocatorL {
     }
 
     private UnsafeDirectLittleEndian newDirectBufferL(int initialCapacity, int maxCapacity)
{
-      PoolThreadCache cache = threadCache.get();
+      PoolThreadCache cache = threadCache();
       PoolArena<ByteBuffer> directArena = cache.directArena;
 
       if (directArena != null) {

http://git-wip-us.apache.org/repos/asf/arrow/blob/3487c2f0/java/memory/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
----------------------------------------------------------------------
diff --git a/java/memory/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java b/java/memory/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
index a94c6d1..dc93602 100644
--- a/java/memory/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
+++ b/java/memory/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
@@ -20,6 +20,9 @@ package io.netty.buffer;
 
 import io.netty.util.internal.PlatformDependent;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.nio.ByteOrder;
 import java.util.concurrent.atomic.AtomicLong;
 
@@ -94,11 +97,6 @@ public final class UnsafeDirectLittleEndian extends WrappedByteBuf {
   }
 
   @Override
-  public ByteOrder order() {
-    return ByteOrder.LITTLE_ENDIAN;
-  }
-
-  @Override
   public ByteBuf order(ByteOrder endianness) {
     return this;
   }
@@ -255,6 +253,28 @@ public final class UnsafeDirectLittleEndian extends WrappedByteBuf {
   }
 
   @Override
+  public int setBytes(int index, InputStream in, int length) throws IOException {
+    wrapped.checkIndex(index, length);
+    byte[] tmp = new byte[length];
+    int readBytes = in.read(tmp);
+    if (readBytes > 0) {
+      PlatformDependent.copyMemory(tmp, 0, addr(index), readBytes);
+    }
+    return readBytes;
+  }
+
+  @Override
+  public ByteBuf getBytes(int index, OutputStream out, int length) throws IOException {
+    wrapped.checkIndex(index, length);
+    if (length != 0) {
+      byte[] tmp = new byte[length];
+      PlatformDependent.copyMemory(addr(index), tmp, 0, length);
+      out.write(tmp);
+    }
+    return this;
+  }
+
+  @Override
   public int hashCode() {
     return System.identityHashCode(this);
   }

http://git-wip-us.apache.org/repos/asf/arrow/blob/3487c2f0/java/pom.xml
----------------------------------------------------------------------
diff --git a/java/pom.xml b/java/pom.xml
index 8eb25af..a8e24ed 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -395,7 +395,7 @@
     <dependency>
       <groupId>io.netty</groupId>
       <artifactId>netty-handler</artifactId>
-      <version>4.0.27.Final</version>
+      <version>4.0.41.Final</version>
     </dependency>
 
     <dependency>


Mime
View raw message