throws IOException, Throwable {
Map<byte[],Future<R>> futures =
new TreeMap<byte[],Future<R>>(Bytes.BYTES_COMPARATOR);
for (final byte[] r : rows) {
final ExecRPCInvoker invoker =
new ExecRPCInvoker(conf, this, protocol, tableName, r);
Future<R> future = pool.submit(
new Callable<R>() {
public R call() throws Exception {
T instance = (T)Proxy.newProxyInstance(conf.getClassLoader(),
new Class[]{protocol},
invoker);
R result = callable.call(instance);
byte[] region = invoker.getRegionName();
if (callback != null) {
callback.update(region, r, result);
}
return result;
}