You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by vo...@apache.org on 2020/03/23 11:49:04 UTC

[drill] 01/02: DRILL-7656: Support injecting BufferManager into UDF

This is an automated email from the ASF dual-hosted git repository.

volodymyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git

commit 233e047a227d8ad3c38665bf929c02762277088c
Author: weijie.tong <we...@alipay.com>
AuthorDate: Sat Mar 21 10:04:31 2020 +0800

    DRILL-7656: Support injecting BufferManager into UDF
    
    closes #2036
---
 .../src/main/java/org/apache/drill/exec/ops/BaseFragmentContext.java | 5 +++++
 .../src/main/java/org/apache/drill/exec/ops/FragmentContext.java     | 2 ++
 .../src/main/java/org/apache/drill/exec/ops/UdfUtilities.java        | 1 +
 3 files changed, 8 insertions(+)

diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/BaseFragmentContext.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/BaseFragmentContext.java
index e795bcf..6217510 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/BaseFragmentContext.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/BaseFragmentContext.java
@@ -122,4 +122,9 @@ public abstract class BaseFragmentContext implements FragmentContext {
   public QueryContext.SqlStatementType getSQLStatementType() {
     return null;
   }
+
+  @Override
+  public BufferManager getManagedBufferManager() {
+    return getBufferManager();
+  }
 }
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java
index ac981da..0ccf0c7 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java
@@ -167,6 +167,8 @@ public interface FragmentContext extends UdfUtilities, AutoCloseable {
 
   DrillBuf getManagedBuffer(int size);
 
+  BufferManager getManagedBufferManager();
+
   @Override
   void close();
 
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/UdfUtilities.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/UdfUtilities.java
index 96b91da..6617b25 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/UdfUtilities.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/UdfUtilities.java
@@ -41,6 +41,7 @@ public interface UdfUtilities {
           .put(PartitionExplorer.class, "getPartitionExplorer")
           .put(ContextInformation.class, "getContextInformation")
           .put(OptionManager.class, "getOptions")
+          .put(BufferManager.class, "getManagedBufferManager")
           .build();