@Test public void testLifecycle() throws Throwable { MockRPC rpc = new MockRPC(); WorkflowRpcService svc = new WorkflowRpcService("test", rpc); run(svc); assertTrue(rpc.started); svc.getConnectAddress(); svc.stop(); assertTrue(rpc.stopped); }
@Test public void testStartFailure() throws Throwable { MockRPC rpc = new MockRPC(); rpc.failOnStart = true; WorkflowRpcService svc = new WorkflowRpcService("test", rpc); svc.init(new Configuration()); try { svc.start(); fail("expected an exception"); } catch (RuntimeException e) { assertEquals("failOnStart", e.getMessage()); } svc.stop(); assertTrue(rpc.stopped); }
startSliderRPCServer(instanceDefinition); rpcServiceAddress = rpcService.getConnectAddress(); appMasterHostname = rpcServiceAddress.getAddress().getCanonicalHostName(); appMasterRpcPort = rpcServiceAddress.getPort(); rpcService.getServer().refreshServiceAcl(serviceConf, new SliderAMPolicyProvider()); if (securityConfiguration.isKeytabProvided()) {
/** * Start the slider RPC server */ private void startSliderRPCServer(AggregateConf instanceDefinition) throws IOException, SliderException { verifyIPCAccess(); sliderIPCService = new SliderIPCService( this, certificateManager, stateForProviders, actionQueues, metricsAndMonitoring, contentCache); deployChildService(sliderIPCService); SliderClusterProtocolPBImpl protobufRelay = new SliderClusterProtocolPBImpl(sliderIPCService); BlockingService blockingService = SliderClusterAPI.SliderClusterProtocolPB .newReflectiveBlockingService( protobufRelay); int port = getPortToRequest(); InetSocketAddress rpcAddress = new InetSocketAddress("0.0.0.0", port); rpcService = new WorkflowRpcService("SliderRPC", RpcBinder.createProtobufServer(rpcAddress, getConfig(), secretManager, NUM_RPC_HANDLERS, blockingService, null)); deployChildService(rpcService); }
startSliderRPCServer(instanceDefinition); rpcServiceAddress = rpcService.getConnectAddress(); appMasterHostname = rpcServiceAddress.getAddress().getCanonicalHostName(); appMasterRpcPort = rpcServiceAddress.getPort(); rpcService.getServer().refreshServiceAcl(serviceConf, new SliderAMPolicyProvider()); if (securityConfiguration.isKeytabProvided()) {
new WorkflowRpcService("SliderRPC", RpcBinder.createProtobufServer(rpcAddress, getConfig(), secretManager,
@Test public void testLifecycle() throws Throwable { MockRPC rpc = new MockRPC(); WorkflowRpcService svc = new WorkflowRpcService("test", rpc); run(svc); assertTrue(rpc.started); svc.getConnectAddress(); svc.stop(); assertTrue(rpc.stopped); }
@Test public void testStartFailure() throws Throwable { MockRPC rpc = new MockRPC(); rpc.failOnStart = true; WorkflowRpcService svc = new WorkflowRpcService("test", rpc); svc.init(new Configuration()); try { svc.start(); fail("expected an exception"); } catch (RuntimeException e) { assertEquals("failOnStart", e.getMessage()); } svc.stop(); assertTrue(rpc.stopped); }