use of com.yahoo.jrt.Supervisor 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));
}
use of com.yahoo.jrt.Supervisor 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();
}
use of com.yahoo.jrt.Supervisor 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);
}
Aggregations