Search in sources :

Example 16 with Transport

use of com.yahoo.jrt.Transport in project vespa by vespa-engine.

the class ConfigProxyRpcServerTest method basic.

@Test
public void basic() {
    ProxyServer proxy = ProxyServer.createTestServer(new MockConfigSource(new MockClientUpdater()));
    Spec spec = new Spec("localhost", 12345);
    ConfigProxyRpcServer server = new ConfigProxyRpcServer(proxy, new Supervisor(new Transport()), spec);
    assertThat(server.getSpec(), is(spec));
}
Also used : Supervisor(com.yahoo.jrt.Supervisor) Spec(com.yahoo.jrt.Spec) Transport(com.yahoo.jrt.Transport) Test(org.junit.Test)

Example 17 with Transport

use of com.yahoo.jrt.Transport in project vespa by vespa-engine.

the class TestWithRpc method createAndStartRpcServer.

protected void createAndStartRpcServer(boolean hostedVespa) {
    ConfigserverConfig configserverConfig = new ConfigserverConfig(new ConfigserverConfig.Builder());
    rpcServer = new RpcServer(new ConfigserverConfig(new ConfigserverConfig.Builder().rpcport(port).numRpcThreads(1).maxgetconfigclients(1).hostedVespa(hostedVespa)), new SuperModelRequestHandler(new TestConfigDefinitionRepo(), configserverConfig, new SuperModelManager(configserverConfig, emptyNodeFlavors(), generationCounter)), Metrics.createTestMetrics(), new HostRegistries(), hostLivenessTracker, new FileServer(FileDistribution.getDefaultFileDBPath()));
    rpcServer.onTenantCreate(TenantName.from("default"), tenantProvider);
    t = new Thread(rpcServer);
    t.start();
    sup = new Supervisor(new Transport());
    pingServer();
}
Also used : ConfigserverConfig(com.yahoo.cloud.config.ConfigserverConfig) Supervisor(com.yahoo.jrt.Supervisor) HostRegistries(com.yahoo.vespa.config.server.host.HostRegistries) Transport(com.yahoo.jrt.Transport) FileServer(com.yahoo.vespa.config.server.filedistribution.FileServer)

Example 18 with Transport

use of com.yahoo.jrt.Transport in project vespa by vespa-engine.

the class RpcTester method main.

public static void main(String[] args) {
    // String fileReference = args[0];
    String fileReference = "59f93f445438c9db7ccbf1629f583c2aa004a68b";
    String filename = "com.yahoo.vespatest.ExtraHitSearcher-1.0.0-deploy.jar";
    File file = new File(String.format("/tmp/%s/%s", fileReference, filename));
    byte[] blob = null;
    try {
        blob = IOUtils.readFileBytes(file);
    } catch (IOException e) {
        e.printStackTrace();
    }
    log.log(LogLevel.INFO, "Read blob from " + file.getAbsolutePath());
    Supervisor supervisor = new Supervisor(new Transport());
    Spec spec = new Spec("tcp/localhost:19090");
    log.log(LogLevel.INFO, "Connecting to " + spec);
    Target target = supervisor.connect(spec);
    if (!target.isValid()) {
        log.log(LogLevel.INFO, "Could not connect");
        System.exit(1);
    } else {
        log.log(LogLevel.INFO, "Connected to " + spec);
    }
    new RpcTester(target).call(fileReference, filename, blob);
}
Also used : Supervisor(com.yahoo.jrt.Supervisor) Target(com.yahoo.jrt.Target) IOException(java.io.IOException) Transport(com.yahoo.jrt.Transport) Spec(com.yahoo.jrt.Spec) File(java.io.File)

Aggregations

Supervisor (com.yahoo.jrt.Supervisor)18 Transport (com.yahoo.jrt.Transport)18 Spec (com.yahoo.jrt.Spec)13 Target (com.yahoo.jrt.Target)11 Request (com.yahoo.jrt.Request)10 Test (org.junit.Test)8 StringValue (com.yahoo.jrt.StringValue)7 ConfiguredNode (com.yahoo.vdslib.distribution.ConfiguredNode)4 NodeState (com.yahoo.vdslib.state.NodeState)4 Distribution (com.yahoo.vdslib.distribution.Distribution)3 Node (com.yahoo.vdslib.state.Node)3 ConfigSourceSet (com.yahoo.config.subscription.ConfigSourceSet)2 Mirror (com.yahoo.jrt.slobrok.api.Mirror)2 SlobrokList (com.yahoo.jrt.slobrok.api.SlobrokList)2 ClusterState (com.yahoo.vdslib.state.ClusterState)2 TreeSet (java.util.TreeSet)2 ConfigserverConfig (com.yahoo.cloud.config.ConfigserverConfig)1 Int32Value (com.yahoo.jrt.Int32Value)1 IMirror (com.yahoo.jrt.slobrok.api.IMirror)1 Register (com.yahoo.jrt.slobrok.api.Register)1