@Override public Object invoke(Object instance, final Method method, final Object[] args) throws Throwable { if (LOG.isDebugEnabled()) { LOG.debug("Call: "+method.getName()+", "+(args != null ? args.length : 0)); } Exec exec = new Exec(conf, protocol, method, args); ExecResult result = connection.getMaster().execCoprocessor(exec); LOG.debug("Master Result is value="+result.getValue()); return result.getValue(); } }
@Override public ExecResult execCoprocessor(Exec call) throws IOException { Class<? extends CoprocessorProtocol> protocol = call.getProtocol(); if (protocol == null) { String protocolName = call.getProtocolName(); if (LOG.isDebugEnabled()) { LOG.debug("Received dynamic protocol exec call with protocolName " + protocolName); call.getMethodName(), call.getParameterClasses()); method.setAccessible(true); value = method.invoke(handler, call.getParameters()); } catch (InvocationTargetException e) { Throwable target = e.getTargetException();
Class<? extends CoprocessorProtocol> protocol = call.getProtocol(); if (protocol == null) { String protocolName = call.getProtocolName(); if (LOG.isDebugEnabled()) { LOG.debug("Received dynamic protocol exec call with protocolName " + protocolName); call.getMethodName(), call.getParameterClasses()); method.setAccessible(true); value = method.invoke(handler, call.getParameters()); } catch (InvocationTargetException e) { Throwable target = e.getTargetException();
@Override public Object invoke(Object instance, final Method method, final Object[] args) throws Throwable { if (LOG.isDebugEnabled()) { LOG.debug("Call: "+method.getName()+", "+(args != null ? args.length : 0)); } if (row != null) { final Exec exec = new Exec(conf, row, protocol, method, args); ServerCallable<ExecResult> callable = new ServerCallable<ExecResult>(connection, table, row) { public ExecResult call() throws Exception { return server.execCoprocessor(location.getRegionInfo().getRegionName(), exec); } }; ExecResult result = callable.withRetries(); this.regionName = result.getRegionName(); LOG.debug("Result is region="+ Bytes.toStringBinary(regionName) + ", value="+result.getValue()); return result.getValue(); } return null; }