[
https://issues.apache.org/jira/browse/HBASE-16505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15470330#comment-15470330
]
Phil Yang commented on HBASE-16505:
-----------------------------------
Some thoughts for SEDA (Just to make sure RegionOperationContext can reach
original intention ):
RPCServer's processRequest parse pb bytes to HBase's request and put the
CallRunner to the thread pool of handlers. So at least here it is already a
simple SEDA. What we need is splitting the logic in CallRunner.run to more
stages for performance and availability(as mentioned in HBASE-16492).
In CallRunner now, we will call the method of region synchronously and encode
the response to by bytes and write to Responder. So at least here we can split
to two stages, operation of region and result handling. The main work for SDEA
is spliting region operation to several stages(if need). So in the whole
handling logic in RS, the first stage is parsing pb bytes, and the last stage
is result handling. These two stages are RPC-level, for example, if we use PB
for RPC, the code of these two stages will use PB's API. The middle stages
which splits the operation of Region is unrelated with implementation of RPC.
So RegionOperationContext should not contain any RPC-related objects, even
should not contain any PB objects.
In a normal SEDA flow, for each stage we implement a Runnable. In stage N, we
create a Runnable of stage N+1 and put it to the queue of stage N+1. However,
there is a special case that in any stage if there is an error, we will skip
all other stages and put the task to the final stage directly. The most simple
way is to use listener. We can use a listener which creates the object of
Runnable for the last stage and put it to its queue. Of course, if we don't
have listener, we can still create it in each stage's code, but it is not
graceful...
Therefore, the RegionOperationContext will be passed from start to end to keep
some info like deadline, result, error, etc. And support addListener to reuse
some logic for result handling especially error handling.
> 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)