Search in sources :

Example 1 with SessionConfigurationContext

use of io.prestosql.spi.session.SessionConfigurationContext in project hetu-core by openlookeng.

the class SessionPropertyDefaults method newSessionWithDefaultProperties.

public Session newSessionWithDefaultProperties(Session session, Optional<String> queryType, ResourceGroupId resourceGroupId) {
    SessionPropertyConfigurationManager configurationManager = delegate.get();
    if (configurationManager == null) {
        return session;
    }
    SessionConfigurationContext context = new SessionConfigurationContext(session.getIdentity().getUser(), session.getSource(), session.getClientTags(), queryType, resourceGroupId);
    Map<String, String> systemPropertyOverrides = configurationManager.getSystemSessionProperties(context);
    Map<String, Map<String, String>> catalogPropertyOverrides = configurationManager.getCatalogSessionProperties(context);
    return session.withDefaultProperties(systemPropertyOverrides, catalogPropertyOverrides);
}
Also used : ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) Map(java.util.Map) SessionPropertyConfigurationManager(io.prestosql.spi.session.SessionPropertyConfigurationManager) SessionConfigurationContext(io.prestosql.spi.session.SessionConfigurationContext)

Aggregations

SessionConfigurationContext (io.prestosql.spi.session.SessionConfigurationContext)1 SessionPropertyConfigurationManager (io.prestosql.spi.session.SessionPropertyConfigurationManager)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1