Search in sources :

Example 11 with AccessControl

use of io.prestosql.security.AccessControl in project hetu-core by openlookeng.

the class TestQueryStateMachine method createQueryStateMachineWithTicker.

private QueryStateMachine createQueryStateMachineWithTicker(Ticker ticker) {
    Metadata metadata = createTestMetadataManager();
    TransactionManager transactionManager = createTestTransactionManager();
    AccessControl accessControl = new AccessControlManager(transactionManager);
    QueryStateMachine stateMachine = QueryStateMachine.beginWithTicker(QUERY, Optional.empty(), TEST_SESSION, LOCATION, new ResourceGroupId("test"), new NoOpResourceGroupManager(), false, transactionManager, accessControl, executor, ticker, metadata, WarningCollector.NOOP);
    stateMachine.setInputs(INPUTS);
    stateMachine.setOutput(OUTPUT);
    stateMachine.setColumns(OUTPUT_FIELD_NAMES, OUTPUT_FIELD_TYPES);
    stateMachine.setUpdateType(UPDATE_TYPE);
    stateMachine.setMemoryPool(MEMORY_POOL);
    for (Entry<String, String> entry : SET_SESSION_PROPERTIES.entrySet()) {
        stateMachine.addSetSessionProperties(entry.getKey(), entry.getValue());
    }
    RESET_SESSION_PROPERTIES.forEach(stateMachine::addResetSessionProperties);
    return stateMachine;
}
Also used : AccessControlManager(io.prestosql.security.AccessControlManager) ResourceGroupId(io.prestosql.spi.resourcegroups.ResourceGroupId) TransactionManager(io.prestosql.transaction.TransactionManager) InMemoryTransactionManager.createTestTransactionManager(io.prestosql.transaction.InMemoryTransactionManager.createTestTransactionManager) Metadata(io.prestosql.metadata.Metadata) AccessControl(io.prestosql.security.AccessControl) NoOpResourceGroupManager(io.prestosql.execution.resourcegroups.NoOpResourceGroupManager)

Aggregations

AccessControl (io.prestosql.security.AccessControl)11 Metadata (io.prestosql.metadata.Metadata)10 Session (io.prestosql.Session)9 TransactionManager (io.prestosql.transaction.TransactionManager)9 HeuristicIndexerManager (io.prestosql.heuristicindex.HeuristicIndexerManager)8 List (java.util.List)8 Optional (java.util.Optional)8 Expression (io.prestosql.sql.tree.Expression)7 Futures.immediateFuture (com.google.common.util.concurrent.Futures.immediateFuture)6 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)6 QualifiedObjectName (io.prestosql.spi.connector.QualifiedObjectName)5 ImmutableList (com.google.common.collect.ImmutableList)4 CubeManager (io.prestosql.cube.CubeManager)4 WarningCollector (io.prestosql.execution.warnings.WarningCollector)4 MetadataUtil.createQualifiedObjectName (io.prestosql.metadata.MetadataUtil.createQualifiedObjectName)4 PrestoException (io.prestosql.spi.PrestoException)4 ConnectorTableMetadata (io.prestosql.spi.connector.ConnectorTableMetadata)4 CatalogName (io.prestosql.spi.connector.CatalogName)3 ColumnMetadata (io.prestosql.spi.connector.ColumnMetadata)3 MISSING_TABLE (io.prestosql.sql.analyzer.SemanticErrorCode.MISSING_TABLE)3