Search in sources :

Example 1 with SessionConfigurationContext

use of com.facebook.presto.spi.session.SessionConfigurationContext in project presto by prestodb.

the class SessionPropertyDefaults method newSessionWithDefaultProperties.

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

Aggregations

SessionConfigurationContext (com.facebook.presto.spi.session.SessionConfigurationContext)1 SessionPropertyConfigurationManager (com.facebook.presto.spi.session.SessionPropertyConfigurationManager)1 SystemSessionPropertyConfiguration (com.facebook.presto.spi.session.SessionPropertyConfigurationManager.SystemSessionPropertyConfiguration)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1