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

Anoop Sam John commented on HBASE-18906:
----------------------------------------

bq.Yeah, how does this relate to HBASE-18905?
18905 provide an API in Region so that CPs can request for a flush.  This one 
is wait for ongoing flushes if any.  Those might not be flushes given by CPs 
even. We are not tracking any specific flush action.  Just want to know if the 
Region is under a flush or not.
bq.What will we do? Exception?
HRegion API level, it will return FlushResult#CANNOT_FLUSH.    But for CP , we 
dont expose sync flush API. It will be req flush API( by 18905 ). There will be 
tracker been passed and when we can not flush the corresponding notExecuted 
method will get invoked.  Said that this is for tracking a given flush req by 
this CP user. 
This patch provides ability for the CPs to wait for any ongoing flushes.
Phoenix can make use of this in one place.  There before doing a huge data 
write op, it checks for the Region memstore size.  If that is above some 
threshold, need a time bounded wait.  Right now how Phoenix do this is with a 
sleep for 100 msec in a loop. Every loop will check the size again and either 
come out of sleep again.. Instead Phoenix can use this API.

> Provide Region#waitForFlushes API
> ---------------------------------
>
>                 Key: HBASE-18906
>                 URL: https://issues.apache.org/jira/browse/HBASE-18906
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Coprocessors
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 2.0.0-alpha-4
>
>         Attachments: HBASE-18906.patch
>
>
> Expose an API for the CPs to wait for all on going flushes in a Region. The 
> API should support taking a time out.
> Background
> While reviewing HBASE-18183, Andy pointed out that Phoenix uses 
> waitForFlushesAndCompactions and/or waitForFlushes for diff reasons.  This 
> issue is to see why they need them and whether alternate ways are possible. 
> This seems to be too much internal stuff and a normal CP hook calling these 
> would be dangerous.
> If there are alternate ways for Phoenix not to use this and not landing in 
> issues (As said by Andy) we should suggest/fix for them.



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

Reply via email to