use of io.trino.spi.connector.ConnectorMetadata in project trino by trinodb.
the class MetadataManager method revokeRoles.
@Override
public void revokeRoles(Session session, Set<String> roles, Set<TrinoPrincipal> grantees, boolean adminOption, Optional<TrinoPrincipal> grantor, Optional<String> catalog) {
if (catalog.isEmpty()) {
systemSecurityMetadata.revokeRoles(session, roles, grantees, adminOption, grantor);
return;
}
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalog.get());
CatalogName catalogName = catalogMetadata.getCatalogName();
ConnectorMetadata metadata = catalogMetadata.getMetadata(session);
metadata.revokeRoles(session.toConnectorSession(catalogName), roles, grantees, adminOption, grantor);
}
use of io.trino.spi.connector.ConnectorMetadata in project trino by trinodb.
the class MetadataManager method setColumnComment.
@Override
public void setColumnComment(Session session, TableHandle tableHandle, ColumnHandle column, Optional<String> comment) {
CatalogName catalogName = tableHandle.getCatalogName();
ConnectorMetadata metadata = getMetadataForWrite(session, catalogName);
metadata.setColumnComment(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle(), column, comment);
}
use of io.trino.spi.connector.ConnectorMetadata in project trino by trinodb.
the class MetadataManager method addColumn.
@Override
public void addColumn(Session session, TableHandle tableHandle, ColumnMetadata column) {
CatalogName catalogName = tableHandle.getCatalogName();
ConnectorMetadata metadata = getMetadataForWrite(session, catalogName);
metadata.addColumn(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle(), column);
}
use of io.trino.spi.connector.ConnectorMetadata in project trino by trinodb.
the class MetadataManager method setTableAuthorization.
@Override
public void setTableAuthorization(Session session, CatalogSchemaTableName table, TrinoPrincipal principal) {
CatalogName catalogName = new CatalogName(table.getCatalogName());
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
ConnectorMetadata metadata = catalogMetadata.getMetadata(session);
if (catalogMetadata.getSecurityManagement() == SecurityManagement.SYSTEM) {
systemSecurityMetadata.setTableOwner(session, table, principal);
} else {
metadata.setTableAuthorization(session.toConnectorSession(catalogName), table.getSchemaTableName(), principal);
}
}
use of io.trino.spi.connector.ConnectorMetadata in project trino by trinodb.
the class MetadataManager method getStatisticsCollectionMetadata.
@Override
public TableStatisticsMetadata getStatisticsCollectionMetadata(Session session, String catalogName, ConnectorTableMetadata tableMetadata) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
ConnectorMetadata metadata = catalogMetadata.getMetadata(session);
CatalogName catalog = catalogMetadata.getCatalogName();
return metadata.getStatisticsCollectionMetadata(session.toConnectorSession(catalog), tableMetadata);
}
Aggregations