Search in sources :

Example 46 with ConnectorId

use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.

the class MetadataManager method beginDelete.

@Override
public TableHandle beginDelete(Session session, TableHandle tableHandle) {
    ConnectorId connectorId = tableHandle.getConnectorId();
    ConnectorMetadata metadata = getMetadataForWrite(session, connectorId);
    ConnectorTableHandle newHandle = metadata.beginDelete(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle());
    return new TableHandle(tableHandle.getConnectorId(), newHandle);
}
Also used : ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle) ConnectorOutputTableHandle(com.facebook.presto.spi.ConnectorOutputTableHandle) ConnectorInsertTableHandle(com.facebook.presto.spi.ConnectorInsertTableHandle) ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) ConnectorId(com.facebook.presto.connector.ConnectorId) ConnectorTableHandle(com.facebook.presto.spi.ConnectorTableHandle)

Example 47 with ConnectorId

use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.

the class MetadataManager method dropSchema.

@Override
public void dropSchema(Session session, CatalogSchemaName schema) {
    CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, schema.getCatalogName());
    ConnectorId connectorId = catalogMetadata.getConnectorId();
    ConnectorMetadata metadata = catalogMetadata.getMetadata();
    metadata.dropSchema(session.toConnectorSession(connectorId), schema.getSchemaName());
}
Also used : ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) ConnectorId(com.facebook.presto.connector.ConnectorId)

Example 48 with ConnectorId

use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.

the class MetadataManager method getTableMetadata.

@Override
public TableMetadata getTableMetadata(Session session, TableHandle tableHandle) {
    ConnectorId connectorId = tableHandle.getConnectorId();
    ConnectorMetadata metadata = getMetadata(session, connectorId);
    ConnectorTableMetadata tableMetadata = metadata.getTableMetadata(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle());
    return new TableMetadata(connectorId, tableMetadata);
}
Also used : ConnectorTableMetadata(com.facebook.presto.spi.ConnectorTableMetadata) ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) ConnectorTableMetadata(com.facebook.presto.spi.ConnectorTableMetadata) ConnectorId(com.facebook.presto.connector.ConnectorId)

Example 49 with ConnectorId

use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.

the class MetadataManager method finishDelete.

@Override
public void finishDelete(Session session, TableHandle tableHandle, Collection<Slice> fragments) {
    ConnectorId connectorId = tableHandle.getConnectorId();
    ConnectorMetadata metadata = getMetadata(session, connectorId);
    metadata.finishDelete(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle(), fragments);
}
Also used : ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) ConnectorId(com.facebook.presto.connector.ConnectorId)

Example 50 with ConnectorId

use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.

the class MetadataManager method dropTable.

@Override
public void dropTable(Session session, TableHandle tableHandle) {
    ConnectorId connectorId = tableHandle.getConnectorId();
    ConnectorMetadata metadata = getMetadataForWrite(session, connectorId);
    metadata.dropTable(session.toConnectorSession(connectorId), tableHandle.getConnectorHandle());
}
Also used : ConnectorMetadata(com.facebook.presto.spi.connector.ConnectorMetadata) ConnectorId(com.facebook.presto.connector.ConnectorId)

Aggregations

ConnectorId (com.facebook.presto.connector.ConnectorId)76 ConnectorMetadata (com.facebook.presto.spi.connector.ConnectorMetadata)39 ConnectorSession (com.facebook.presto.spi.ConnectorSession)14 Session (com.facebook.presto.Session)12 PrestoException (com.facebook.presto.spi.PrestoException)9 ConnectorTransactionHandle (com.facebook.presto.spi.connector.ConnectorTransactionHandle)7 Test (org.testng.annotations.Test)7 ConnectorId.createInformationSchemaConnectorId (com.facebook.presto.connector.ConnectorId.createInformationSchemaConnectorId)5 ConnectorId.createSystemTablesConnectorId (com.facebook.presto.connector.ConnectorId.createSystemTablesConnectorId)5 TableHandle (com.facebook.presto.metadata.TableHandle)5 ConnectorTableMetadata (com.facebook.presto.spi.ConnectorTableMetadata)5 SchemaTableName (com.facebook.presto.spi.SchemaTableName)5 PlanNodeId (com.facebook.presto.sql.planner.plan.PlanNodeId)5 ImmutableList (com.google.common.collect.ImmutableList)5 QualifiedObjectName (com.facebook.presto.metadata.QualifiedObjectName)4 QualifiedObjectName.convertFromSchemaTableName (com.facebook.presto.metadata.QualifiedObjectName.convertFromSchemaTableName)4 SessionPropertyManager (com.facebook.presto.metadata.SessionPropertyManager)4 ConnectorInsertTableHandle (com.facebook.presto.spi.ConnectorInsertTableHandle)4 SemanticException (com.facebook.presto.sql.analyzer.SemanticException)4 TransactionManager (com.facebook.presto.transaction.TransactionManager)4