drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From par...@apache.org
Subject [05/13] drill git commit: DRILL-5431: Upgrade Netty to 4.0.47
Date Thu, 12 Oct 2017 18:28:17 GMT
DRILL-5431: Upgrade Netty to 4.0.47


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/78e0dcd0
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/78e0dcd0
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/78e0dcd0

Branch: refs/heads/master
Commit: 78e0dcd09639f948549b0eb10710807c634aefb7
Parents: ebddd61
Author: Sudheesh Katkam <sudheesh@apache.org>
Authored: Tue May 16 14:48:57 2017 -0700
Committer: Parth Chandra <parthc@apache.org>
Committed: Wed Oct 11 19:26:13 2017 -0700

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


http://git-wip-us.apache.org/repos/asf/drill/blob/78e0dcd0/exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java
----------------------------------------------------------------------
diff --git a/exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java b/exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java
index 5029c56..9019507 100644
--- a/exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java
+++ b/exec/memory/base/src/main/java/io/netty/buffer/DrillBuf.java
@@ -455,7 +455,7 @@ public final class DrillBuf 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/drill/blob/78e0dcd0/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
----------------------------------------------------------------------
diff --git a/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java b/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
index 1ee7964..5358ca2 100644
--- a/exec/memory/base/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
+++ b/exec/memory/base/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/drill/blob/78e0dcd0/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
----------------------------------------------------------------------
diff --git a/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
b/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
index c91944f..983ec93 100644
--- a/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
+++ b/exec/memory/base/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
@@ -18,6 +18,11 @@
 
 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;
 
@@ -70,19 +75,19 @@ public final class UnsafeDirectLittleEndian extends WrappedByteBuf {
   }
 
   private long addr(int index) {
-    return memoryAddress + index;
+      return memoryAddress + index;
   }
 
   @Override
   public long getLong(int index) {
-//  wrapped.checkIndex(index, 8);
+    //wrapped.checkIndex(index, 8);
     return PlatformDependent.getLong(addr(index));
   }
 
   @Override
   public float getFloat(int index) {
-    return Float.intBitsToFloat(getInt(index));
-  }
+        return Float.intBitsToFloat(getInt(index));
+    }
 
   @Override
   public ByteBuf slice() {
@@ -95,11 +100,6 @@ public final class UnsafeDirectLittleEndian extends WrappedByteBuf {
   }
 
   @Override
-  public ByteOrder order() {
-    return ByteOrder.LITTLE_ENDIAN;
-  }
-
-  @Override
   public ByteBuf order(ByteOrder endianness) {
     return this;
   }
@@ -293,6 +293,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/drill/blob/78e0dcd0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 532fe51..c946929 100644
--- a/pom.xml
+++ b/pom.xml
@@ -568,7 +568,13 @@
     <dependency>
       <groupId>io.netty</groupId>
       <artifactId>netty-handler</artifactId>
-      <version>4.0.27.Final</version>
+      <version>4.0.47.Final</version>
+    </dependency>
+
+    <dependency>
+      <groupId>io.netty</groupId>
+      <artifactId>netty-common</artifactId>
+      <version>4.0.47.Final</version>
     </dependency>
 
     <dependency>


Mime
View raw message