[
https://issues.apache.org/jira/browse/DRILL-7790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17298687#comment-17298687
]
ASF GitHub Bot commented on DRILL-7790:
---------------------------------------
rymarm commented on a change in pull request #2185:
URL: https://github.com/apache/drill/pull/2185#discussion_r591259363
##########
File path:
exec/memory/base/src/main/java/org/apache/drill/exec/memory/DrillByteBufAllocator.java
##########
@@ -111,31 +118,68 @@ public boolean isDirectBufferPooled() {
@Override
public ByteBuf heapBuffer() {
- throw fail();
+ return HEAP_ALLOCATOR.allocateHeap();
}
@Override
public ByteBuf heapBuffer(int initialCapacity) {
- throw fail();
+ return HEAP_ALLOCATOR.allocateHeap(initialCapacity);
}
@Override
public ByteBuf heapBuffer(int initialCapacity, int maxCapacity) {
- throw fail();
+ return HEAP_ALLOCATOR.allocateHeap(initialCapacity, maxCapacity);
}
@Override
public CompositeByteBuf compositeHeapBuffer() {
- throw fail();
+ return compositeHeapBuffer(DEFAULT_MAX_COMPOSITE_COMPONENTS);
}
@Override
public CompositeByteBuf compositeHeapBuffer(int maxNumComponents) {
- throw fail();
- }
-
- private RuntimeException fail() {
- throw new UnsupportedOperationException("Allocator doesn't support
heap-based memory.");
+ return new CompositeByteBuf(this, false, maxNumComponents);
+ }
+
+ /**
+ * This method was copied from AbstractByteBufAllocator. Netty 4.1.x moved
this method from
+ * AbstractByteBuf to AbstractByteBufAllocator. However, as
DrillByteBufAllocator doesn't extend
+ * AbstractByteBufAllocator, it doesn't get the implementation automatically
and we have to copy
+ * the codes.
+ */
+ @Override
+ public int calculateNewCapacity(int minNewCapacity, int maxCapacity) {
Review comment:
Yea, you are right. I were thinking about it, but for some reason decide
to not do like that. But yes, it's a better solution that also let remove
redundant code in `DrillByteBufAllocator` and in `PooledByteBufAllocatorL`.
Done.
##########
File path:
exec/memory/base/src/main/java/org/apache/drill/exec/memory/DrillByteBufAllocator.java
##########
@@ -111,31 +118,68 @@ public boolean isDirectBufferPooled() {
@Override
public ByteBuf heapBuffer() {
- throw fail();
+ return HEAP_ALLOCATOR.allocateHeap();
}
@Override
public ByteBuf heapBuffer(int initialCapacity) {
- throw fail();
+ return HEAP_ALLOCATOR.allocateHeap(initialCapacity);
}
@Override
public ByteBuf heapBuffer(int initialCapacity, int maxCapacity) {
- throw fail();
+ return HEAP_ALLOCATOR.allocateHeap(initialCapacity, maxCapacity);
}
@Override
public CompositeByteBuf compositeHeapBuffer() {
- throw fail();
+ return compositeHeapBuffer(DEFAULT_MAX_COMPOSITE_COMPONENTS);
}
@Override
public CompositeByteBuf compositeHeapBuffer(int maxNumComponents) {
- throw fail();
- }
-
- private RuntimeException fail() {
- throw new UnsupportedOperationException("Allocator doesn't support
heap-based memory.");
+ return new CompositeByteBuf(this, false, maxNumComponents);
+ }
+
+ /**
+ * This method was copied from AbstractByteBufAllocator. Netty 4.1.x moved
this method from
+ * AbstractByteBuf to AbstractByteBufAllocator. However, as
DrillByteBufAllocator doesn't extend
+ * AbstractByteBufAllocator, it doesn't get the implementation automatically
and we have to copy
+ * the codes.
+ */
+ @Override
+ public int calculateNewCapacity(int minNewCapacity, int maxCapacity) {
Review comment:
Yeah, you are right. I were thinking about it, but for some reason
decide to not do like that. But yes, it's a better solution that also let
remove redundant code in `DrillByteBufAllocator` and in
`PooledByteBufAllocatorL`.
Done.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Build Drill with Netty version 4.1.50.Final
> -------------------------------------------
>
> Key: DRILL-7790
> URL: https://issues.apache.org/jira/browse/DRILL-7790
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.17.0
> Reporter: alka kumari
> Assignee: Rymar Maksym
> Priority: Major
>
> Hi,
>
> In apache Drill Client 1.17, Netty version 4.0.48.Final is being used and it
> suffers from vulnerability (CVE-2019-16869):
> https://www.cvedetails.com/cve/CVE-2019-16869/
> https://snyk.io/vuln/maven:io.netty%3Anetty-all
>
> This has been fixed in the latest netty (4.1.50.Final).
>
> We want to build a drill with the latest Netty version that is free from any
> vulnerabilities.
>
> As there are many breaking changes from 4.0.48 to 4.1.50, I have modified the
> code accordingly.
>
> I noticed that after trying to upgrade the dependency, I was unable to
> connect with SSL enabled.
>
> ERROR:
> Connecting to the server timed out. This is sometimes due to a mismatch in
> the SSL configuration between client and server. [ Exception: Waited 10000
> milliseconds for
> org.apache.drill.shaded.guava.com.google.common.util.concurrent.SettableFuture@6ea2bc93[status=PENDING]].
>
>
> I have created a pull request containing the changes which I have tried to
> make.
>
> Could someone please advise further on what needs to be changed?
>
> Regards,
> Alka
--
This message was sent by Atlassian Jira
(v8.3.4#803005)