Skip to content

Commit

Permalink
Remove unused system tables from Hive connector
Browse files Browse the repository at this point in the history
  • Loading branch information
kokosing committed Nov 17, 2021
1 parent 1562713 commit 9d158d4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import io.trino.spi.connector.ConnectorPageSourceProvider;
import io.trino.spi.connector.ConnectorSplitManager;
import io.trino.spi.connector.ConnectorTransactionHandle;
import io.trino.spi.connector.SystemTable;
import io.trino.spi.connector.TableProcedureMetadata;
import io.trino.spi.eventlistener.EventListener;
import io.trino.spi.procedure.Procedure;
Expand All @@ -54,7 +53,6 @@ public class HiveConnector
private final ConnectorPageSourceProvider pageSourceProvider;
private final ConnectorPageSinkProvider pageSinkProvider;
private final ConnectorNodePartitioningProvider nodePartitioningProvider;
private final Set<SystemTable> systemTables;
private final Set<Procedure> procedures;
private final Set<TableProcedureMetadata> tableProcedures;
private final Set<EventListener> eventListeners;
Expand All @@ -77,7 +75,6 @@ public HiveConnector(
ConnectorPageSourceProvider pageSourceProvider,
ConnectorPageSinkProvider pageSinkProvider,
ConnectorNodePartitioningProvider nodePartitioningProvider,
Set<SystemTable> systemTables,
Set<Procedure> procedures,
Set<TableProcedureMetadata> tableProcedures,
Set<EventListener> eventListeners,
Expand All @@ -96,7 +93,6 @@ public HiveConnector(
this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null");
this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null");
this.nodePartitioningProvider = requireNonNull(nodePartitioningProvider, "nodePartitioningProvider is null");
this.systemTables = ImmutableSet.copyOf(requireNonNull(systemTables, "systemTables is null"));
this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null"));
this.tableProcedures = ImmutableSet.copyOf(requireNonNull(tableProcedures, "tableProcedures is null"));
this.eventListeners = ImmutableSet.copyOf(requireNonNull(eventListeners, "eventListeners is null"));
Expand Down Expand Up @@ -149,12 +145,6 @@ public ConnectorNodePartitioningProvider getNodePartitioningProvider()
return nodePartitioningProvider;
}

@Override
public Set<SystemTable> getSystemTables()
{
return systemTables;
}

@Override
public Set<Procedure> getProcedures()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import io.trino.spi.connector.ConnectorPageSinkProvider;
import io.trino.spi.connector.ConnectorPageSourceProvider;
import io.trino.spi.connector.ConnectorSplitManager;
import io.trino.spi.connector.SystemTable;

import javax.inject.Singleton;

Expand Down Expand Up @@ -124,8 +123,6 @@ public void configure(Binder binder)
configBinder(binder).bindConfig(ParquetReaderConfig.class);
configBinder(binder).bindConfig(ParquetWriterConfig.class);
fileWriterFactoryBinder.addBinding().to(ParquetFileWriterFactory.class).in(Scopes.SINGLETON);

newSetBinder(binder, SystemTable.class);
}

@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import io.trino.spi.connector.ConnectorPageSinkProvider;
import io.trino.spi.connector.ConnectorPageSourceProvider;
import io.trino.spi.connector.ConnectorSplitManager;
import io.trino.spi.connector.SystemTable;
import io.trino.spi.connector.TableProcedureMetadata;
import io.trino.spi.eventlistener.EventListener;
import io.trino.spi.procedure.Procedure;
Expand Down Expand Up @@ -134,7 +133,6 @@ public static Connector createConnector(String catalogName, Map<String, String>
HiveMaterializedViewPropertiesProvider hiveMaterializedViewPropertiesProvider = injector.getInstance(HiveMaterializedViewPropertiesProvider.class);
Set<Procedure> procedures = injector.getInstance(Key.get(new TypeLiteral<Set<Procedure>>() {}));
Set<TableProcedureMetadata> tableProcedures = injector.getInstance(Key.get(new TypeLiteral<Set<TableProcedureMetadata>>() {}));
Set<SystemTable> systemTables = injector.getInstance(Key.get(new TypeLiteral<Set<SystemTable>>() {}));
Set<EventListener> eventListeners = injector.getInstance(Key.get(new TypeLiteral<Set<EventListener>>() {}))
.stream()
.map(listener -> new ClassLoaderSafeEventListener(listener, classLoader))
Expand All @@ -152,7 +150,6 @@ public static Connector createConnector(String catalogName, Map<String, String>
new ClassLoaderSafeConnectorPageSourceProvider(connectorPageSource, classLoader),
new ClassLoaderSafeConnectorPageSinkProvider(pageSinkProvider, classLoader),
new ClassLoaderSafeNodePartitioningProvider(connectorDistributionProvider, classLoader),
systemTables,
procedures,
tableProcedures,
eventListeners,
Expand Down

0 comments on commit 9d158d4

Please sign in to comment.