[
https://issues.apache.org/jira/browse/HBASE-10169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13856889#comment-13856889
]
Jingcheng Du commented on HBASE-10169:
--------------------------------------
[~ghelmling], [~apurtell]. Hi Gary, Andy. It's a good idea to return the
CoprocessorServiceResponse in a batch without combining in the server side. But
it's very difficult to implement the coprocessor transparently.
In the HTable, we have the method "public <T extends Service, R>
Map<byte[],R> coprocessorService(final Class<T> service, byte[] startKey,
byte[] endKey, final Batch.Call<T,R> callable)". The Batch.call allows users to
decide how to execute the coprocessor.
final RegionCoprocessorRpcChannel channel = new
RegionCoprocessorRpcChannel(connection, tableName, r);
T instance = ProtobufUtil.newServiceStub(service, channel);
R result = callable.call(instance);
The RegionCoprocessorRpcChannel executes the HRegionServer.execService
against a single region each time. If we use a
RegionServerCoprocessorRpcChannel to directly invoke the
HRegionServer.execMultiService() instead, the returned value of the
callable.call(instance) should be List<R>, which is not right.
So it's difficult to have the batch execution for coprocessor service.in a
transparent way.
Maybe we could add a new API for the HTable, like "public <T extends Service,
R> Map<byte[],R> coprocessorService(final Class<T> service,
Descriptors.MethodDescriptor method, byte[] startKey, byte[] endKey)" to
realize the batch coprocessor execution. But users are not allowed to decide
how to execute the coprocessor since the Batch.Call is not in the arguments any
more.
How do you think about this? Please help advise. Thanks!
> Batch coprocessor
> -----------------
>
> Key: HBASE-10169
> URL: https://issues.apache.org/jira/browse/HBASE-10169
> Project: HBase
> Issue Type: Sub-task
> Components: Coprocessors
> Affects Versions: 0.99.0
> Reporter: Jingcheng Du
> Assignee: Jingcheng Du
> Attachments: Batch Coprocessor Design Document.docx, HBASE-10169.patch
>
>
> This is designed to improve the coprocessor invocation in the client side.
> Currently the coprocessor invocation is to send a call to each region. If
> there’s one region server, and 100 regions are located in this server, each
> coprocessor invocation will send 100 calls, each call uses a single thread in
> the client side. The threads will run out soon when the coprocessor
> invocations are heavy.
> In this design, all the calls to the same region server will be grouped into
> one in a single coprocessor invocation. This call will be spread into each
> region in the server side, and the results will be merged ahead in the server
> side before being returned to the client.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)