/** * Make a blocking call. Throws exceptions if there are network problems or if the remote code * threw an exception. * @param ticket Be careful which ticket you pass. A new user will mean a new Connection. * {@link UserProvider#getCurrent()} makes a new instance of User each time so will be a * new Connection each time. * @return A pair with the Message response and the Cell data (if any). */ private Message callBlockingMethod(Descriptors.MethodDescriptor md, HBaseRpcController hrc, Message param, Message returnType, final User ticket, final InetSocketAddress isa) throws ServiceException { BlockingRpcCallback<Message> done = new BlockingRpcCallback<>(); callMethod(md, hrc, param, returnType, ticket, isa, done); Message val; try { val = done.get(); } catch (IOException e) { throw new ServiceException(e); } if (hrc.failed()) { throw new ServiceException(hrc.getFailed()); } else { return val; } }
/** * Make a blocking call. Throws exceptions if there are network problems or if the remote code * threw an exception. * @param ticket Be careful which ticket you pass. A new user will mean a new Connection. * {@link UserProvider#getCurrent()} makes a new instance of User each time so will be a * new Connection each time. * @return A pair with the Message response and the Cell data (if any). */ private Message callBlockingMethod(Descriptors.MethodDescriptor md, HBaseRpcController hrc, Message param, Message returnType, final User ticket, final InetSocketAddress isa) throws ServiceException { BlockingRpcCallback<Message> done = new BlockingRpcCallback<>(); callMethod(md, hrc, param, returnType, ticket, isa, done); Message val; try { val = done.get(); } catch (IOException e) { throw new ServiceException(e); } if (hrc.failed()) { throw new ServiceException(hrc.getFailed()); } else { return val; } }
/** * Make a blocking call. Throws exceptions if there are network problems or if the remote code * threw an exception. * @param ticket Be careful which ticket you pass. A new user will mean a new Connection. * {@link UserProvider#getCurrent()} makes a new instance of User each time so will be a * new Connection each time. * @return A pair with the Message response and the Cell data (if any). */ private Message callBlockingMethod(Descriptors.MethodDescriptor md, HBaseRpcController hrc, Message param, Message returnType, final User ticket, final InetSocketAddress isa) throws ServiceException { BlockingRpcCallback<Message> done = new BlockingRpcCallback<>(); callMethod(md, hrc, param, returnType, ticket, isa, done); Message val; try { val = done.get(); } catch (IOException e) { throw new ServiceException(e); } if (hrc.failed()) { throw new ServiceException(hrc.getFailed()); } else { return val; } }