Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 83D7D200D2D for ; Thu, 12 Oct 2017 20:28:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 82ABC1609E4; Thu, 12 Oct 2017 18:28:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CD7FE160BE6 for ; Thu, 12 Oct 2017 20:28:14 +0200 (CEST) Received: (qmail 27401 invoked by uid 500); 12 Oct 2017 18:28:14 -0000 Mailing-List: contact commits-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@drill.apache.org Delivered-To: mailing list commits@drill.apache.org Received: (qmail 27245 invoked by uid 99); 12 Oct 2017 18:28:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Oct 2017 18:28:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B449CDFCBC; Thu, 12 Oct 2017 18:28:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: parthc@apache.org To: commits@drill.apache.org Date: Thu, 12 Oct 2017 18:28:17 -0000 Message-Id: In-Reply-To: <2ebe1d9b87e04553bd7f87719e8a3982@git.apache.org> References: <2ebe1d9b87e04553bd7f87719e8a3982@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/13] drill git commit: DRILL-5431: Upgrade Netty to 4.0.47 archived-at: Thu, 12 Oct 2017 18:28:15 -0000 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 Authored: Tue May 16 14:48:57 2017 -0700 Committer: Parth Chandra 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 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 @@ io.netty netty-handler - 4.0.27.Final + 4.0.47.Final + + + + io.netty + netty-common + 4.0.47.Final