Skip to content

Commit

Permalink
Remove ConnectorMetadata#usesLegacyTableLayouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Praveen2112 committed Jan 13, 2022
1 parent 4ae0419 commit 85c230a
Show file tree
Hide file tree
Showing 32 changed files with 0 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,6 @@ public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSess
.collect(toImmutableMap(InformationSchemaTable::getSchemaTableName, table -> table.getTableMetadata().getColumns()));
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@ public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSess
return builder.build();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,6 @@ public Optional<TableHandle> applyDelete(Session session, TableHandle table)
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);

if (metadata.usesLegacyTableLayouts()) {
return Optional.empty();
}

ConnectorSession connectorSession = session.toConnectorSession(catalogName);
return metadata.applyDelete(connectorSession, table.getConnectorHandle())
.map(newHandle -> new TableHandle(catalogName, newHandle, table.getTransaction()));
Expand Down Expand Up @@ -1552,10 +1548,6 @@ public Optional<LimitApplicationResult<TableHandle>> applyLimit(Session session,
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);

if (metadata.usesLegacyTableLayouts()) {
return Optional.empty();
}

ConnectorSession connectorSession = session.toConnectorSession(catalogName);
return metadata.applyLimit(connectorSession, table.getConnectorHandle(), limit)
.map(result -> new LimitApplicationResult<>(
Expand All @@ -1570,10 +1562,6 @@ public Optional<SampleApplicationResult<TableHandle>> applySample(Session sessio
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);

if (metadata.usesLegacyTableLayouts()) {
return Optional.empty();
}

ConnectorSession connectorSession = session.toConnectorSession(catalogName);
return metadata.applySample(connectorSession, table.getConnectorHandle(), sampleType, sampleRatio)
.map(result -> new SampleApplicationResult<>(new TableHandle(
Expand All @@ -1597,10 +1585,6 @@ public Optional<AggregationApplicationResult<TableHandle>> applyAggregation(
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);

if (metadata.usesLegacyTableLayouts()) {
return Optional.empty();
}

ConnectorSession connectorSession = session.toConnectorSession(catalogName);
return metadata.applyAggregation(connectorSession, table.getConnectorHandle(), aggregations, assignments, groupingSets)
.map(result -> {
Expand Down Expand Up @@ -1687,10 +1671,6 @@ public Optional<TopNApplicationResult<TableHandle>> applyTopN(
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);

if (metadata.usesLegacyTableLayouts()) {
return Optional.empty();
}

ConnectorSession connectorSession = session.toConnectorSession(catalogName);
return metadata.applyTopN(connectorSession, table.getConnectorHandle(), topNCount, sortItems, assignments)
.map(result -> new TopNApplicationResult<>(
Expand Down Expand Up @@ -1736,10 +1716,6 @@ public Optional<ConstraintApplicationResult<TableHandle>> applyFilter(Session se
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);

if (metadata.usesLegacyTableLayouts()) {
return Optional.empty();
}

ConnectorSession connectorSession = session.toConnectorSession(catalogName);
return metadata.applyFilter(connectorSession, table.getConnectorHandle(), constraint)
.map(result -> new ConstraintApplicationResult<>(
Expand All @@ -1754,10 +1730,6 @@ public Optional<ProjectionApplicationResult<TableHandle>> applyProjection(Sessio
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);

if (metadata.usesLegacyTableLayouts()) {
return Optional.empty();
}

ConnectorSession connectorSession = session.toConnectorSession(catalogName);
return metadata.applyProjection(connectorSession, table.getConnectorHandle(), projections, assignments)
.map(result -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,6 @@ public void grantTablePrivileges(ConnectorSession session, SchemaTableName table
@Override
public void revokeTablePrivileges(ConnectorSession session, SchemaTableName tableName, Set<Privilege> privileges, TrinoPrincipal grantee, boolean grantOption) {}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,6 @@ public ColumnHandle getDeleteRowIdColumnHandle(ConnectorSession session, Connect
@Override
public void finishDelete(ConnectorSession session, ConnectorTableHandle tableHandle, Collection<Slice> fragments) {}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,14 +942,6 @@ default List<GrantInfo> listTablePrivileges(ConnectorSession session, SchemaTabl
return emptyList();
}

/**
* Whether the connector uses the legacy Table Layout feature.
*/
default boolean usesLegacyTableLayouts()
{
return true;
}

default ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
return new ConnectorTableProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,14 +829,6 @@ public List<GrantInfo> listTablePrivileges(ConnectorSession session, SchemaTable
}
}

@Override
public boolean usesLegacyTableLayouts()
{
try (ThreadContextClassLoader ignored = new ThreadContextClassLoader(classLoader)) {
return delegate.usesLegacyTableLayouts();
}
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,6 @@ public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSess
return columns.build();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public Optional<ConstraintApplicationResult<ConnectorTableHandle>> applyFilter(ConnectorSession session, ConnectorTableHandle table, Constraint constraint)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTable
throw new ColumnNotFoundException(tableName, columnName);
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,6 @@ public Optional<TableScanRedirectApplicationResult> applyTableScanRedirect(Conne
return jdbcClient.getTableScanRedirection(session, tableHandle);
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,6 @@ public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSess
return columns.build();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,6 @@ public Optional<ConnectorViewDefinition> getView(ConnectorSession session, Schem
return Optional.ofNullable(views.get(viewName));
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,6 @@ public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTable
return ((CassandraColumnHandle) columnHandle).getColumnMetadata();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public Optional<ConstraintApplicationResult<ConnectorTableHandle>> applyFilter(ConnectorSession session, ConnectorTableHandle tableHandle, Constraint constraint)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,12 +456,6 @@ public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSess
.collect(toImmutableMap(ConnectorTableMetadata::getTable, ConnectorTableMetadata::getColumns));
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTable
return ((ExampleColumnHandle) columnHandle).getColumnMetadata();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTable
return ((SheetsColumnHandle) columnHandle).getColumnMetadata();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2512,12 +2512,6 @@ public OptionalLong executeDelete(ConnectorSession session, ConnectorTableHandle
return OptionalLong.empty();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,12 +693,6 @@ public OptionalLong executeDelete(ConnectorSession session, ConnectorTableHandle
return OptionalLong.empty();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

public void rollback()
{
// TODO: cleanup open transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ public JmxTableHandle getTableHandle(ConnectorSession session, SchemaTableName t
return getTableHandle(tableName);
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,6 @@ private ConnectorTableMetadata getTableMetadata(ConnectorSession session, Schema
return new ConnectorTableMetadata(schemaTableName, builder.build());
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ public ConnectorTableMetadata getTableMetadata(ConnectorSession connectorSession
return getTableMetadata(((KinesisTableHandle) tableHandle).toSchemaTableName());
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,6 @@ public void finishDelete(ConnectorSession session, ConnectorTableHandle tableHan
{
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ private List<SchemaTableName> listTables(ConnectorSession session, SchemaTablePr
return ImmutableList.of(prefix.toSchemaTableName());
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle tableHandle)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,6 @@ private void updateRowsOnHosts(long tableId, Collection<Slice> fragments)
tables.put(tableId, new TableInfo(tableId, info.getSchemaName(), info.getTableName(), info.getColumns(), dataFragments));
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,6 @@ public Optional<ConnectorOutputMetadata> finishInsert(ConnectorSession session,
return Optional.empty();
}

@Override
public boolean usesLegacyTableLayouts()
{
return false;
}

@Override
public ConnectorTableProperties getTableProperties(ConnectorSession session, ConnectorTableHandle table)
{
Expand Down
Loading

0 comments on commit 85c230a

Please sign in to comment.