@Override public Message callBlockingMethod(MethodDescriptor md, RpcController controller, Message param, Message returnType) throws ServiceException { invokations.getAndIncrement(); if (RANDOM.nextFloat() < CHANCE_OF_TIMEOUT) { // throw a ServiceException, becuase that is the only exception type that // {@link ProtobufRpcEngine} throws. If this RpcEngine is used with a different // "actual" type, this may not properly mimic the underlying RpcEngine. throw new ServiceException(new SocketTimeoutException("fake timeout")); } return super.callBlockingMethod(md, controller, param, returnType); } }
@Override public Message callBlockingMethod(MethodDescriptor md, RpcController controller, Message param, Message returnType) throws ServiceException { invokations.getAndIncrement(); if (RANDOM.nextFloat() < CHANCE_OF_TIMEOUT) { // throw a ServiceException, becuase that is the only exception type that // {@link ProtobufRpcEngine} throws. If this RpcEngine is used with a different // "actual" type, this may not properly mimic the underlying RpcEngine. throw new ServiceException(new SocketTimeoutException("fake timeout")); } return super.callBlockingMethod(md, controller, param, returnType); } }
@Override public BlockingRpcChannel createBlockingRpcChannel(final ServerName sn, final User ticket, int defaultOperationTimeout) { return new BlockingRpcChannelImplementation(this, sn, ticket, defaultOperationTimeout); }
@Override public Message callBlockingMethod(Descriptors.MethodDescriptor md, RpcController controller, Message param, Message returnType) throws ServiceException { return rpcClient.callBlockingMethod(md, configureRpcController(controller), param, returnType, ticket, addr); } }
@Override public BlockingRpcChannel createBlockingRpcChannel(final ServerName sn, final User ticket, int rpcTimeout) throws UnknownHostException { return new BlockingRpcChannelImplementation(this, createAddr(sn), ticket, rpcTimeout); }
@Override public BlockingRpcChannel createBlockingRpcChannel(final ServerName sn, final User ticket, int rpcTimeout) throws UnknownHostException { return new BlockingRpcChannelImplementation(this, createAddr(sn), ticket, rpcTimeout); }
@Override public Message callBlockingMethod(Descriptors.MethodDescriptor md, RpcController controller, Message param, Message returnType) throws ServiceException { return rpcClient.callBlockingMethod(md, configureRpcController(controller), param, returnType, ticket, addr); } }
@Override public Message callBlockingMethod(Descriptors.MethodDescriptor md, RpcController controller, Message param, Message returnType) throws ServiceException { return rpcClient.callBlockingMethod(md, configureRpcController(controller), param, returnType, ticket, addr); } }
@Override public BlockingRpcChannel createBlockingRpcChannel(final ServerName sn, final User ticket, int rpcTimeout) throws UnknownHostException { return new BlockingRpcChannelImplementation(this, createAddr(sn), ticket, rpcTimeout); }