Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions presto-session-property-managers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,41 +75,18 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.facebook.presto</groupId>
<artifactId>presto-client</artifactId>
</dependency>

<dependency>
<groupId>com.facebook.drift</groupId>
<artifactId>drift-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>units</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>slice</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openjdk.jol</groupId>
<artifactId>jol-core</artifactId>
<scope>provided</scope>
</dependency>

<!-- for testing -->
<dependency>
<groupId>com.facebook.presto</groupId>
Expand All @@ -128,9 +105,5 @@
<artifactId>testing</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.facebook.presto</groupId>
<artifactId>presto-main</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import com.facebook.airlift.json.JsonCodec;
import com.facebook.airlift.json.JsonCodecFactory;
import com.facebook.airlift.json.JsonObjectMapperProvider;
import com.facebook.presto.client.NodeVersion;
import com.facebook.presto.common.PrestoVersion;
import com.facebook.presto.spi.session.SessionConfigurationContext;
import com.facebook.presto.spi.session.SessionPropertyConfigurationManager;
import com.fasterxml.jackson.databind.JsonMappingException;
Expand Down Expand Up @@ -48,13 +46,11 @@ public class FileSessionPropertyManager
.listJsonCodec(SessionMatchSpec.class);

private final List<SessionMatchSpec> sessionMatchSpecs;
private final PrestoVersion prestoVersion;

@Inject
public FileSessionPropertyManager(FileSessionPropertyManagerConfig config, NodeVersion nodeVersion)
public FileSessionPropertyManager(FileSessionPropertyManagerConfig config)
{
requireNonNull(config, "config is null");
this.prestoVersion = new PrestoVersion(nodeVersion.getVersion());

Path configurationFile = config.getConfigFile().toPath();
try {
Expand Down Expand Up @@ -91,7 +87,7 @@ public SystemSessionPropertyConfiguration getSystemSessionProperties(SessionConf
Map<String, String> defaultProperties = new HashMap<>();
Set<String> overridePropertyNames = new HashSet<>();
for (SessionMatchSpec sessionMatchSpec : sessionMatchSpecs) {
Map<String, String> newProperties = sessionMatchSpec.match(context, this.prestoVersion);
Map<String, String> newProperties = sessionMatchSpec.match(context);
defaultProperties.putAll(newProperties);
if (sessionMatchSpec.getOverrideSessionProperties().orElse(false)) {
overridePropertyNames.addAll(newProperties.keySet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,19 @@
*/
package com.facebook.presto.session;

import com.facebook.airlift.configuration.AbstractConfigurationAwareModule;
import com.facebook.presto.client.NodeVersion;
import com.facebook.presto.server.ServerConfig;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;

import static com.facebook.airlift.configuration.ConfigBinder.configBinder;

public class FileSessionPropertyManagerModule
extends AbstractConfigurationAwareModule
implements Module
{
@Override
public void setup(Binder binder)
public void configure(Binder binder)
{
configBinder(binder).bindConfig(FileSessionPropertyManagerConfig.class);
binder.bind(FileSessionPropertyManager.class).in(Scopes.SINGLETON);

ServerConfig serverConfig = buildConfigObject(ServerConfig.class);
NodeVersion nodeVersion = new NodeVersion(serverConfig.getPrestoVersion());
binder.bind(NodeVersion.class).toInstance(nodeVersion);
}
}
Loading