From 85d30a6314242e48522a3065416b64d3b8ba99e9 Mon Sep 17 00:00:00 2001 From: rongrong Date: Fri, 26 Jul 2019 11:29:56 -0700 Subject: [PATCH] Move FunctionNamespaceManager to SPI --- .../java/com/facebook/presto/metadata/HandleResolver.java | 1 + .../metadata/StaticFunctionNamespaceHandleResolver.java | 1 + .../presto/metadata/StaticFunctionNamespaceManager.java | 1 + .../presto/spi/function}/FunctionHandleResolver.java | 4 +--- .../presto/spi/function}/FunctionNamespaceManager.java | 8 +++----- .../spi/function}/FunctionNamespaceManagerFactory.java | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) rename {presto-main/src/main/java/com/facebook/presto/metadata => presto-spi/src/main/java/com/facebook/presto/spi/function}/FunctionHandleResolver.java (87%) rename {presto-main/src/main/java/com/facebook/presto/metadata => presto-spi/src/main/java/com/facebook/presto/spi/function}/FunctionNamespaceManager.java (88%) rename {presto-main/src/main/java/com/facebook/presto/metadata => presto-spi/src/main/java/com/facebook/presto/spi/function}/FunctionNamespaceManagerFactory.java (94%) diff --git a/presto-main/src/main/java/com/facebook/presto/metadata/HandleResolver.java b/presto-main/src/main/java/com/facebook/presto/metadata/HandleResolver.java index cea0264385ac..9093e81e697c 100644 --- a/presto-main/src/main/java/com/facebook/presto/metadata/HandleResolver.java +++ b/presto-main/src/main/java/com/facebook/presto/metadata/HandleResolver.java @@ -26,6 +26,7 @@ import com.facebook.presto.spi.connector.ConnectorPartitioningHandle; import com.facebook.presto.spi.connector.ConnectorTransactionHandle; import com.facebook.presto.spi.function.FunctionHandle; +import com.facebook.presto.spi.function.FunctionHandleResolver; import com.facebook.presto.split.EmptySplitHandleResolver; import javax.inject.Inject; diff --git a/presto-main/src/main/java/com/facebook/presto/metadata/StaticFunctionNamespaceHandleResolver.java b/presto-main/src/main/java/com/facebook/presto/metadata/StaticFunctionNamespaceHandleResolver.java index 19792a7eccaa..a3803d555e64 100644 --- a/presto-main/src/main/java/com/facebook/presto/metadata/StaticFunctionNamespaceHandleResolver.java +++ b/presto-main/src/main/java/com/facebook/presto/metadata/StaticFunctionNamespaceHandleResolver.java @@ -14,6 +14,7 @@ package com.facebook.presto.metadata; import com.facebook.presto.spi.function.FunctionHandle; +import com.facebook.presto.spi.function.FunctionHandleResolver; public class StaticFunctionNamespaceHandleResolver implements FunctionHandleResolver diff --git a/presto-main/src/main/java/com/facebook/presto/metadata/StaticFunctionNamespaceManager.java b/presto-main/src/main/java/com/facebook/presto/metadata/StaticFunctionNamespaceManager.java index 0e92d23c76b4..47db5cc8700a 100644 --- a/presto-main/src/main/java/com/facebook/presto/metadata/StaticFunctionNamespaceManager.java +++ b/presto-main/src/main/java/com/facebook/presto/metadata/StaticFunctionNamespaceManager.java @@ -154,6 +154,7 @@ import com.facebook.presto.spi.block.BlockEncodingSerde; import com.facebook.presto.spi.function.FunctionHandle; import com.facebook.presto.spi.function.FunctionMetadata; +import com.facebook.presto.spi.function.FunctionNamespaceManager; import com.facebook.presto.spi.function.OperatorType; import com.facebook.presto.spi.function.Signature; import com.facebook.presto.spi.function.SqlFunction; diff --git a/presto-main/src/main/java/com/facebook/presto/metadata/FunctionHandleResolver.java b/presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionHandleResolver.java similarity index 87% rename from presto-main/src/main/java/com/facebook/presto/metadata/FunctionHandleResolver.java rename to presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionHandleResolver.java index b8ed74708744..49474d463eca 100644 --- a/presto-main/src/main/java/com/facebook/presto/metadata/FunctionHandleResolver.java +++ b/presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionHandleResolver.java @@ -11,9 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.facebook.presto.metadata; - -import com.facebook.presto.spi.function.FunctionHandle; +package com.facebook.presto.spi.function; public interface FunctionHandleResolver { diff --git a/presto-main/src/main/java/com/facebook/presto/metadata/FunctionNamespaceManager.java b/presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionNamespaceManager.java similarity index 88% rename from presto-main/src/main/java/com/facebook/presto/metadata/FunctionNamespaceManager.java rename to presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionNamespaceManager.java index e1857ee33c87..59257b90642c 100644 --- a/presto-main/src/main/java/com/facebook/presto/metadata/FunctionNamespaceManager.java +++ b/presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionNamespaceManager.java @@ -11,18 +11,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.facebook.presto.metadata; +package com.facebook.presto.spi.function; import com.facebook.presto.spi.QueryId; -import com.facebook.presto.spi.function.FunctionHandle; -import com.facebook.presto.spi.function.FunctionMetadata; -import com.facebook.presto.spi.function.Signature; -import com.facebook.presto.spi.function.SqlFunction; +import com.facebook.presto.spi.api.Experimental; import com.facebook.presto.spi.relation.FullyQualifiedName; import java.util.Collection; import java.util.List; +@Experimental public interface FunctionNamespaceManager { void addFunctions(List functions); diff --git a/presto-main/src/main/java/com/facebook/presto/metadata/FunctionNamespaceManagerFactory.java b/presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionNamespaceManagerFactory.java similarity index 94% rename from presto-main/src/main/java/com/facebook/presto/metadata/FunctionNamespaceManagerFactory.java rename to presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionNamespaceManagerFactory.java index 186dba03eb08..a4e5e587bdc4 100644 --- a/presto-main/src/main/java/com/facebook/presto/metadata/FunctionNamespaceManagerFactory.java +++ b/presto-spi/src/main/java/com/facebook/presto/spi/function/FunctionNamespaceManagerFactory.java @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.facebook.presto.metadata; +package com.facebook.presto.spi.function; public interface FunctionNamespaceManagerFactory {