use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method isLegacyGetLayoutSupported.
@Override
public boolean isLegacyGetLayoutSupported(Session session, TableHandle tableHandle) {
ConnectorId connectorId = tableHandle.getConnectorId();
CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId);
ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId);
return metadata.isLegacyGetLayoutSupported(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle());
}
use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method renameTable.
@Override
public void renameTable(Session session, TableHandle tableHandle, QualifiedObjectName newTableName) {
String catalogName = newTableName.getCatalogName();
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
ConnectorId connectorId = catalogMetadata.getConnectorId();
if (!tableHandle.getConnectorId().equals(connectorId)) {
throw new PrestoException(SYNTAX_ERROR, "Cannot rename tables across catalogs");
}
ConnectorMetadata metadata = catalogMetadata.getMetadata();
metadata.renameTable(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle(), toSchemaTableName(newTableName));
}
use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method dropRole.
@Override
public void dropRole(Session session, String role, String catalog) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalog);
ConnectorId connectorId = catalogMetadata.getConnectorId();
ConnectorMetadata metadata = catalogMetadata.getMetadata();
metadata.dropRole(session.toConnectorSession(connectorId), role);
}
use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method commitPageSinkAsync.
@Override
public ListenableFuture<Void> commitPageSinkAsync(Session session, OutputTableHandle tableHandle, Collection<Slice> fragments) {
ConnectorId connectorId = tableHandle.getConnectorId();
CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId);
ConnectorMetadata metadata = catalogMetadata.getMetadata();
ConnectorSession connectorSession = session.toConnectorSession(connectorId);
return toListenableFuture(metadata.commitPageSinkAsync(connectorSession, tableHandle.getConnectorHandle(), fragments));
}
use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method getTableLayoutFilterCoverage.
@Override
public TableLayoutFilterCoverage getTableLayoutFilterCoverage(Session session, TableHandle tableHandle, Set<String> relevantPartitionColumns) {
requireNonNull(tableHandle, "tableHandle cannot be null");
requireNonNull(relevantPartitionColumns, "relevantPartitionKeys cannot be null");
if (!tableHandle.getLayout().isPresent()) {
return NOT_APPLICABLE;
}
ConnectorId connectorId = tableHandle.getConnectorId();
CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId);
ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId);
return metadata.getTableLayoutFilterCoverage(tableHandle.getLayout().get(), relevantPartitionColumns);
}
Aggregations