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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.inject.multibindings.ProvidesIntoSet;
import io.airlift.concurrent.BoundedExecutor;
import io.airlift.configuration.AbstractConfigurationAwareModule;
import io.airlift.http.server.HttpServerConfig;
import io.airlift.slice.Slice;
import io.airlift.stats.GcMonitor;
import io.airlift.stats.JmxGcMonitor;
Expand Down Expand Up @@ -206,11 +205,6 @@ protected void setup(Binder binder)
}

binder.bind(StartupStatus.class).in(Scopes.SINGLETON);

configBinder(binder).bindConfigDefaults(HttpServerConfig.class, httpServerConfig -> {
httpServerConfig.setAdminEnabled(false);
});

binder.bind(PreparedStatementEncoder.class).in(Scopes.SINGLETON);
binder.bind(HttpRequestSessionContextFactory.class).in(Scopes.SINGLETON);
install(new InternalCommunicationModule());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ private static TestingHttpServer createTestingJwkServer()
HttpServerConfig config = new HttpServerConfig().setHttpPort(0);
HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo);

return new TestingHttpServer(httpServerInfo, nodeInfo, config, new JwkServlet(), ImmutableMap.of());
return new TestingHttpServer(httpServerInfo, nodeInfo, config, new JwkServlet());
}

private static class JwkServlet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public MetadataServer(HttpServlet servlet)
NodeInfo nodeInfo = new NodeInfo("test");
HttpServerConfig config = new HttpServerConfig().setHttpPort(0);
HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo);
httpServer = new TestingHttpServer(httpServerInfo, nodeInfo, config, servlet, ImmutableMap.of());
httpServer = new TestingHttpServer(httpServerInfo, nodeInfo, config, servlet);
httpServer.start();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private TestingHttpServer createTestingLoginAndConsentServer()
.setNodeInternalAddress(InetAddresses.toAddrString(InetAddress.getLocalHost())));
HttpServerConfig config = new HttpServerConfig().setHttpPort(0);
HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo);
return new TestingHttpServer(httpServerInfo, nodeInfo, config, new AcceptAllLoginsAndConsentsServlet(), ImmutableMap.of());
return new TestingHttpServer(httpServerInfo, nodeInfo, config, new AcceptAllLoginsAndConsentsServlet());
}

private class AcceptAllLoginsAndConsentsServlet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ private static TestingHttpServer createTestingJwkServer()
HttpServerConfig config = new HttpServerConfig().setHttpPort(0);
HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo);

return new TestingHttpServer(httpServerInfo, nodeInfo, config, new JwkServlet(), ImmutableMap.of());
return new TestingHttpServer(httpServerInfo, nodeInfo, config, new JwkServlet());
}

private static class JwkServlet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@
*/
package io.trino.plugin.base.util;

import com.google.common.collect.ImmutableMap;
import com.google.common.io.ByteSource;
import com.google.inject.Injector;
import com.google.inject.TypeLiteral;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.bootstrap.LifeCycleManager;
import io.airlift.http.server.HttpServerInfo;
import io.airlift.http.server.TheServlet;
import io.airlift.http.server.testing.TestingHttpServerModule;
import io.airlift.node.testing.TestingNodeModule;
import jakarta.servlet.Servlet;
Expand All @@ -33,7 +30,6 @@
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;

public class TestingHttpServer
implements Closeable
Expand All @@ -47,8 +43,7 @@ public TestingHttpServer()
new TestingNodeModule(),
new TestingHttpServerModule(),
binder -> {
binder.bind(new TypeLiteral<Map<String, String>>() {}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.of());
binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(new TestingHttpServlet());
binder.bind(Servlet.class).toInstance(new TestingHttpServlet());
});

Injector injector = app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
*/
package io.trino.plugin.example;

import com.google.common.collect.ImmutableMap;
import com.google.common.io.Resources;
import com.google.inject.Binder;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.TypeLiteral;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.bootstrap.LifeCycleManager;
import io.airlift.http.server.TheServlet;
import io.airlift.http.server.testing.TestingHttpServer;
import io.airlift.http.server.testing.TestingHttpServerModule;
import io.airlift.node.testing.TestingNodeModule;
Expand All @@ -33,7 +30,6 @@
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.Map;

public class ExampleHttpServer
{
Expand Down Expand Up @@ -71,8 +67,7 @@ private static class ExampleHttpServerModule
@Override
public void configure(Binder binder)
{
binder.bind(new TypeLiteral<Map<String, String>>() {}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.of());
binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(new ExampleHttpServlet());
binder.bind(Servlet.class).toInstance(new ExampleHttpServlet());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@
*/
package io.trino.plugin.hive.metastore.thrift;

import com.google.common.collect.ImmutableMap;
import com.google.inject.Injector;
import com.google.inject.TypeLiteral;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.bootstrap.LifeCycleManager;
import io.airlift.http.server.HttpServerInfo;
import io.airlift.http.server.TheServlet;
import io.airlift.http.server.testing.TestingHttpServerModule;
import io.airlift.node.testing.TestingNodeModule;
import io.trino.hive.thrift.metastore.Database;
Expand All @@ -37,7 +34,6 @@
import java.io.Closeable;
import java.io.IOException;
import java.net.URI;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;

Expand All @@ -59,8 +55,7 @@ public TestingThriftHttpMetastoreServer(ThriftMetastore delegate, Consumer<HttpS
new TestingNodeModule(),
new TestingHttpServerModule(),
binder -> {
binder.bind(new TypeLiteral<Map<String, String>>() {}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.of());
binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(thriftHttpServlet);
binder.bind(Servlet.class).toInstance(thriftHttpServlet);
});

Injector injector = app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
package org.apache.iceberg.rest;

import com.google.common.collect.ImmutableMap;
import io.airlift.http.server.HttpServerConfig;
import io.airlift.http.server.HttpServerInfo;
import io.airlift.http.server.testing.TestingHttpServer;
Expand Down Expand Up @@ -67,7 +66,7 @@ public TestingHttpServer testServer()
HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo);
RestCatalogServlet servlet = new RestCatalogServlet(adapter);

return new TestingHttpServer(httpServerInfo, nodeInfo, config, servlet, ImmutableMap.of());
return new TestingHttpServer(httpServerInfo, nodeInfo, config, servlet);
}

public static Builder builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
*/
package io.trino.plugin.prometheus;

import com.google.common.collect.ImmutableMap;
import com.google.common.io.Resources;
import com.google.inject.Binder;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.TypeLiteral;
import io.airlift.bootstrap.Bootstrap;
import io.airlift.bootstrap.LifeCycleManager;
import io.airlift.http.server.TheServlet;
import io.airlift.http.server.testing.TestingHttpServer;
import io.airlift.http.server.testing.TestingHttpServerModule;
import io.airlift.node.testing.TestingNodeModule;
Expand All @@ -33,7 +30,6 @@
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.Map;

import static io.trino.plugin.prometheus.PrometheusClient.METRICS_ENDPOINT;

Expand Down Expand Up @@ -73,8 +69,7 @@ private static class PrometheusHttpServerModule
@Override
public void configure(Binder binder)
{
binder.bind(new TypeLiteral<Map<String, String>>() {}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.of());
binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(new PrometheusHttpServlet());
binder.bind(Servlet.class).toInstance(new PrometheusHttpServlet());
}
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
<!-- keep dependency properties sorted -->
<dep.accumulo-hadoop.version>2.7.7-1</dep.accumulo-hadoop.version>
<dep.accumulo.version>3.0.0</dep.accumulo.version>
<dep.airlift.version>267</dep.airlift.version>
<dep.airlift.version>268</dep.airlift.version>
<dep.alluxio.version>2.9.6</dep.alluxio.version>
<dep.antlr.version>4.13.2</dep.antlr.version>
<dep.avro.version>1.12.0</dep.avro.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;
import io.airlift.http.server.HttpServerConfig;

import static io.airlift.configuration.ConfigBinder.configBinder;
import static io.airlift.http.client.HttpClientBinder.httpClientBinder;
Expand All @@ -28,10 +27,6 @@ public class ProxyModule
@Override
public void configure(Binder binder)
{
configBinder(binder).bindConfigDefaults(HttpServerConfig.class, httpServerConfig -> {
httpServerConfig.setAdminEnabled(false);
});

httpClientBinder(binder).bindHttpClient("proxy", ForProxy.class);

configBinder(binder).bindConfig(ProxyConfig.class);
Expand Down