@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; }