use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method listRoleGrants.
@Override
public Set<RoleGrant> listRoleGrants(Session session, String catalog, PrestoPrincipal principal) {
Optional<CatalogMetadata> catalogMetadata = getOptionalCatalogMetadata(session, catalog);
if (!catalogMetadata.isPresent()) {
return ImmutableSet.of();
}
ConnectorId connectorId = catalogMetadata.get().getConnectorId();
ConnectorSession connectorSession = session.toConnectorSession(connectorId);
ConnectorMetadata metadata = catalogMetadata.get().getMetadataFor(connectorId);
return metadata.listRoleGrants(connectorSession, principal);
}
use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method getNewTableLayout.
@Override
public Optional<NewTableLayout> getNewTableLayout(Session session, String catalogName, ConnectorTableMetadata tableMetadata) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
ConnectorId connectorId = catalogMetadata.getConnectorId();
ConnectorMetadata metadata = catalogMetadata.getMetadata();
ConnectorTransactionHandle transactionHandle = catalogMetadata.getTransactionHandleFor(connectorId);
ConnectorSession connectorSession = session.toConnectorSession(connectorId);
return metadata.getNewTableLayout(connectorSession, tableMetadata).map(layout -> new NewTableLayout(connectorId, transactionHandle, layout));
}
use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method getLayout.
@Override
public TableLayout getLayout(Session session, TableHandle handle) {
ConnectorId connectorId = handle.getConnectorId();
CatalogMetadata catalogMetadata = getCatalogMetadata(session, connectorId);
ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId);
return fromConnectorLayout(connectorId, handle.getConnectorHandle(), handle.getTransaction(), metadata.getTableLayout(session.toConnectorSession(connectorId), resolveTableLayout(session, handle)));
}
use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method finishStatisticsCollection.
@Override
public void finishStatisticsCollection(Session session, AnalyzeTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics) {
ConnectorId connectorId = tableHandle.getConnectorId();
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, connectorId);
catalogMetadata.getMetadata().finishStatisticsCollection(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle(), computedStatistics);
}
use of com.facebook.presto.spi.ConnectorId in project presto by prestodb.
the class MetadataManager method finishCreateTable.
@Override
public Optional<ConnectorOutputMetadata> finishCreateTable(Session session, OutputTableHandle tableHandle, Collection<Slice> fragments, Collection<ComputedStatistics> computedStatistics) {
ConnectorId connectorId = tableHandle.getConnectorId();
ConnectorMetadata metadata = getMetadata(session, connectorId);
return metadata.finishCreateTable(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle(), fragments, computedStatistics);
}
Aggregations