当前位置: 首页>>代码示例>>Java>>正文


Java Session.toConnectorSession方法代码示例

本文整理汇总了Java中com.facebook.presto.Session.toConnectorSession方法的典型用法代码示例。如果您正苦于以下问题:Java Session.toConnectorSession方法的具体用法?Java Session.toConnectorSession怎么用?Java Session.toConnectorSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.presto.Session的用法示例。


在下文中一共展示了Session.toConnectorSession方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLayouts

import com.facebook.presto.Session; //导入方法依赖的package包/类
@Override
public List<TableLayoutResult> getLayouts(Session session, TableHandle table, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns)
{
    if (constraint.getSummary().isNone()) {
        return ImmutableList.of();
    }

    TupleDomain<ColumnHandle> summary = constraint.getSummary();
    String connectorId = table.getConnectorId();
    ConnectorTableHandle connectorTable = table.getConnectorHandle();
    Predicate<Map<ColumnHandle, NullableValue>> predicate = constraint.predicate();

    ConnectorEntry entry = getConnectorMetadata(connectorId);
    ConnectorMetadata metadata = entry.getMetadata(session);
    ConnectorTransactionHandle transaction = entry.getTransactionHandle(session);
    ConnectorSession connectorSession = session.toConnectorSession(entry.getCatalog());
    List<ConnectorTableLayoutResult> layouts = metadata.getTableLayouts(connectorSession, connectorTable, new Constraint<>(summary, predicate::test), desiredColumns);

    return layouts.stream()
            .map(layout -> new TableLayoutResult(fromConnectorLayout(connectorId, transaction, layout.getTableLayout()), layout.getUnenforcedConstraint()))
            .collect(toImmutableList());
}
 
开发者ID:y-lan,项目名称:presto,代码行数:23,代码来源:MetadataManager.java

示例2: listTables

import com.facebook.presto.Session; //导入方法依赖的package包/类
@Override
public List<QualifiedObjectName> listTables(Session session, QualifiedTablePrefix prefix)
{
    requireNonNull(prefix, "prefix is null");

    String schemaNameOrNull = prefix.getSchemaName().orElse(null);
    Set<QualifiedObjectName> tables = new LinkedHashSet<>();
    for (ConnectorEntry entry : allConnectorsFor(prefix.getCatalogName())) {
        ConnectorMetadata metadata = entry.getMetadata(session);
        ConnectorSession connectorSession = session.toConnectorSession(entry.getCatalog());
        for (QualifiedObjectName tableName : transform(metadata.listTables(connectorSession, schemaNameOrNull), convertFromSchemaTableName(prefix.getCatalogName()))) {
            tables.add(tableName);
        }
    }
    return ImmutableList.copyOf(tables);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:17,代码来源:MetadataManager.java

示例3: listViews

import com.facebook.presto.Session; //导入方法依赖的package包/类
@Override
public List<QualifiedObjectName> listViews(Session session, QualifiedTablePrefix prefix)
{
    requireNonNull(prefix, "prefix is null");

    String schemaNameOrNull = prefix.getSchemaName().orElse(null);
    Set<QualifiedObjectName> views = new LinkedHashSet<>();
    for (ConnectorEntry entry : allConnectorsFor(prefix.getCatalogName())) {
        ConnectorMetadata metadata = entry.getMetadata(session);
        ConnectorSession connectorSession = session.toConnectorSession(entry.getCatalog());
        for (QualifiedObjectName tableName : transform(metadata.listViews(connectorSession, schemaNameOrNull), convertFromSchemaTableName(prefix.getCatalogName()))) {
            views.add(tableName);
        }
    }
    return ImmutableList.copyOf(views);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:17,代码来源:MetadataManager.java

示例4: getViews

import com.facebook.presto.Session; //导入方法依赖的package包/类
@Override
public Map<QualifiedObjectName, ViewDefinition> getViews(Session session, QualifiedTablePrefix prefix)
{
    requireNonNull(prefix, "prefix is null");
    SchemaTablePrefix tablePrefix = prefix.asSchemaTablePrefix();

    Map<QualifiedObjectName, ViewDefinition> views = new LinkedHashMap<>();
    for (ConnectorEntry connectorEntry : allConnectorsFor(prefix.getCatalogName())) {
        ConnectorMetadata metadata = connectorEntry.getMetadata(session);
        ConnectorSession connectorSession = session.toConnectorSession(connectorEntry.getCatalog());
        for (Entry<SchemaTableName, ConnectorViewDefinition> entry : metadata.getViews(connectorSession, tablePrefix).entrySet()) {
            QualifiedObjectName viewName = new QualifiedObjectName(
                    prefix.getCatalogName(),
                    entry.getKey().getSchemaName(),
                    entry.getKey().getTableName());
            views.put(viewName, deserializeView(entry.getValue().getViewData()));
        }
    }
    return ImmutableMap.copyOf(views);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:21,代码来源:MetadataManager.java

示例5: beginCreateTable

import com.facebook.presto.Session; //导入方法依赖的package包/类
@Override
public OutputTableHandle beginCreateTable(Session session, String catalogName, TableMetadata tableMetadata)
{
    ConnectorEntry entry = connectorsByCatalog.get(catalogName);
    checkArgument(entry != null, "Catalog %s does not exist", catalogName);
    ConnectorMetadata metadata = entry.getMetadataForWrite(session);
    ConnectorTransactionHandle transactionHandle = entry.getTransactionHandle(session);
    ConnectorSession connectorSession = session.toConnectorSession(entry.getCatalog());
    ConnectorOutputTableHandle handle = metadata.beginCreateTable(connectorSession, tableMetadata.getMetadata());
    return new OutputTableHandle(entry.getConnectorId(), transactionHandle, handle);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:12,代码来源:MetadataManager.java

示例6: resolveIndex

import com.facebook.presto.Session; //导入方法依赖的package包/类
@Override
public Optional<ResolvedIndex> resolveIndex(Session session, TableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain)
{
    ConnectorEntry entry = lookupConnectorFor(tableHandle);
    ConnectorMetadata metadata = entry.getMetadata(session);
    ConnectorTransactionHandle transaction = entry.getTransactionHandle(session);
    ConnectorSession connectorSession = session.toConnectorSession(entry.getCatalog());
    Optional<ConnectorResolvedIndex> resolvedIndex = metadata.resolveIndex(connectorSession, tableHandle.getConnectorHandle(), indexableColumns, outputColumns, tupleDomain);
    return resolvedIndex.map(resolved -> new ResolvedIndex(tableHandle.getConnectorId(), transaction, resolved));
}
 
开发者ID:y-lan,项目名称:presto,代码行数:11,代码来源:MetadataManager.java

示例7: ExpressionInterpreter

import com.facebook.presto.Session; //导入方法依赖的package包/类
private ExpressionInterpreter(Expression expression, Metadata metadata, Session session, IdentityHashMap<Expression, Type> expressionTypes, boolean optimize)
{
    this.expression = expression;
    this.metadata = metadata;
    this.session = session.toConnectorSession();
    this.expressionTypes = expressionTypes;
    this.optimize = optimize;

    this.visitor = new Visitor();
}
 
开发者ID:y-lan,项目名称:presto,代码行数:11,代码来源:ExpressionInterpreter.java

示例8: createPageSink

import com.facebook.presto.Session; //导入方法依赖的package包/类
@Override
public ConnectorPageSink createPageSink(Session session, OutputTableHandle tableHandle)
{
    // assumes connectorId and catalog are the same
    ConnectorSession connectorSession = session.toConnectorSession(tableHandle.getConnectorId());
    return providerFor(tableHandle.getConnectorId()).createPageSink(tableHandle.getTransactionHandle(), connectorSession, tableHandle.getConnectorHandle());
}
 
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:PageSinkManager.java

示例9: getSplits

import com.facebook.presto.Session; //导入方法依赖的package包/类
public SplitSource getSplits(Session session, TableLayoutHandle layout)
{
    String connectorId = layout.getConnectorId();
    ConnectorSplitManager splitManager = getConnectorSplitManager(connectorId);

    // assumes connectorId and catalog are the same
    ConnectorSession connectorSession = session.toConnectorSession(connectorId);

    ConnectorSplitSource source = splitManager.getSplits(layout.getTransactionHandle(), connectorSession, layout.getConnectorHandle());

    return new ConnectorAwareSplitSource(connectorId, layout.getTransactionHandle(), source);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:13,代码来源:SplitManager.java

示例10: createPageSource

import com.facebook.presto.Session; //导入方法依赖的package包/类
@Override
public ConnectorPageSource createPageSource(Session session, Split split, List<ColumnHandle> columns)
{
    requireNonNull(split, "split is null");
    requireNonNull(columns, "columns is null");

    // assumes connectorId and catalog are the same
    ConnectorSession connectorSession = session.toConnectorSession(split.getConnectorId());
    return getPageSourceProvider(split).createPageSource(split.getTransactionHandle(), connectorSession, split.getConnectorSplit(), columns);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:11,代码来源:PageSourceManager.java

示例11: getIndex

import com.facebook.presto.Session; //导入方法依赖的package包/类
public ConnectorIndex getIndex(Session session, IndexHandle indexHandle, List<ColumnHandle> lookupSchema, List<ColumnHandle> outputSchema)
{
    ConnectorSession connectorSession = session.toConnectorSession(indexHandle.getConnectorId());
    ConnectorIndexProvider provider = getProvider(indexHandle);
    return provider.getIndex(indexHandle.getTransactionHandle(), connectorSession, indexHandle.getConnectorHandle(), lookupSchema, outputSchema);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:IndexManager.java

示例12: ExpressionOptimizer

import com.facebook.presto.Session; //导入方法依赖的package包/类
public ExpressionOptimizer(FunctionRegistry registry, TypeManager typeManager, Session session)
{
    this.registry = registry;
    this.typeManager = typeManager;
    this.session = session.toConnectorSession();
}
 
开发者ID:y-lan,项目名称:presto,代码行数:7,代码来源:ExpressionOptimizer.java


注:本文中的com.facebook.presto.Session.toConnectorSession方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。