From d13f98c42ca6fb52090c016c35d8b8f7c3fecca7 Mon Sep 17 00:00:00 2001 From: zhangduo Date: Thu, 16 Nov 2017 21:18:35 +0800 Subject: [PATCH] HBASE-19271 Update ref guide about the async client to reflect the change in HBASE-19251 --- src/main/asciidoc/_chapters/architecture.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/asciidoc/_chapters/architecture.adoc b/src/main/asciidoc/_chapters/architecture.adoc index 2a8accc..fabdb20 100644 --- a/src/main/asciidoc/_chapters/architecture.adoc +++ b/src/main/asciidoc/_chapters/architecture.adoc @@ -236,11 +236,11 @@ There are several differences for scan: * There is a `scanAll` method which will return all the results at once. It aims to provide a simpler way for small scans which you want to get the whole results at once usually. * The Observer Pattern. There is a scan method which accepts a `ScanResultConsumer` as a parameter. It will pass the results to the consumer. -Notice that there are two types of asynchronous table, one is `AsyncTable` and the other is `RawAsyncTable`. +Notice that although there is only one `AsyncTable` interface, actually there are two types of `AsyncTable`. The type parameter of the `AsyncTable` is the type of `ScanResultConsumer`, which means the observer style scan APIs are different. One is `ScanResultConsumer` while the other is `AdvancedScanResultConsumer`. -For `AsyncTable`, you need to provide a thread pool when getting it. The callbacks registered to the returned CompletableFuture will be executed in that thread pool. It is designed for normal users. You are free to do anything in the callbacks. +For the one with `ScanResultConsumer`, you need to provide a thread pool when getting it. The callbacks registered to the returned CompletableFuture will be executed in that thread pool. It is designed for normal users. You are free to do anything in the callbacks. -For `RawAsyncTable`, all the callbacks are executed inside the framework thread so it is not allowed to do time consuming works in the callbacks otherwise you may block the framework thread and cause very bad performance impact. It is designed for advanced users who want to write high performance code. You can see the `org.apache.hadoop.hbase.client.example.HttpProxyExample` to see how to write fully asynchronous code with `RawAsyncTable`. And coprocessor related methods are only in `RawAsyncTable`. +For the one with `AdvancedScanResultConsumer`, all the callbacks are executed inside the framework thread so it is not allowed to do time consuming works in the callbacks otherwise you may block the framework thread and cause very bad performance impact. As its name, it is designed for advanced users who want to write high performance code. You can see the `org.apache.hadoop.hbase.client.example.HttpProxyExample` to see how to write fully asynchronous code with it. [[async.admin]] === Asynchronous Admin === -- 2.7.4