You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2020/05/17 15:39:13 UTC
[flink] 11/11: [FLINK-17407] Get the information of external
resource from FunctionContext
This is an automated email from the ASF dual-hosted git repository.
trohrmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 5dededa06592e4b68023bb3a3282849038f18fa2
Author: Yangze Guo <ka...@gmail.com>
AuthorDate: Thu Apr 2 11:14:57 2020 +0800
[FLINK-17407] Get the information of external resource from FunctionContext
This closes #11854.
---
.../java/org/apache/flink/table/functions/FunctionContext.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionContext.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionContext.java
index ad3fbd5..18a2dbc 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionContext.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/FunctionContext.java
@@ -20,11 +20,13 @@ package org.apache.flink.table.functions;
import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.api.common.ExecutionConfig.GlobalJobParameters;
+import org.apache.flink.api.common.externalresource.ExternalResourceInfo;
import org.apache.flink.api.common.functions.Function;
import org.apache.flink.api.common.functions.RuntimeContext;
import org.apache.flink.metrics.MetricGroup;
import java.io.File;
+import java.util.Set;
/**
* A {@link FunctionContext} allows to obtain global runtime information about the context in which the
@@ -81,4 +83,11 @@ public class FunctionContext {
return defaultValue;
}
}
+
+ /**
+ * Get the external resource information.
+ */
+ public Set<ExternalResourceInfo> getExternalResourceInfos(String resourceName) {
+ return context.getExternalResourceInfos(resourceName);
+ }
}