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

Devaraj Das commented on HBASE-6785:
------------------------------------

[~stack] IMO we need to serialize the ColumnInterpreter data to keep semantic 
compatibility. The ColumnInterpreter today implements the Writable interface, 
and it gets serialized as part of the AggregateProtocol coprocessor invocation. 
So in the PB world, my aim was to maintain this compatibility although the user 
should use PB instead for the serialization... 
Am I missing something?

What I have done now is that ColumnInterpreter has a couple of interface 
methods that users need to implement (and maybe for interpreters like 
_LongColumnInterpreter_ the methods could trivially return the passed argument 
or return null in some cases):

{noformat}
  /**
   * This method should implement the conversion of the columninterpreter 
   * to a PB message (used on the client side)
   */
  AggregateProtos.ColumnInterpreter convertToColumnInterpreterMessage();
  
  /**
   * This method should implement the conversion of a PB message to the 
   * ColumnInterpreter class (used on the server side)
   */
  ColumnInterpreter<T,S> getInstance(AggregateProtos.ColumnInterpreter message);
  
  /**
   * Converts the bytes in the server's response to the expected type S
   */
  S parseResponseAsReturnType(AggregateProtos.AggregateResponse 
responseMessage);
  
  /**
   * The response message comes as type S. This will convert/cast it to T.
   * In some sense, performs the opposite of {@link #castToReturnType(Object)}
   */
  T castToLowerType(S response);
{noformat}

The AggregationClient APIs will remain mostly the same (the implementation of 
the AggregationClient APIs will use the above new ColumnInterpreter APIs in 
addition to what it uses already).

I'll post a patch sometime soon that does the end-to-end stuff, but yeah please 
let me know if this seems off the track. 
                
> Convert AggregateProtocol to protobuf defined coprocessor service
> -----------------------------------------------------------------
>
>                 Key: HBASE-6785
>                 URL: https://issues.apache.org/jira/browse/HBASE-6785
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Coprocessors
>            Reporter: Gary Helmling
>            Assignee: Devaraj Das
>             Fix For: 0.96.0
>
>         Attachments: Aggregate.proto
>
>
> With coprocessor endpoints now exposed as protobuf defined services, we 
> should convert over all of our built-in endpoints to PB services.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to