[ https://issues.apache.org/jira/browse/HBASE-16505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15470069#comment-15470069 ]
Phil Yang commented on HBASE-16505: ----------------------------------- Future(or netty's Promise) has some methods to get the result synchronously, like get() or get(long timeout, TimeUnit unit), which is same as RegionOperationContext in patch v6. But when we make operations in RS fully non-blocking, the blocking methods are useless. What I thought before is using blocking method first and finally change it to the style of listeners. But if we want to make RegionOperationContext exactly what we really want, we do not need blocking methods. So we can only support addListener in RegionOperationContext, and have a default implementation of listener supporting getting result/error. And as I mentioned last week, in fact now we will call AsyncRegion's method synchronously, after it done we will not be blocked by getResult() of the listener. In HBASE-16492, we can add some checkpoints to set timeout error to the context and exit the operation. Then when we call listener's getResult we will catch timeout exception. Finally, we can implement a new listener without getResult method and support more for SEDA, the RegionOperationContext will not be changed, and we need a centralized management for timeout like RPC client for each stage. The listeners will be guaranteed to be notified when timeout. > Add AsyncRegion interface to pass deadline and support async operations > ----------------------------------------------------------------------- > > Key: HBASE-16505 > URL: https://issues.apache.org/jira/browse/HBASE-16505 > Project: HBase > Issue Type: Sub-task > Reporter: Phil Yang > Assignee: Phil Yang > Attachments: HBASE-16505-v1.patch, HBASE-16505-v2.patch, > HBASE-16505-v3.patch, HBASE-16505-v4.patch, HBASE-16505-v5.patch, > HBASE-16505-v6.patch > > > If we want to know the correct setting of timeout in read/write path, we need > add a new parameter in operation-methods of Region. -- This message was sent by Atlassian JIRA (v6.3.4#6332)