@Override public TestResponse test(RpcController rpcController, TestArg arg) throws ServiceException { LOG.info("In faulty test, delay=" + arg.getDelay()); if (!arg.getDelay()) return TestResponse.newBuilder().setResponse(UNDELAYED).build(); Delayable call = RpcServer.getCurrentCall(); call.startDelay(true); LOG.info("In faulty test, delaying"); try { call.endDelayThrowing(new Exception("Something went wrong")); } catch (IOException e) { e.printStackTrace(); } // Client will receive the Exception, not this value. return TestResponse.newBuilder().setResponse(DELAYED).build(); }
@Override public TestResponse test(TestArg arg) { if (!arg.getDelay()) return TestResponse.newBuilder().setResponse(UNDELAYED).build(); Delayable call = HBaseServer.getCurrentCall(); call.startDelay(true); try { call.endDelayThrowing(new Exception("Something went wrong")); } catch (IOException e) { e.printStackTrace(); } // Client will receive the Exception, not this value. return TestResponse.newBuilder().setResponse(DELAYED).build(); }
TestResponse test(TestArg delay);