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

Niels Basjes commented on HBASE-19673:
--------------------------------------

I think I understand the problem.

I intended the code for the basic usecase to be compatible in both versions 
like this:
{code}
Configuration conf = HBaseConfiguration.create();

BufferedMutatorParams bmp = new BufferedMutatorParams(TableName.valueOf("Foo"))
        .setWriteBufferPeriodicFlushTimeoutMs(500)
        .setWriteBufferPeriodicFlushTimerTickMs(100);

Connection conn = ConnectionFactory.createConnection(conf);
BufferedMutator mutator = conn.getBufferedMutator(bmp);
{code} 

So setting the timeout during construction is the same.

Changing the timeout afterwards in the 2.x version is easier because you can 
simply do 
{code}mutator.setWriteBufferPeriodicFlush(100,100);{code}

Where the 1.x needs a cast to the implementation (or the interface)
{code}BufferedMutatorImpl mutatorImpl = (BufferedMutatorImpl)mutator;
mutatorImpl.setWriteBufferPeriodicFlush(100,100);{code}
Note that Application code written against 
# 1.x does not need to change when switching to 2.x
# 2.x is simpler because it does not need the cast

Also note that this is a major version difference and therefor it is "ok" to 
have API changes.

So I'll simply remove the {{BufferedMutatorPeriodicFlush}} interface to reduce 
confusion.


> 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