@Test public void testWrapException() throws Exception { final InetSocketAddress address = InetSocketAddress.createUnresolved("localhost", 0); assertTrue(wrapException(address, new ConnectException()) instanceof ConnectException); assertTrue( wrapException(address, new SocketTimeoutException()) instanceof SocketTimeoutException); assertTrue(wrapException(address, new ConnectionClosingException( "Test AbstractRpcClient#wrapException")) instanceof ConnectionClosingException); assertTrue( wrapException(address, new CallTimeoutException("Test AbstractRpcClient#wrapException")) .getCause() instanceof CallTimeoutException); } }
private void onCallFinished(Call call, HBaseRpcController hrc, InetSocketAddress addr, RpcCallback<Message> callback) { call.callStats.setCallTimeMs(EnvironmentEdgeManager.currentTime() - call.getStartTime()); if (metrics != null) { metrics.updateRpc(call.md, call.param, call.callStats); } if (LOG.isTraceEnabled()) { LOG.trace( "Call: " + call.md.getName() + ", callTime: " + call.callStats.getCallTimeMs() + "ms"); } if (call.error != null) { if (call.error instanceof RemoteException) { call.error.fillInStackTrace(); hrc.setFailed(call.error); } else { hrc.setFailed(wrapException(addr, call.error)); } callback.run(null); } else { hrc.setDone(call.cells); callback.run(call.response); } }
@Test public void testWrapException() throws Exception { final InetSocketAddress address = InetSocketAddress.createUnresolved("localhost", 0); assertTrue(wrapException(address, new ConnectException()) instanceof ConnectException); assertTrue( wrapException(address, new SocketTimeoutException()) instanceof SocketTimeoutException); assertTrue(wrapException(address, new ConnectionClosingException( "Test AbstractRpcClient#wrapException")) instanceof ConnectionClosingException); assertTrue( wrapException(address, new CallTimeoutException("Test AbstractRpcClient#wrapException")) .getCause() instanceof CallTimeoutException); } }
private void onCallFinished(Call call, HBaseRpcController hrc, InetSocketAddress addr, RpcCallback<Message> callback) { call.callStats.setCallTimeMs(EnvironmentEdgeManager.currentTime() - call.getStartTime()); if (metrics != null) { metrics.updateRpc(call.md, call.param, call.callStats); } if (LOG.isTraceEnabled()) { LOG.trace( "Call: " + call.md.getName() + ", callTime: " + call.callStats.getCallTimeMs() + "ms"); } if (call.error != null) { if (call.error instanceof RemoteException) { call.error.fillInStackTrace(); hrc.setFailed(call.error); } else { hrc.setFailed(wrapException(addr, call.error)); } callback.run(null); } else { hrc.setDone(call.cells); callback.run(call.response); } }
private void onCallFinished(Call call, HBaseRpcController hrc, InetSocketAddress addr, RpcCallback<Message> callback) { call.callStats.setCallTimeMs(EnvironmentEdgeManager.currentTime() - call.getStartTime()); if (metrics != null) { metrics.updateRpc(call.md, call.param, call.callStats); } if (LOG.isTraceEnabled()) { LOG.trace( "Call: " + call.md.getName() + ", callTime: " + call.callStats.getCallTimeMs() + "ms"); } if (call.error != null) { if (call.error instanceof RemoteException) { call.error.fillInStackTrace(); hrc.setFailed(call.error); } else { hrc.setFailed(wrapException(addr, call.error)); } callback.run(null); } else { hrc.setDone(call.cells); callback.run(call.response); } }