[ 
https://issues.apache.org/jira/browse/HBASE-18978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16204383#comment-16204383
 ] 

Peter Somogyi commented on HBASE-18978:
---------------------------------------

I'm posting here the same content that I sent out to dev list.

To make it simpler to compare the differences between Table and AsyncTable I 
put together a spreadsheet.
https://docs.google.com/spreadsheets/d/15DdDp3Yljlb_Mrd3BQuoyzqnhomJhTM8bHvmEa6t6Jc/edit?usp=sharing

I categorized them into the following groups:

* RPC timeouts
- Both interfaces have the same functionality, however, in AsyncTable the 
TimeUnit can be set for each method.
- The getRpcTimeout is deprecated in Table from version 2.0.0, but it is not 
deprecated in AsyncTable.
We can make the RPC timeout handling aligned in the 2 interfaces. My 
recommendation is to go with the ones in AsyncTable.

* Coprocessor
- Methods that are related to Coprocessors are only available in Table.
What is the reason for this?

* List with xAll operations
- We have the ability to run operation (get, delete, put, batch) in batch mode 
using a List input parameter in both interfaces. AsyncTable has additional 
methods called xAll(List) (e.g. getAll) where we have the same operations but 
the whole operation fails if there are any failures.
- The methods related to {exists} differ from the previous operations. To 
compare it with {get}:
Table                                                 | AsyncTable
-------------------------------------------------------------------------------------------------------------------------------
Result get(Get get)                           | CompletableFuture<Result> 
get(Get get)
Result[] get(List<Get> gets)             | List<CompletableFuture<Result>> 
get(List<Get> gets)
-                                                        | 
CompletableFuture<List<Result>> getAll(List<Get> gets)
-------------------------------------------------------------------------------------------------------------------------------
boolean exists(Get get)                    | CompletableFuture<Boolean> 
exists(Get get)
boolean[] existsAll(List<Get> gets)  | List<CompletableFuture<Boolean>> 
exists(List<Get> gets)
-                                                        | 
CompletableFuture<List<Boolean>> existsAll(List<Get> gets)
Should we align these methods?

- Method {batch} is also similar to these operations, however, the signature is 
different between Table and AsyncTable interfaces. Additionally, Table had a 
method {batchCallback} which is missing from AsyncTable.

* Checks
Check and mutate methods are way different. Table has checkAndx methods (some 
of them are deprecated), but AsyncTable has an interface called 
CheckAndMutateBuilder and these kind of operations are handled through that.

* Scan
Both interfaces include getScanner methods with the same signature. 
Additionally, AsyncTable has {scan} and {scanAll} methods which are not part of 
Table interface.

* Different return types
There are 2 methods that does the same in the 2 interfaces but have different 
return types. The ones in Table return with an array and the ones from 
AsyncTable return with a List. HBASE-18912 is a similar issue on Admin 
interface. Changing only return type is difficult. Do we need to deal with this 
problem?

> Align the methods in Table and AsyncTable
> -----------------------------------------
>
>                 Key: HBASE-18978
>                 URL: https://issues.apache.org/jira/browse/HBASE-18978
>             Project: HBase
>          Issue Type: Task
>          Components: asyncclient, Client
>            Reporter: Duo Zhang
>            Priority: Critical
>             Fix For: 2.0.0-beta-1
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to