hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duo Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-18978) Align the methods in Table and AsyncTable
Date Wed, 15 Nov 2017 07:26:00 GMT

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

Duo Zhang commented on HBASE-18978:
-----------------------------------

{quote}
one seemed like, get all result and use consumer to process them, in async way
other one is more like, streaming results and processing simultaneously, with ability to stop-start
scan on will.
{quote}

For the normal consumer, it is also in a streaming way, but the model is very simple, pass
the result one by one to the consumer. And you can return false in onNext to terminate the
scan.
And the implementation is also straight-forward, create a ResultScanner and read result one
by one and then call consumer.onNext. 
For the raw consumer, the model is much more complex. The stop-start is necessary. As you
are not allowed to do time consuming work in all the methods, a typical way is to cache the
result and process them with another thread. An example is AsyncTableResultScanner. So you
need to stop fetching when memory is full, and resume the fetching when memory is free enough.
And we also expose onHeartbeat to tell user that RS is still alive but we do not have enough
data to call onNext.

Thanks.

> 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
>            Assignee: Peter Somogyi
>            Priority: Critical
>             Fix For: 2.0.0-beta-1
>
>




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

Mime
View raw message