Search in sources :

Example 21 with Bootstrap

use of io.airlift.bootstrap.Bootstrap in project presto by prestodb.

the class TestHttpBackupStore method setup.

@BeforeMethod
public void setup() throws Exception {
    temporary = createTempDir();
    Map<String, String> properties = ImmutableMap.<String, String>builder().put("backup.http.uri", "http://localhost:8080").build();
    Bootstrap app = new Bootstrap(new TestingNodeModule(), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(true), binder -> jaxrsBinder(binder).bind(TestingHttpBackupResource.class), override(new HttpBackupModule()).with(new TestingModule()));
    Injector injector = app.strictConfig().setRequiredConfigurationProperties(properties).doNotInitializeLogging().initialize();
    lifeCycleManager = injector.getInstance(LifeCycleManager.class);
    store = injector.getInstance(BackupStore.class);
}
Also used : TestingHttpServerModule(io.airlift.http.server.testing.TestingHttpServerModule) TestingNodeModule(io.airlift.node.testing.TestingNodeModule) JaxrsModule(io.airlift.jaxrs.JaxrsModule) JsonModule(io.airlift.json.JsonModule) LifeCycleManager(io.airlift.bootstrap.LifeCycleManager) Injector(com.google.inject.Injector) Bootstrap(io.airlift.bootstrap.Bootstrap) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Injector (com.google.inject.Injector)21 Bootstrap (io.airlift.bootstrap.Bootstrap)21 JsonModule (io.airlift.json.JsonModule)17 ThreadContextClassLoader (com.facebook.presto.spi.classloader.ThreadContextClassLoader)7 NodeManager (com.facebook.presto.spi.NodeManager)4 Module (com.google.inject.Module)4 LifeCycleManager (io.airlift.bootstrap.LifeCycleManager)4 MBeanServer (javax.management.MBeanServer)4 MBeanModule (org.weakref.jmx.guice.MBeanModule)4 TypeManager (com.facebook.presto.spi.type.TypeManager)3 TypeLiteral (com.google.inject.TypeLiteral)3 JaxrsModule (io.airlift.jaxrs.JaxrsModule)3 Map (java.util.Map)3 SchemaTableName (com.facebook.presto.spi.SchemaTableName)2 ClassLoaderSafeConnectorPageSourceProvider (com.facebook.presto.spi.connector.classloader.ClassLoaderSafeConnectorPageSourceProvider)2 ClassLoaderSafeConnectorSplitManager (com.facebook.presto.spi.connector.classloader.ClassLoaderSafeConnectorSplitManager)2 ImmutableList (com.google.common.collect.ImmutableList)2 Binder (com.google.inject.Binder)2 TraceTokenModule (io.airlift.tracetoken.TraceTokenModule)2 Supplier (java.util.function.Supplier)2