From f8c48f981756056062c019105762302b06dc6c24 Mon Sep 17 00:00:00 2001 From: JingsongLi Date: Wed, 14 Dec 2022 16:33:57 +0800 Subject: [PATCH] Update FileSystem initialize --- .../trino/TrinoConnectorFactoryBase.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/apache/flink/table/store/trino/TrinoConnectorFactoryBase.java b/src/main/java/org/apache/flink/table/store/trino/TrinoConnectorFactoryBase.java index d5c82c90..f3a490a6 100644 --- a/src/main/java/org/apache/flink/table/store/trino/TrinoConnectorFactoryBase.java +++ b/src/main/java/org/apache/flink/table/store/trino/TrinoConnectorFactoryBase.java @@ -19,18 +19,15 @@ package org.apache.flink.table.store.trino; import org.apache.flink.configuration.Configuration; -import org.apache.flink.core.fs.FileSystem; -import org.apache.flink.core.plugin.PluginUtils; -import org.apache.flink.runtime.security.SecurityConfiguration; -import org.apache.flink.runtime.security.SecurityUtils; +import org.apache.flink.table.store.file.catalog.CatalogFactory; +import org.apache.flink.table.store.filesystem.FileSystems; + +import java.util.Map; import io.trino.spi.connector.Connector; import io.trino.spi.connector.ConnectorContext; import io.trino.spi.connector.ConnectorFactory; - -import java.util.Map; - /** Trino {@link ConnectorFactory}. */ public abstract class TrinoConnectorFactoryBase implements ConnectorFactory { @Override @@ -43,13 +40,7 @@ public Connector create( String catalogName, Map config, ConnectorContext context) { Configuration configuration = Configuration.fromMap(config); // initialize file system - FileSystem.initialize( - configuration, PluginUtils.createPluginManagerFromRootFolder(configuration)); - try { - SecurityUtils.install(new SecurityConfiguration(configuration)); - } catch (Exception e) { - throw new RuntimeException(e); - } + FileSystems.initialize(CatalogFactory.warehouse(configuration), configuration); return new TrinoConnector( new TrinoMetadata(configuration), new TrinoSplitManager(),