use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.
the class MetadataManager method dropTable.
@Override
public void dropTable(Session session, TableHandle tableHandle) {
CatalogName catalogName = tableHandle.getCatalogName();
ConnectorMetadata metadata = getMetadataForWrite(session, catalogName);
metadata.dropTable(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle());
}
use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.
the class MetadataManager method isExecutionPlanCacheSupported.
/**
* Hetu can only cache execution plans for supported connectors.
* This method checks if the property for supporting execution plan caching is enabled for a given connector.
*
* @param session Presto session
* @param table table handle containing a ConnectorTableHandle
*/
@Override
public boolean isExecutionPlanCacheSupported(Session session, TableHandle table) {
CatalogName catalogName = table.getCatalogName();
ConnectorMetadata metadata = getMetadata(session, catalogName);
return metadata.isExecutionPlanCacheSupported(session.toConnectorSession(), table.getConnectorHandle());
}
use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.
the class MetadataManager method createTable.
@Override
public void createTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, boolean ignoreExisting) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
CatalogName catalog = catalogMetadata.getCatalogName();
ConnectorMetadata metadata = catalogMetadata.getMetadata();
metadata.createTable(session.toConnectorSession(catalog), tableMetadata, ignoreExisting);
}
use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.
the class MetadataManager method beginInsert.
@Override
public InsertTableHandle beginInsert(Session session, TableHandle tableHandle, boolean isOverwrite) {
CatalogName catalogName = tableHandle.getCatalogName();
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
ConnectorMetadata metadata = catalogMetadata.getMetadata();
ConnectorTransactionHandle transactionHandle = catalogMetadata.getTransactionHandleFor(catalogName);
ConnectorInsertTableHandle handle;
if (isOverwrite) {
handle = metadata.beginInsert(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle(), true);
} else {
handle = metadata.beginInsert(session.toConnectorSession(catalogName), tableHandle.getConnectorHandle());
}
return new InsertTableHandle(tableHandle.getCatalogName(), transactionHandle, handle);
}
use of io.prestosql.spi.connector.ConnectorMetadata in project hetu-core by openlookeng.
the class MetadataManager method getNewTableLayout.
@Override
public Optional<NewTableLayout> getNewTableLayout(Session session, String catalogName, ConnectorTableMetadata tableMetadata) {
CatalogMetadata catalogMetadata = getCatalogMetadataForWrite(session, catalogName);
CatalogName catalog = catalogMetadata.getCatalogName();
ConnectorMetadata metadata = catalogMetadata.getMetadata();
ConnectorTransactionHandle transactionHandle = catalogMetadata.getTransactionHandleFor(catalog);
ConnectorSession connectorSession = session.toConnectorSession(catalog);
return metadata.getNewTableLayout(connectorSession, tableMetadata).map(layout -> new NewTableLayout(catalog, transactionHandle, layout));
}
Aggregations