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

Nick Dimiduk commented on HBASE-12490:
--------------------------------------

Looking at current code on branch-1, it seems the only place we care about 
preserving the write buffer in a failure scenario is in 
HTable#backgroundFlushCommits(boolean), and in that method, we don't do 
anything with the  failed writes.

{noformat}
      if (synchronous || ap.hasError()) {
        while (!writeAsyncBuffer.isEmpty()) {
          ap.submit(tableName, writeAsyncBuffer, true, null, false);
        }
        List<Row> failedRows = clearBufferOnFail ? null : writeAsyncBuffer;
        RetriesExhaustedWithDetailsException error = 
ap.waitForAllPreviousOpsAndReset(failedRows);
        if (error != null) {
          throw error;
        }
      }
{noformat}

The call to ap.waitForAllPreviousOpsAndReset(failedRows) doesn't do anything 
with them either, it just accumulates the edits into the failedRows list. That 
variable goes out of scope immediately.

I think we can safely drop this concept of clearBufferOnFail from H/Table 
interfaces. It's still wired into AsyncProcess, so I guess it can be picked up 
in the future if there's need.

> Replace uses of setAutoFlush(boolean, boolean)
> ----------------------------------------------
>
>                 Key: HBASE-12490
>                 URL: https://issues.apache.org/jira/browse/HBASE-12490
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 2.0.0, 0.99.2
>            Reporter: Solomon Duskis
>            Assignee: Solomon Duskis
>         Attachments: HBASE-12490.patch, HBASE-12490B.patch, 
> HBASE-12490B.patch, HBASE-12490B.patch, HBASE-12490C.patch
>
>
> The various uses of setAutoFlush() seem to need some tlc.  There's a note in 
> HTableInterface: "@deprecated in 0.99 since setting clearBufferOnFail is 
> deprecated. Use setAutoFlushTo(boolean) instead."  It would be ideal to 
> change all internal uses of setAutoFlush(boolean, boolean) to use 
> setAutoFlushTo, if possible.
> HTable.setAutoFlush(boolean, boolean) is used in a handful of places.  
> setAutoFlush(false, false) has the same results as 
> HTable.setAutoFlush(false).  Calling HTable.setAutoFlush(false, true) has the 
> same affect as Table.setAutoFlushTo(false), assuming 
> HTable.setAutoFlush(false) was not called previously (by default, the second 
> parameter, clearBufferOnFail, is true and should remain true according to the 
> comments). 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to