| Constructor and Description |
|---|
MetadataManager(FeaturesConfig featuresConfig,
TypeManager typeManager,
BlockEncodingSerde blockEncodingSerde,
SessionPropertyManager sessionPropertyManager,
SchemaPropertyManager schemaPropertyManager,
TablePropertyManager tablePropertyManager,
ColumnPropertyManager columnPropertyManager,
AnalyzePropertyManager analyzePropertyManager,
TransactionManager transactionManager) |
MetadataManager(FeaturesConfig featuresConfig,
TypeManager typeManager,
io.airlift.json.JsonCodec<ViewDefinition> viewCodec,
BlockEncodingSerde blockEncodingSerde,
SessionPropertyManager sessionPropertyManager,
SchemaPropertyManager schemaPropertyManager,
TablePropertyManager tablePropertyManager,
ColumnPropertyManager columnPropertyManager,
AnalyzePropertyManager analyzePropertyManager,
TransactionManager transactionManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(Session session,
TableHandle tableHandle,
ColumnMetadata column)
Add the specified column to the table.
|
void |
addFunctions(List<? extends SqlFunction> functionInfos) |
Optional<ConstraintApplicationResult<TableHandle>> |
applyFilter(Session session,
TableHandle table,
Constraint constraint) |
Optional<LimitApplicationResult<TableHandle>> |
applyLimit(Session session,
TableHandle table,
long limit) |
Optional<TableHandle> |
applySample(Session session,
TableHandle table,
SampleType sampleType,
double sampleRatio) |
OutputTableHandle |
beginCreateTable(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata,
Optional<NewTableLayout> layout)
Begin the atomic creation of a table with data.
|
TableHandle |
beginDelete(Session session,
TableHandle tableHandle)
Begin delete query
|
InsertTableHandle |
beginInsert(Session session,
TableHandle tableHandle)
Begin insert query
|
void |
beginQuery(Session session,
Set<CatalogName> connectors)
Start a SELECT/UPDATE/INSERT/DELETE query
|
AnalyzeTableHandle |
beginStatisticsCollection(Session session,
TableHandle tableHandle)
Begin statistics collection
|
boolean |
catalogExists(Session session,
String catalogName) |
void |
cleanupQuery(Session session)
Cleanup after a query.
|
void |
createRole(Session session,
String role,
Optional<PrestoPrincipal> grantor,
String catalog)
Creates the specified role in the specified catalog.
|
void |
createSchema(Session session,
CatalogSchemaName schema,
Map<String,Object> properties)
Creates a schema.
|
void |
createTable(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata,
boolean ignoreExisting)
Creates a table using the specified table metadata.
|
static MetadataManager |
createTestMetadataManager() |
static MetadataManager |
createTestMetadataManager(CatalogManager catalogManager) |
static MetadataManager |
createTestMetadataManager(CatalogManager catalogManager,
FeaturesConfig featuresConfig) |
static MetadataManager |
createTestMetadataManager(FeaturesConfig featuresConfig) |
static MetadataManager |
createTestMetadataManager(TransactionManager transactionManager,
FeaturesConfig featuresConfig) |
void |
createView(Session session,
QualifiedObjectName viewName,
String viewData,
boolean replace)
Creates the specified view with the specified view definition.
|
void |
dropColumn(Session session,
TableHandle tableHandle,
ColumnHandle column)
Drop the specified column.
|
void |
dropRole(Session session,
String role,
String catalog)
Drops the specified role in the specified catalog.
|
void |
dropSchema(Session session,
CatalogSchemaName schema)
Drops the specified schema.
|
void |
dropTable(Session session,
TableHandle tableHandle)
Drops the specified table
|
void |
dropView(Session session,
QualifiedObjectName viewName)
Drops the specified view.
|
Optional<ConnectorOutputMetadata> |
finishCreateTable(Session session,
OutputTableHandle tableHandle,
Collection<io.airlift.slice.Slice> fragments,
Collection<ComputedStatistics> computedStatistics)
Finish a table creation with data after the data is written.
|
void |
finishDelete(Session session,
TableHandle tableHandle,
Collection<io.airlift.slice.Slice> fragments)
Finish delete query
|
Optional<ConnectorOutputMetadata> |
finishInsert(Session session,
InsertTableHandle tableHandle,
Collection<io.airlift.slice.Slice> fragments,
Collection<ComputedStatistics> computedStatistics)
Finish insert query
|
void |
finishStatisticsCollection(Session session,
AnalyzeTableHandle tableHandle,
Collection<ComputedStatistics> computedStatistics)
Finish statistics collection
|
AnalyzePropertyManager |
getAnalyzePropertyManager() |
BlockEncodingSerde |
getBlockEncodingSerde() |
Optional<CatalogName> |
getCatalogHandle(Session session,
String catalogName)
Returns a connector id for the specified catalog name.
|
Map<String,CatalogName> |
getCatalogNames(Session session)
Gets all the loaded catalogs
|
Map<String,Collection<ConnectorMetadata>> |
getCatalogsByQueryId() |
Map<String,ColumnHandle> |
getColumnHandles(Session session,
TableHandle tableHandle)
Gets all of the columns on the specified table, or an empty map if the columns can not be enumerated.
|
ColumnMetadata |
getColumnMetadata(Session session,
TableHandle tableHandle,
ColumnHandle columnHandle)
Gets the metadata for the specified table column.
|
ColumnPropertyManager |
getColumnPropertyManager() |
Optional<PartitioningHandle> |
getCommonPartitioning(Session session,
PartitioningHandle left,
PartitioningHandle right)
Return a partitioning handle which the connector can transparently convert both
left and right into. |
Set<ConnectorCapabilities> |
getConnectorCapabilities(Session session,
CatalogName catalogName) |
FunctionRegistry |
getFunctionRegistry() |
Optional<Object> |
getInfo(Session session,
TableHandle handle) |
Optional<NewTableLayout> |
getInsertLayout(Session session,
TableHandle table) |
Optional<TableLayoutResult> |
getLayout(Session session,
TableHandle table,
Constraint constraint,
Optional<Set<ColumnHandle>> desiredColumns) |
Optional<NewTableLayout> |
getNewTableLayout(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata) |
ProcedureRegistry |
getProcedureRegistry() |
SchemaPropertyManager |
getSchemaPropertyManager() |
SessionPropertyManager |
getSessionPropertyManager() |
TableStatisticsMetadata |
getStatisticsCollectionMetadata(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata)
Describe statistics that must be collected during a statistics collection
|
TableStatisticsMetadata |
getStatisticsCollectionMetadataForWrite(Session session,
String catalogName,
ConnectorTableMetadata tableMetadata)
Describes statistics that must be collected during a write.
|
Optional<SystemTable> |
getSystemTable(Session session,
QualifiedObjectName tableName) |
Optional<TableHandle> |
getTableHandle(Session session,
QualifiedObjectName table)
Returns a table handle for the specified table name.
|
Optional<TableHandle> |
getTableHandleForStatisticsCollection(Session session,
QualifiedObjectName table,
Map<String,Object> analyzeProperties) |
TableMetadata |
getTableMetadata(Session session,
TableHandle tableHandle)
Return the metadata for the specified table handle.
|
TableProperties |
getTableProperties(Session session,
TableHandle handle) |
TablePropertyManager |
getTablePropertyManager() |
TableStatistics |
getTableStatistics(Session session,
TableHandle tableHandle,
Constraint constraint)
Return statistics for specified table for given filtering contraint.
|
Type |
getType(TypeSignature signature) |
TypeManager |
getTypeManager() |
ColumnHandle |
getUpdateRowIdColumnHandle(Session session,
TableHandle tableHandle)
Get the row ID column handle used with UpdatablePageSource.
|
Optional<ViewDefinition> |
getView(Session session,
QualifiedObjectName viewName)
Returns the view definition for the specified view name.
|
Map<QualifiedObjectName,ViewDefinition> |
getViews(Session session,
QualifiedTablePrefix prefix)
Get the view definitions that match the specified table prefix (never null).
|
void |
grantRoles(Session session,
Set<String> roles,
Set<PrestoPrincipal> grantees,
boolean withAdminOption,
Optional<PrestoPrincipal> grantor,
String catalog)
Grants the specified roles to the specified grantees in the specified catalog
|
void |
grantTablePrivileges(Session session,
QualifiedObjectName tableName,
Set<Privilege> privileges,
PrestoPrincipal grantee,
boolean grantOption)
Grants the specified privilege to the specified user on the specified table
|
boolean |
isAggregationFunction(QualifiedName name) |
Set<RoleGrant> |
listApplicableRoles(Session session,
PrestoPrincipal principal,
String catalog)
List applicable roles, including the transitive grants, for the specified principal
|
Set<String> |
listEnabledRoles(Session session,
String catalog)
List applicable roles, including the transitive grants, in given session
|
List<SqlFunction> |
listFunctions() |
Set<RoleGrant> |
listRoleGrants(Session session,
String catalog,
PrestoPrincipal principal)
List roles grants in the specified catalog for a given principal, not recursively.
|
Set<String> |
listRoles(Session session,
String catalog)
List available roles in specified catalog.
|
List<String> |
listSchemaNames(Session session,
String catalogName) |
Map<QualifiedObjectName,List<ColumnMetadata>> |
listTableColumns(Session session,
QualifiedTablePrefix prefix)
Gets the metadata for all columns that match the specified table prefix.
|
List<GrantInfo> |
listTablePrivileges(Session session,
QualifiedTablePrefix prefix)
Gets the privileges for the specified table available to the given grantee considering the selected session role
|
List<QualifiedObjectName> |
listTables(Session session,
QualifiedTablePrefix prefix)
Get the names that match the specified table prefix (never null).
|
List<QualifiedObjectName> |
listViews(Session session,
QualifiedTablePrefix prefix)
Get the names that match the specified table prefix (never null).
|
TableHandle |
makeCompatiblePartitioning(Session session,
TableHandle tableHandle,
PartitioningHandle partitioningHandle)
Return a table handle whose partitioning is converted to the provided partitioning handle,
but otherwise identical to the provided table handle.
|
OptionalLong |
metadataDelete(Session session,
TableHandle tableHandle)
Delete the provide table layout
|
void |
renameColumn(Session session,
TableHandle tableHandle,
ColumnHandle source,
String target)
Rename the specified column.
|
void |
renameSchema(Session session,
CatalogSchemaName source,
String target)
Renames the specified schema.
|
void |
renameTable(Session session,
TableHandle tableHandle,
QualifiedObjectName newTableName)
Rename the specified table.
|
Optional<ResolvedIndex> |
resolveIndex(Session session,
TableHandle tableHandle,
Set<ColumnHandle> indexableColumns,
Set<ColumnHandle> outputColumns,
TupleDomain<ColumnHandle> tupleDomain)
Try to locate a table index that can lookup results by indexableColumns and provide the requested outputColumns.
|
void |
revokeRoles(Session session,
Set<String> roles,
Set<PrestoPrincipal> grantees,
boolean adminOptionFor,
Optional<PrestoPrincipal> grantor,
String catalog)
Revokes the specified roles from the specified grantees in the specified catalog
|
void |
revokeTablePrivileges(Session session,
QualifiedObjectName tableName,
Set<Privilege> privileges,
PrestoPrincipal grantee,
boolean grantOption)
Revokes the specified privilege on the specified table from the specified user
|
boolean |
schemaExists(Session session,
CatalogSchemaName schema) |
void |
setTableComment(Session session,
TableHandle tableHandle,
Optional<String> comment)
Comments to the specified table.
|
boolean |
supportsMetadataDelete(Session session,
TableHandle tableHandle) |
boolean |
usesLegacyTableLayouts(Session session,
TableHandle table) |
void |
verifyComparableOrderableContract() |
public MetadataManager(FeaturesConfig featuresConfig, TypeManager typeManager, BlockEncodingSerde blockEncodingSerde, SessionPropertyManager sessionPropertyManager, SchemaPropertyManager schemaPropertyManager, TablePropertyManager tablePropertyManager, ColumnPropertyManager columnPropertyManager, AnalyzePropertyManager analyzePropertyManager, TransactionManager transactionManager)
@Inject public MetadataManager(FeaturesConfig featuresConfig, TypeManager typeManager, io.airlift.json.JsonCodec<ViewDefinition> viewCodec, BlockEncodingSerde blockEncodingSerde, SessionPropertyManager sessionPropertyManager, SchemaPropertyManager schemaPropertyManager, TablePropertyManager tablePropertyManager, ColumnPropertyManager columnPropertyManager, AnalyzePropertyManager analyzePropertyManager, TransactionManager transactionManager)
public static MetadataManager createTestMetadataManager()
public static MetadataManager createTestMetadataManager(FeaturesConfig featuresConfig)
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager)
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager, FeaturesConfig featuresConfig)
public static MetadataManager createTestMetadataManager(TransactionManager transactionManager, FeaturesConfig featuresConfig)
public final void verifyComparableOrderableContract()
verifyComparableOrderableContract in interface Metadatapublic Type getType(TypeSignature signature)
public boolean isAggregationFunction(QualifiedName name)
isAggregationFunction in interface Metadatapublic List<SqlFunction> listFunctions()
listFunctions in interface Metadatapublic void addFunctions(List<? extends SqlFunction> functionInfos)
addFunctions in interface Metadatapublic boolean schemaExists(Session session, CatalogSchemaName schema)
schemaExists in interface Metadatapublic boolean catalogExists(Session session, String catalogName)
catalogExists in interface Metadatapublic List<String> listSchemaNames(Session session, String catalogName)
listSchemaNames in interface Metadatapublic Optional<TableHandle> getTableHandle(Session session, QualifiedObjectName table)
MetadatagetTableHandle in interface Metadatapublic Optional<TableHandle> getTableHandleForStatisticsCollection(Session session, QualifiedObjectName table, Map<String,Object> analyzeProperties)
getTableHandleForStatisticsCollection in interface Metadatapublic Optional<SystemTable> getSystemTable(Session session, QualifiedObjectName tableName)
getSystemTable in interface Metadatapublic Optional<TableLayoutResult> getLayout(Session session, TableHandle table, Constraint constraint, Optional<Set<ColumnHandle>> desiredColumns)
public TableProperties getTableProperties(Session session, TableHandle handle)
getTableProperties in interface Metadatapublic TableHandle makeCompatiblePartitioning(Session session, TableHandle tableHandle, PartitioningHandle partitioningHandle)
MetadataMetadata.getCommonPartitioning(io.prestosql.Session, io.prestosql.sql.planner.PartitioningHandle, io.prestosql.sql.planner.PartitioningHandle).makeCompatiblePartitioning in interface Metadatapublic Optional<PartitioningHandle> getCommonPartitioning(Session session, PartitioningHandle left, PartitioningHandle right)
Metadataleft and right into.getCommonPartitioning in interface Metadatapublic Optional<Object> getInfo(Session session, TableHandle handle)
public TableMetadata getTableMetadata(Session session, TableHandle tableHandle)
MetadatagetTableMetadata in interface Metadatapublic TableStatistics getTableStatistics(Session session, TableHandle tableHandle, Constraint constraint)
MetadatagetTableStatistics in interface Metadatapublic Map<String,ColumnHandle> getColumnHandles(Session session, TableHandle tableHandle)
MetadatagetColumnHandles in interface Metadatapublic ColumnMetadata getColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle)
MetadatagetColumnMetadata in interface Metadatapublic List<QualifiedObjectName> listTables(Session session, QualifiedTablePrefix prefix)
MetadatalistTables in interface Metadatapublic Map<QualifiedObjectName,List<ColumnMetadata>> listTableColumns(Session session, QualifiedTablePrefix prefix)
MetadatalistTableColumns in interface Metadatapublic void createSchema(Session session, CatalogSchemaName schema, Map<String,Object> properties)
MetadatacreateSchema in interface Metadatapublic void dropSchema(Session session, CatalogSchemaName schema)
MetadatadropSchema in interface Metadatapublic void renameSchema(Session session, CatalogSchemaName source, String target)
MetadatarenameSchema in interface Metadatapublic void createTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, boolean ignoreExisting)
MetadatacreateTable in interface Metadatapublic void renameTable(Session session, TableHandle tableHandle, QualifiedObjectName newTableName)
MetadatarenameTable in interface Metadatapublic void setTableComment(Session session, TableHandle tableHandle, Optional<String> comment)
MetadatasetTableComment in interface Metadatapublic void renameColumn(Session session, TableHandle tableHandle, ColumnHandle source, String target)
MetadatarenameColumn in interface Metadatapublic void addColumn(Session session, TableHandle tableHandle, ColumnMetadata column)
Metadatapublic void dropColumn(Session session, TableHandle tableHandle, ColumnHandle column)
MetadatadropColumn in interface Metadatapublic void dropTable(Session session, TableHandle tableHandle)
Metadatapublic Optional<NewTableLayout> getInsertLayout(Session session, TableHandle table)
getInsertLayout in interface Metadatapublic TableStatisticsMetadata getStatisticsCollectionMetadataForWrite(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
MetadatagetStatisticsCollectionMetadataForWrite in interface Metadatapublic TableStatisticsMetadata getStatisticsCollectionMetadata(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
MetadatagetStatisticsCollectionMetadata in interface Metadatapublic AnalyzeTableHandle beginStatisticsCollection(Session session, TableHandle tableHandle)
MetadatabeginStatisticsCollection in interface Metadatapublic void finishStatisticsCollection(Session session, AnalyzeTableHandle tableHandle, Collection<ComputedStatistics> computedStatistics)
MetadatafinishStatisticsCollection in interface Metadatapublic Optional<NewTableLayout> getNewTableLayout(Session session, String catalogName, ConnectorTableMetadata tableMetadata)
getNewTableLayout in interface Metadatapublic void beginQuery(Session session, Set<CatalogName> connectors)
MetadatabeginQuery in interface Metadatapublic void cleanupQuery(Session session)
MetadatacleanupQuery in interface Metadatapublic OutputTableHandle beginCreateTable(Session session, String catalogName, ConnectorTableMetadata tableMetadata, Optional<NewTableLayout> layout)
MetadatabeginCreateTable in interface Metadatapublic Optional<ConnectorOutputMetadata> finishCreateTable(Session session, OutputTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
MetadatafinishCreateTable in interface Metadatapublic InsertTableHandle beginInsert(Session session, TableHandle tableHandle)
MetadatabeginInsert in interface Metadatapublic Optional<ConnectorOutputMetadata> finishInsert(Session session, InsertTableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments, Collection<ComputedStatistics> computedStatistics)
MetadatafinishInsert in interface Metadatapublic ColumnHandle getUpdateRowIdColumnHandle(Session session, TableHandle tableHandle)
MetadatagetUpdateRowIdColumnHandle in interface Metadatapublic boolean supportsMetadataDelete(Session session, TableHandle tableHandle)
supportsMetadataDelete in interface Metadatapublic OptionalLong metadataDelete(Session session, TableHandle tableHandle)
MetadatametadataDelete in interface Metadatapublic TableHandle beginDelete(Session session, TableHandle tableHandle)
MetadatabeginDelete in interface Metadatapublic void finishDelete(Session session, TableHandle tableHandle, Collection<io.airlift.slice.Slice> fragments)
MetadatafinishDelete in interface Metadatapublic Optional<CatalogName> getCatalogHandle(Session session, String catalogName)
MetadatagetCatalogHandle in interface Metadatapublic Map<String,CatalogName> getCatalogNames(Session session)
MetadatagetCatalogNames in interface Metadatapublic List<QualifiedObjectName> listViews(Session session, QualifiedTablePrefix prefix)
Metadatapublic Map<QualifiedObjectName,ViewDefinition> getViews(Session session, QualifiedTablePrefix prefix)
Metadatapublic Optional<ViewDefinition> getView(Session session, QualifiedObjectName viewName)
Metadatapublic void createView(Session session, QualifiedObjectName viewName, String viewData, boolean replace)
MetadatacreateView in interface Metadatapublic void dropView(Session session, QualifiedObjectName viewName)
Metadatapublic Optional<ResolvedIndex> resolveIndex(Session session, TableHandle tableHandle, Set<ColumnHandle> indexableColumns, Set<ColumnHandle> outputColumns, TupleDomain<ColumnHandle> tupleDomain)
MetadataresolveIndex in interface Metadatapublic void createRole(Session session, String role, Optional<PrestoPrincipal> grantor, String catalog)
MetadatacreateRole in interface Metadatagrantor - represents the principal specified by WITH ADMIN statementpublic void dropRole(Session session, String role, String catalog)
Metadatapublic Set<String> listRoles(Session session, String catalog)
Metadatapublic Set<RoleGrant> listRoleGrants(Session session, String catalog, PrestoPrincipal principal)
MetadatalistRoleGrants in interface Metadatapublic void grantRoles(Session session, Set<String> roles, Set<PrestoPrincipal> grantees, boolean withAdminOption, Optional<PrestoPrincipal> grantor, String catalog)
MetadatagrantRoles in interface Metadatagrantor - represents the principal specified by GRANTED BY statementpublic void revokeRoles(Session session, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, Optional<PrestoPrincipal> grantor, String catalog)
MetadatarevokeRoles in interface Metadatagrantor - represents the principal specified by GRANTED BY statementpublic Set<RoleGrant> listApplicableRoles(Session session, PrestoPrincipal principal, String catalog)
MetadatalistApplicableRoles in interface Metadatapublic Set<String> listEnabledRoles(Session session, String catalog)
MetadatalistEnabledRoles in interface Metadatapublic void grantTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, PrestoPrincipal grantee, boolean grantOption)
MetadatagrantTablePrivileges in interface Metadatapublic void revokeTablePrivileges(Session session, QualifiedObjectName tableName, Set<Privilege> privileges, PrestoPrincipal grantee, boolean grantOption)
MetadatarevokeTablePrivileges in interface Metadatapublic List<GrantInfo> listTablePrivileges(Session session, QualifiedTablePrefix prefix)
MetadatalistTablePrivileges in interface Metadatapublic FunctionRegistry getFunctionRegistry()
getFunctionRegistry in interface Metadatapublic ProcedureRegistry getProcedureRegistry()
getProcedureRegistry in interface Metadatapublic TypeManager getTypeManager()
getTypeManager in interface Metadatapublic BlockEncodingSerde getBlockEncodingSerde()
getBlockEncodingSerde in interface Metadatapublic SessionPropertyManager getSessionPropertyManager()
getSessionPropertyManager in interface Metadatapublic SchemaPropertyManager getSchemaPropertyManager()
getSchemaPropertyManager in interface Metadatapublic TablePropertyManager getTablePropertyManager()
getTablePropertyManager in interface Metadatapublic ColumnPropertyManager getColumnPropertyManager()
getColumnPropertyManager in interface Metadatapublic AnalyzePropertyManager getAnalyzePropertyManager()
getAnalyzePropertyManager in interface Metadatapublic Set<ConnectorCapabilities> getConnectorCapabilities(Session session, CatalogName catalogName)
getConnectorCapabilities in interface Metadatapublic boolean usesLegacyTableLayouts(Session session, TableHandle table)
usesLegacyTableLayouts in interface Metadatapublic Optional<LimitApplicationResult<TableHandle>> applyLimit(Session session, TableHandle table, long limit)
applyLimit in interface Metadatapublic Optional<TableHandle> applySample(Session session, TableHandle table, SampleType sampleType, double sampleRatio)
applySample in interface Metadatapublic Optional<ConstraintApplicationResult<TableHandle>> applyFilter(Session session, TableHandle table, Constraint constraint)
applyFilter in interface Metadatapublic Map<String,Collection<ConnectorMetadata>> getCatalogsByQueryId()
Copyright © 2012–2019. All rights reserved.