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

Ted Yu commented on HBASE-4143:
-------------------------------

I applied Gary's patch to branch and TRUNK.
Looking at the check:
{code}
      if (n % DOPUT_WB_CHECK == 0 && currentWriteBufferSize > writeBufferSize) {
{code}
the effect is that if write buffer size is reached at Put #11, we would wait 
till Put #20 (suppose there're at least 20 Put's) to flush.
I guess it is Okay since we may have closen 20 as DOPUT_WB_CHECK in the 
beginning.

I will wait for a day before resolving this JIRA.

Thanks for Gary's sharp eyes and sharp mind.

> HTable.doPut(List) should check the writebuffer length every so often
> ---------------------------------------------------------------------
>
>                 Key: HBASE-4143
>                 URL: https://issues.apache.org/jira/browse/HBASE-4143
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Doug Meil
>            Assignee: Doug Meil
>            Priority: Minor
>         Attachments: HBASE-4143_update.patch, client_HBASE_4143.patch
>
>
> This came up on a dist-list conversation between Andy P., Ted Yu, and myself. 
>  Andy noted that extremely large lists passed into put(List) can cause 
> issues.  Ted suggested that having doPut check the write-buffer length every 
> so often (5-10 records?) so the flush doesn't happen only at the end, and I 
> think that's good idea.
>  public void put(final List<Put> puts) throws IOException {
>     doPut(puts);
>   }
>   private void doPut(final List<Put> puts) throws IOException {
>     for (Put put : puts) {
>       validatePut(put);
>       writeBuffer.add(put);
>       currentWriteBufferSize += put.heapSize();
>     }
>     if (autoFlush || currentWriteBufferSize > writeBufferSize) {
>       flushCommits();
>     }
>   }
> Once this change is made, remove the comment in HBASE-4142 about large lists 
> being a performance problem.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to