use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class MetadataManager method revokeTablePrivileges.
@Override
public void revokeTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, String grantee, boolean grantOption) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, tableName.getCatalogName());
ConnectorId connectorId = catalogMetadata.getConnectorId();
ConnectorMetadata metadata = catalogMetadata.getMetadata();
metadata.revokeTablePrivileges(session.toConnectorSession(connectorId), tableName.asSchemaTableName(), privileges, grantee, grantOption);
}
use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class MetadataManager method createSchema.
@Override
public void createSchema(Session session, CatalogSchemaName schema, Map<String, Object> properties) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, schema.getCatalogName());
ConnectorId connectorId = catalogMetadata.getConnectorId();
ConnectorMetadata metadata = catalogMetadata.getMetadata();
metadata.createSchema(session.toConnectorSession(connectorId), schema.getSchemaName(), properties);
}
use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class MetadataManager method beginQuery.
@Override
public void beginQuery(Session session, Set<ConnectorId> connectors) {
for (ConnectorId connectorId : connectors) {
ConnectorMetadata metadata = getMetadata(session, connectorId);
ConnectorSession connectorSession = session.toConnectorSession(connectorId);
metadata.beginQuery(connectorSession);
registerCatalogForQueryId(session.getQueryId(), metadata);
}
}
use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class MetadataManager method finishCreateTable.
@Override
public Optional<ConnectorOutputMetadata> finishCreateTable(Session session, OutputTableHandle tableHandle, Collection<Slice> fragments) {
ConnectorId connectorId = tableHandle.getConnectorId();
ConnectorMetadata metadata = getMetadata(session, connectorId);
return metadata.finishCreateTable(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle(), fragments);
}
use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class MetadataManager method getView.
@Override
public Optional<ViewDefinition> getView(Session session, QualifiedObjectName viewName) {
Optional<CatalogMetadata> catalog = getOptionalCatalogMetadata(session, viewName.getCatalogName());
if (catalog.isPresent()) {
CatalogMetadata catalogMetadata = catalog.get();
ConnectorId connectorId = catalogMetadata.getConnectorId(viewName);
ConnectorMetadata metadata = catalogMetadata.getMetadataFor(connectorId);
Map<SchemaTableName, ConnectorViewDefinition> views = metadata.getViews(session.toConnectorSession(connectorId), viewName.asSchemaTableName().toSchemaTablePrefix());
ConnectorViewDefinition view = views.get(viewName.asSchemaTableName());
if (view != null) {
return Optional.of(deserializeView(view.getViewData()));
}
}
return Optional.empty();
}
Aggregations