本文整理汇总了Java中com.facebook.presto.spi.connector.ConnectorMetadata类的典型用法代码示例。如果您正苦于以下问题:Java ConnectorMetadata类的具体用法?Java ConnectorMetadata怎么用?Java ConnectorMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConnectorMetadata类属于com.facebook.presto.spi.connector包,在下文中一共展示了ConnectorMetadata类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTableHandle
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public Optional<TableHandle> getTableHandle(Session session, QualifiedObjectName table)
{
requireNonNull(table, "table is null");
ConnectorEntry entry = getConnectorFor(session, table);
if (entry != null) {
ConnectorMetadata metadata = entry.getMetadata(session);
ConnectorTableHandle tableHandle = metadata.getTableHandle(session.toConnectorSession(entry.getCatalog()), table.asSchemaTableName());
if (tableHandle != null) {
return Optional.of(new TableHandle(entry.getConnectorId(), tableHandle));
}
}
return Optional.empty();
}
开发者ID:y-lan,项目名称:presto,代码行数:18,代码来源:MetadataManager.java
示例2: getLayouts
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的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
示例3: listTables
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的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
示例4: renameTable
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public void renameTable(Session session, TableHandle tableHandle, QualifiedObjectName newTableName)
{
String catalogName = newTableName.getCatalogName();
ConnectorEntry target = connectorsByCatalog.get(catalogName);
if (target == null) {
throw new PrestoException(NOT_FOUND, format("Target catalog '%s' does not exist", catalogName));
}
if (!tableHandle.getConnectorId().equals(target.getConnectorId())) {
throw new PrestoException(SYNTAX_ERROR, "Cannot rename tables across catalogs");
}
ConnectorEntry entry = lookupConnectorFor(tableHandle);
ConnectorMetadata metadata = entry.getMetadataForWrite(session);
metadata.renameTable(session.toConnectorSession(entry.getCatalog()), tableHandle.getConnectorHandle(), newTableName.asSchemaTableName());
}
开发者ID:y-lan,项目名称:presto,代码行数:17,代码来源:MetadataManager.java
示例5: listViews
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的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
示例6: getViews
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的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
示例7: getView
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public Optional<ViewDefinition> getView(Session session, QualifiedObjectName viewName)
{
ConnectorEntry entry = getConnectorFor(session, viewName);
if (entry != null) {
ConnectorMetadata metadata = entry.getMetadata(session);
Map<SchemaTableName, ConnectorViewDefinition> views = metadata.getViews(
session.toConnectorSession(entry.getCatalog()),
viewName.asSchemaTableName().toSchemaTablePrefix());
ConnectorViewDefinition view = views.get(viewName.asSchemaTableName());
if (view != null) {
return Optional.of(deserializeView(view.getViewData()));
}
}
return Optional.empty();
}
开发者ID:y-lan,项目名称:presto,代码行数:17,代码来源:MetadataManager.java
示例8: registerBogusConnector
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
private static void registerBogusConnector(TransactionManager transactionManager, String connectorId)
{
transactionManager.addConnector(connectorId, new Connector()
{
@Override
public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly)
{
// Just return something
return new ConnectorTransactionHandle() {};
}
@Override
public ConnectorMetadata getMetadata(ConnectorTransactionHandle transactionHandle)
{
throw new UnsupportedOperationException();
}
@Override
public ConnectorSplitManager getSplitManager()
{
throw new UnsupportedOperationException();
}
});
}
开发者ID:y-lan,项目名称:presto,代码行数:25,代码来源:TestAccessControlManager.java
示例9: getMetadata
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
/**
* Guaranteed to be called at most once per transaction. The returned metadata will only be accessed
* in a single threaded context.
*
* @param transactionHandle transaction handle
*/
@Override
public ConnectorMetadata getMetadata(ConnectorTransactionHandle transactionHandle)
{
HDFSMetadata metadata = transactions.get(transactionHandle);
checkArgument(metadata != null, "no such transaction: %s", transactionHandle);
return hdfsMetadataFactory.create();
}
开发者ID:dbiir,项目名称:paraflow,代码行数:14,代码来源:HDFSConnector.java
示例10: create
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public Connector create(String connectorId, Map<String, String> properties)
{
return new Connector()
{
@Override
public ConnectorTransactionHandle beginTransaction(IsolationLevel isolationLevel, boolean readOnly)
{
checkConnectorSupports(READ_COMMITTED, isolationLevel);
return JmxTransactionHandle.INSTANCE;
}
@Override
public ConnectorMetadata getMetadata(ConnectorTransactionHandle transactionHandle)
{
return new JmxMetadata(connectorId, mbeanServer);
}
@Override
public ConnectorSplitManager getSplitManager()
{
return new JmxSplitManager(connectorId, nodeManager);
}
@Override
public ConnectorRecordSetProvider getRecordSetProvider()
{
return new JmxRecordSetProvider(mbeanServer, nodeManager.getCurrentNode().getNodeIdentifier());
}
};
}
开发者ID:y-lan,项目名称:presto,代码行数:32,代码来源:JmxConnectorFactory.java
示例11: listSchemaNames
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public List<String> listSchemaNames(Session session, String catalogName)
{
checkCatalogName(catalogName);
ImmutableSet.Builder<String> schemaNames = ImmutableSet.builder();
for (ConnectorEntry entry : allConnectorsFor(catalogName)) {
ConnectorMetadata metadata = entry.getMetadata(session);
schemaNames.addAll(metadata.listSchemaNames(session.toConnectorSession(entry.getCatalog())));
}
return ImmutableList.copyOf(schemaNames.build());
}
开发者ID:y-lan,项目名称:presto,代码行数:12,代码来源:MetadataManager.java
示例12: getLayout
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public TableLayout getLayout(Session session, TableLayoutHandle handle)
{
String connectorId = handle.getConnectorId();
ConnectorEntry entry = getConnectorMetadata(connectorId);
ConnectorMetadata metadata = entry.getMetadata(session);
ConnectorTransactionHandle transaction = entry.getTransactionHandle(session);
return fromConnectorLayout(connectorId, transaction, metadata.getTableLayout(session.toConnectorSession(entry.getCatalog()), handle.getConnectorHandle()));
}
开发者ID:y-lan,项目名称:presto,代码行数:10,代码来源:MetadataManager.java
示例13: getTableMetadata
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public TableMetadata getTableMetadata(Session session, TableHandle tableHandle)
{
ConnectorEntry entry = lookupConnectorFor(tableHandle);
ConnectorMetadata metadata = entry.getMetadata(session);
ConnectorTableMetadata tableMetadata = metadata.getTableMetadata(session.toConnectorSession(entry.getCatalog()), tableHandle.getConnectorHandle());
return new TableMetadata(tableHandle.getConnectorId(), tableMetadata);
}
开发者ID:y-lan,项目名称:presto,代码行数:10,代码来源:MetadataManager.java
示例14: getColumnHandles
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public Map<String, ColumnHandle> getColumnHandles(Session session, TableHandle tableHandle)
{
ConnectorEntry entry = lookupConnectorFor(tableHandle);
ConnectorMetadata metadata = entry.getMetadata(session);
return metadata.getColumnHandles(session.toConnectorSession(entry.getCatalog()), tableHandle.getConnectorHandle());
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:MetadataManager.java
示例15: getColumnMetadata
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public ColumnMetadata getColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle)
{
requireNonNull(tableHandle, "tableHandle is null");
requireNonNull(columnHandle, "columnHandle is null");
ConnectorEntry entry = lookupConnectorFor(tableHandle);
ConnectorMetadata metadata = entry.getMetadata(session);
return metadata.getColumnMetadata(session.toConnectorSession(entry.getCatalog()), tableHandle.getConnectorHandle(), columnHandle);
}
开发者ID:y-lan,项目名称:presto,代码行数:11,代码来源:MetadataManager.java
示例16: getSampleWeightColumnHandle
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public Optional<ColumnHandle> getSampleWeightColumnHandle(Session session, TableHandle tableHandle)
{
requireNonNull(tableHandle, "tableHandle is null");
ConnectorEntry entry = lookupConnectorFor(tableHandle);
ConnectorMetadata metadata = entry.getMetadata(session);
ColumnHandle handle = metadata.getSampleWeightColumnHandle(session.toConnectorSession(entry.getCatalog()), tableHandle.getConnectorHandle());
return Optional.ofNullable(handle);
}
开发者ID:y-lan,项目名称:presto,代码行数:11,代码来源:MetadataManager.java
示例17: canCreateSampledTables
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public boolean canCreateSampledTables(Session session, String catalogName)
{
ConnectorEntry entry = connectorsByCatalog.get(catalogName);
checkArgument(entry != null, "Catalog %s does not exist", catalogName);
ConnectorMetadata metadata = entry.getMetadata(session);
return metadata.canCreateSampledTables(session.toConnectorSession(entry.getCatalog()));
}
开发者ID:y-lan,项目名称:presto,代码行数:9,代码来源:MetadataManager.java
示例18: createTable
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public void createTable(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);
metadata.createTable(session.toConnectorSession(entry.getCatalog()), tableMetadata.getMetadata());
}
开发者ID:y-lan,项目名称:presto,代码行数:9,代码来源:MetadataManager.java
示例19: renameColumn
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public void renameColumn(Session session, TableHandle tableHandle, ColumnHandle source, String target)
{
ConnectorEntry entry = lookupConnectorFor(tableHandle);
ConnectorMetadata metadata = entry.getMetadataForWrite(session);
metadata.renameColumn(session.toConnectorSession(entry.getCatalog()), tableHandle.getConnectorHandle(), source, target.toLowerCase(ENGLISH));
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:MetadataManager.java
示例20: addColumn
import com.facebook.presto.spi.connector.ConnectorMetadata; //导入依赖的package包/类
@Override
public void addColumn(Session session, TableHandle tableHandle, ColumnMetadata column)
{
ConnectorEntry entry = lookupConnectorFor(tableHandle);
ConnectorMetadata metadata = entry.getMetadataForWrite(session);
metadata.addColumn(session.toConnectorSession(entry.getCatalog()), tableHandle.getConnectorHandle(), column);
}
开发者ID:y-lan,项目名称:presto,代码行数:8,代码来源:MetadataManager.java
注:本文中的com.facebook.presto.spi.connector.ConnectorMetadata类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论