You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Ben West (Created) (JIRA)" <ji...@apache.org> on 2012/03/19 19:53:48 UTC

[jira] [Created] (HBASE-5600) Make Endpoint Coprocessors Available from Thrift

Make Endpoint Coprocessors Available from Thrift
------------------------------------------------

                 Key: HBASE-5600
                 URL: https://issues.apache.org/jira/browse/HBASE-5600
             Project: HBase
          Issue Type: Improvement
          Components: thrift
            Reporter: Ben West
            Priority: Minor


Currently, the only way to access an endpoint coprocessor via thrift is to modify the schema and Thrift server for every coprocessor function. This is annoying. It should be possible to use your coprocessors without having to mangle HBase core code (since that's the point of coprocessors).


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-5600) Make Endpoint Coprocessors Available from Thrift

Posted by "Ben West (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-5600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13232813#comment-13232813 ] 

Ben West commented on HBASE-5600:
---------------------------------

I'm not entirely sure how to accomplish this in full generality. The most obvious methods would involve sending java code through thrift, which is probably a no-go. However, here is one simple coprocessor which I have that it seems could be handled:

{code}
Batch.Call call = Batch.forMethod(IMyEndpoint.class, "getRow", rowKey.getBytes());
Map<byte[], byte[]> results = table.coprocessorExec(IMyEndpoint.class, null, null, call);
{code}

We could create a thrift method to take the name of the class, method, and an array of params and then call coprocessorExec. If this sounds reasonable, I can try to allocate some time for a patch.

Alternatively, we could just require that you write a client for your endpoints, and then thrift calls the client.
                
> Make Endpoint Coprocessors Available from Thrift
> ------------------------------------------------
>
>                 Key: HBASE-5600
>                 URL: https://issues.apache.org/jira/browse/HBASE-5600
>             Project: HBase
>          Issue Type: Improvement
>          Components: thrift
>            Reporter: Ben West
>            Priority: Minor
>              Labels: thrift
>
> Currently, the only way to access an endpoint coprocessor via thrift is to modify the schema and Thrift server for every coprocessor function. This is annoying. It should be possible to use your coprocessors without having to mangle HBase core code (since that's the point of coprocessors).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-5600) Make Endpoint Coprocessors Available from Thrift

Posted by "Andrew Purtell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-5600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13233058#comment-13233058 ] 

Andrew Purtell commented on HBASE-5600:
---------------------------------------

bq. We could create a thrift method to take the name of the class, method, and an array of params and then call coprocessorExec. 

This sounds like a reasonable short term thing to do.

For now with the dynamic behaviors of the current HRPC based stack we can mostly get away with using the same Java client tools for flexible remote method invocation of Endpoints as with the core interfaces. In the future the fact every Endpoint is really its own little protocol may be more exposed. In this world, the interface passes a blob. Such blobs could recursively contain protobuf (or Thrift) encoding.

If going forward we will support Thrift and protobuf ("new RPC") clients both, then maybe we can expect server side code will translate from Thrift and protobuf message representations to some common representation, POJO or whatever. In other words, rehydrate from message representation into real classes (via reflection?) At least for Java, protobufs documentation recommends the objects built by the protobuf unmarshaller not be used directly as application classes. I think Thrift has the same practice. So on the server side that might not be so bad.

On the client side, given the static nature of Thrift and protobuf message schemas (compiled from IDL) we can't dynamically create messages, so there's no way to hide behind for example a remote invocation proxy or some message builder. It could be different if we used Avro or some other option which can create message schemas at runtime and use those dynamically generated schemas server side.
                
> Make Endpoint Coprocessors Available from Thrift
> ------------------------------------------------
>
>                 Key: HBASE-5600
>                 URL: https://issues.apache.org/jira/browse/HBASE-5600
>             Project: HBase
>          Issue Type: Improvement
>          Components: thrift
>            Reporter: Ben West
>            Priority: Minor
>              Labels: thrift
>
> Currently, the only way to access an endpoint coprocessor via thrift is to modify the schema and Thrift server for every coprocessor function. This is annoying. It should be possible to use your coprocessors without having to mangle HBase core code (since that's the point of coprocessors).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira