Search in sources :

Example 1 with ConnectorMetadataUpdater

use of com.facebook.presto.spi.connector.ConnectorMetadataUpdater in project presto by prestodb.

the class SqlTask method getMetadataUpdateRequests.

private MetadataUpdates getMetadataUpdateRequests(TaskHolder taskHolder) {
    ConnectorId connectorId = null;
    ImmutableList.Builder<ConnectorMetadataUpdateHandle> connectorMetadataUpdatesBuilder = ImmutableList.builder();
    if (taskHolder.getTaskExecution() != null) {
        TaskMetadataContext taskMetadataContext = taskHolder.getTaskExecution().getTaskContext().getTaskMetadataContext();
        if (!taskMetadataContext.getMetadataUpdaters().isEmpty()) {
            connectorId = taskMetadataContext.getConnectorId();
            for (ConnectorMetadataUpdater metadataUpdater : taskMetadataContext.getMetadataUpdaters()) {
                connectorMetadataUpdatesBuilder.addAll(metadataUpdater.getPendingMetadataUpdateRequests());
            }
        }
    }
    return new MetadataUpdates(connectorId, connectorMetadataUpdatesBuilder.build());
}
Also used : MetadataUpdates(com.facebook.presto.metadata.MetadataUpdates) ConnectorMetadataUpdater(com.facebook.presto.spi.connector.ConnectorMetadataUpdater) ImmutableList(com.google.common.collect.ImmutableList) ConnectorMetadataUpdateHandle(com.facebook.presto.spi.ConnectorMetadataUpdateHandle) ConnectorId(com.facebook.presto.spi.ConnectorId)

Aggregations

MetadataUpdates (com.facebook.presto.metadata.MetadataUpdates)1 ConnectorId (com.facebook.presto.spi.ConnectorId)1 ConnectorMetadataUpdateHandle (com.facebook.presto.spi.ConnectorMetadataUpdateHandle)1 ConnectorMetadataUpdater (com.facebook.presto.spi.connector.ConnectorMetadataUpdater)1 ImmutableList (com.google.common.collect.ImmutableList)1