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

Chia-Ping Tsai commented on HBASE-19673:
----------------------------------------

BufferedMutatorPeriodicFlush isn't in branch-2 so user need to modify their 
code to migrate from 1.x to 2.x. That does break our API compatibility.
Could we introduce a util to help user to config the timer?

{code:title=BufferedMutatorUtil.java}
IA.Public
public final class BufferedMutatorUtil {
  private BufferedMutatorUtil() {}
  public static setWriteBufferPeriodicFlush(BufferedMutator bm, long timeoutMs, 
long timerTickMs) {
    if (bm instanceof BufferedMutatorImpl) {
      ((BufferedMutatorImpl) 
bm).setWriteBufferPeriodicFlush(timeoutMs,timerTickMs);
    } else {
        throw new UnsupportedOperationException(
            "The BufferedMutator::setWriteBufferPeriodicFlush has not been 
implemented");
    }
  }
}
{code}

Also, we need to add the BufferedMutatorUtil to branch-2 and annotate it as 
deprecated.
{code:title=BufferedMutatorUtil.java}
@IA.Public
@deprecated // use BufferedMutator instead
public final class BufferedMutatorUtil {
  private BufferedMutatorUtil() {}
  public static setWriteBufferPeriodicFlush(BufferedMutator bm, long timeoutMs, 
long timerTickMs) {
    bm.setWriteBufferPeriodicFlush(timeoutMs,timerTickMs);
  }
}
{code}

> Backport " Periodically ensure records are not buffered too long by 
> BufferedMutator" to branch-1
> ------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-19673
>                 URL: https://issues.apache.org/jira/browse/HBASE-19673
>             Project: HBase
>          Issue Type: Improvement
>          Components: Client
>            Reporter: Niels Basjes
>            Assignee: Niels Basjes
>         Attachments: HBASE-19673.20171230-130631.branch-1.patch, 
> HBASE-19673.20171230-131955.branch-1.patch, 
> HBASE-19673.20171231-112539.branch-1.patch, 
> HBASE-19673.20180102-082937.branch-1.patch, 
> HBASE-19673.20180102-155006.branch-1.patch
>
>
> In HBASE-19486 the feature was built to periodically flush the 
> BufferedMutator.
> Because backwards compatibility is important in the 1.x branch some 
> refactoring is needed to make this work.
> As requested by [~chia7712] this separate issue was created  



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

Reply via email to