maybe i misunderstand the method 'backgroundFlushCommits', if AP has error, 
then a exception will be thrown inside 'backgroundFlushCommits, so if AP has 
error, 
the same put will not be flush twice

but,  
validatePut(put);
should be executed if AP has error

[email protected]
 
From: Ted Yu
Date: 2015-09-07 10:06
To: [email protected]
Subject: Re: improvement in htable.doput
Looking at the tip of 0.98 branch, the logic in doPut() is the same as
shown below.
 
You may want to open a JIRA and attach patch if you have time.
 
Cheers
 
On Sun, Sep 6, 2015 at 6:15 PM, [email protected] <
[email protected]> wrote:
 
>   in hbase0.98.10, doPut is as follows:
>
> private void doPut(Put put) throws InterruptedIOException,
> RetriesExhaustedWithDetailsException {
>     if (ap.hasError()){
>       writeAsyncBuffer.add(put);
>       backgroundFlushCommits(true);
>     }
>
>     validatePut(put);
>
>     currentWriteBufferSize += put.heapSize();
>     writeAsyncBuffer.add(put);
>
>     while (currentWriteBufferSize > writeBufferSize) {
>       backgroundFlushCommits(false);
>     }
>   }
>
> i have two suggesstions:
> 1. if ap has error, then this put will be added to buffer twice and flush
> twice, why?
> 2. if really need to flush twice, then we should validate, increament
> buffer size, finally add this put to buffer.
>
>
>
> [email protected]
>

Reply via email to