Skip to content

Commit

Permalink
Update FileSystem initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Dec 14, 2022
1 parent 4f3e060 commit f8c48f9
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,13 +40,7 @@ public Connector create(
String catalogName, Map<String, String> 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(),
Expand Down

0 comments on commit f8c48f9

Please sign in to comment.