Search in sources :

Example 6 with NodeConfig

use of io.airlift.node.NodeConfig in project airlift by airlift.

the class TestingNodeModule method configure.

@Override
public void configure(Binder binder) {
    binder.bind(NodeInfo.class).in(Scopes.SINGLETON);
    NodeConfig nodeConfig = new NodeConfig().setEnvironment(environment).setNodeInternalAddress(InetAddresses.toAddrString(getV4Localhost())).setNodeBindIp(getV4Localhost());
    if (pool.isPresent()) {
        nodeConfig.setPool(pool.get());
    }
    binder.bind(NodeConfig.class).toInstance(nodeConfig);
    newExporter(binder).export(NodeInfo.class).withGeneratedName();
}
Also used : NodeInfo(io.airlift.node.NodeInfo) NodeConfig(io.airlift.node.NodeConfig)

Aggregations

NodeConfig (io.airlift.node.NodeConfig)6 NodeInfo (io.airlift.node.NodeInfo)6 Test (org.testng.annotations.Test)3 BeforeMethod (org.testng.annotations.BeforeMethod)2 Closer (com.google.common.io.Closer)1 InMemoryDiscoveryClient (io.airlift.discovery.client.testing.InMemoryDiscoveryClient)1 NullEventClient (io.airlift.event.client.NullEventClient)1 HttpClientConfig (io.airlift.http.client.HttpClientConfig)1 JettyHttpClient (io.airlift.http.client.jetty.JettyHttpClient)1 TempFile (io.airlift.testing.TempFile)1 TraceTokenManager (io.airlift.tracetoken.TraceTokenManager)1 File (java.io.File)1 IOException (java.io.IOException)1 URI (java.net.URI)1 UnknownHostException (java.net.UnknownHostException)1 HttpServlet (javax.servlet.http.HttpServlet)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1