From 02b99bc30b8b81681a77ff895af126d4a517a55b Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Tue, 20 Aug 2024 09:41:51 -0400 Subject: [PATCH] AsyncTableImpl should call coprocessor callbacks in a defined order --- .../hadoop/hbase/client/AsyncTableImpl.java | 27 ++----------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableImpl.java index 590ee9bc47a3..f3fc5aaf4536 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncTableImpl.java @@ -296,32 +296,9 @@ public CompletableFuture coprocessorService(Function st public CoprocessorServiceBuilder coprocessorService( Function stubMaker, ServiceCaller callable, CoprocessorCallback callback) { - final Context context = Context.current(); - CoprocessorCallback wrappedCallback = new CoprocessorCallback() { - - @Override - public void onRegionComplete(RegionInfo region, R resp) { - pool.execute(context.wrap(() -> callback.onRegionComplete(region, resp))); - } - - @Override - public void onRegionError(RegionInfo region, Throwable error) { - pool.execute(context.wrap(() -> callback.onRegionError(region, error))); - } - - @Override - public void onComplete() { - pool.execute(context.wrap(callback::onComplete)); - } - - @Override - public void onError(Throwable error) { - pool.execute(context.wrap(() -> callback.onError(error))); - } - }; CoprocessorServiceBuilder builder = - rawTable.coprocessorService(stubMaker, callable, wrappedCallback); - return new CoprocessorServiceBuilder() { + rawTable.coprocessorService(stubMaker, callable, callback); + return new CoprocessorServiceBuilder<>() { @Override public CoprocessorServiceBuilder fromRow(byte[] startKey, boolean inclusive) {