Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.ConnectorMetadata


        addConnector(null, connectorId, connector);
    }

    private void addConnector(@Nullable String catalogName, String connectorId, Connector connector)
    {
        ConnectorMetadata connectorMetadata = connector.getService(ConnectorMetadata.class);
        checkState(connectorMetadata != null, "Connector %s can not provide metadata", connectorId);

        ConnectorSplitManager connectorSplitManager = connector.getService(ConnectorSplitManager.class);
        checkState(connectorSplitManager != null, "Connector %s does not have a split manager", connectorId);
View Full Code Here


    }

    @Override
    public TableHandle createTable(String catalogName, TableMetadata tableMetadata)
    {
        ConnectorMetadata connectorMetadata = connectors.get(catalogName);
        checkArgument(connectorMetadata != null, "Catalog %s does not exist", catalogName);
        return connectorMetadata.createTable(tableMetadata);
    }
View Full Code Here

    @Override
    public Optional<TableHandle> getTableHandle(String connectorId, SchemaTableName tableName)
    {
        // use catalog name in place of connector id
        ConnectorMetadata metadata = connectors.get(connectorId);
        if (metadata == null) {
            return Optional.absent();
        }
        return Optional.fromNullable(metadata.getTableHandle(tableName));
    }
View Full Code Here

    private List<ConnectorMetadata> allConnectorsFor(String catalogName)
    {
        ImmutableList.Builder<ConnectorMetadata> builder = ImmutableList.builder();
        builder.addAll(internalSchemas);
        ConnectorMetadata connector = connectors.get(catalogName);
        if (connector != null) {
            builder.add(connector);
        }
        ConnectorMetadata informationSchema = informationSchemas.get(catalogName);
        if (informationSchema != null) {
            builder.add(informationSchema);
        }
        return builder.build();
    }
View Full Code Here

        checkNotNull(prefix, "prefix is null");
        SchemaTablePrefix tablePrefix = prefix.asSchemaTablePrefix();

        Map<QualifiedTableName, List<ColumnMetadata>> tableColumns = new HashMap<>();
        for (ConnectorMetadataEntry connectorMetadata : allConnectorsFor(prefix.getCatalogName())) {
            ConnectorMetadata metadata = connectorMetadata.getMetadata();

            for (Entry<SchemaTableName, List<ColumnMetadata>> entry : metadata.listTableColumns(session, tablePrefix).entrySet()) {
                QualifiedTableName tableName = new QualifiedTableName(
                        prefix.getCatalogName(),
                        entry.getKey().getSchemaName(),
                        entry.getKey().getTableName());
                tableColumns.put(tableName, entry.getValue());
            }

            // if table and view names overlap, the view wins
            for (Entry<SchemaTableName, String> entry : metadata.getViews(session, tablePrefix).entrySet()) {
                QualifiedTableName tableName = new QualifiedTableName(
                        prefix.getCatalogName(),
                        entry.getKey().getSchemaName(),
                        entry.getKey().getTableName());
View Full Code Here

    private ConnectorMetadata lookupConnectorFor(TableHandle tableHandle)
    {
        checkNotNull(tableHandle, "tableHandle is null");

        ConnectorMetadata result = connectorsById.get(tableHandle.getConnectorId());
        checkArgument(result != null, "No connector for table handle: %s", tableHandle.getConnectorId());

        return result;
    }
View Full Code Here

        return result;
    }

    private ConnectorMetadata lookupConnectorFor(OutputTableHandle tableHandle)
    {
        ConnectorMetadata metadata = connectorsById.get(tableHandle.getConnectorId());
        checkArgument(metadata != null, "No connector for output table handle: %s", tableHandle.getConnectorId());
        return metadata;
    }
View Full Code Here

        addConnector(null, connectorId, connector);
    }

    private void addConnector(@Nullable String catalogName, String connectorId, Connector connector)
    {
        ConnectorMetadata connectorMetadata = connector.getService(ConnectorMetadata.class);
        checkState(connectorMetadata != null, "Connector %s can not provide metadata", connectorId);

        ConnectorSplitManager connectorSplitManager = connector.getService(ConnectorSplitManager.class);
        checkState(connectorSplitManager != null, "Connector %s does not have a split manager", connectorId);
View Full Code Here

    private ConnectorMetadata lookupConnectorFor(TableHandle tableHandle)
    {
        checkNotNull(tableHandle, "tableHandle is null");

        ConnectorMetadata result = connectorsById.get(tableHandle.getConnectorId());
        checkArgument(result != null, "No connector for table handle: %s", tableHandle.getConnectorId());

        return result;
    }
View Full Code Here

        return result;
    }

    private ConnectorMetadata lookupConnectorFor(OutputTableHandle tableHandle)
    {
        ConnectorMetadata metadata = connectorsById.get(tableHandle.getConnectorId());
        checkArgument(metadata != null, "No connector for output table handle: %s", tableHandle.getConnectorId());
        return metadata;
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.ConnectorMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.