[
https://issues.apache.org/jira/browse/HBASE-7405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13538568#comment-13538568
]
Gary Helmling commented on HBASE-7405:
--------------------------------------
So the change of ColumnInterpreter from interface to abstract class is so that
you can do the ParameterizedType.getActualTypeArguments() stuff? Makes sense
to me. I was trying to figure out if you could avoid the
AggregateImplementation.constructorColumnInterpreterFromRequest() reflection by
using something like Message.getDefaultInstance(), but you'd just wind up doing
the reflection in another place. Doing the parseFrom as you currently do seems
just as valid. Would it make sense to bundle up the reflection bits in a
ProtobufUtil method though?
The ColumnInterpreter defined interface still makes my head hurt a bit, and the
additional types in the definition are ugly, but I think it's still a win that
anyone wanting to implement this can deal with Message types and the
serialization is done transparently.
These four methods in ColumnInterpreter do leave me feeling like they're two
copies of the same interface:
{code:java}
/**
* This method gets the PB message corresponding to the cell type
* @param t
* @return the PB message for the cell-type instance
*/
public abstract Q getProtoForCellType(T t);
/**
* This method gets the PB message corresponding to the cell type
* @param q
* @return the cell-type instance from the PB message
*/
public abstract T getCellValueFromProto(Q q);
/**
* This method gets the PB message corresponding to the promoted type
* @param s
* @return the PB message for the promoted-type instance
*/
public abstract R getProtoForPromotedType(S s);
/**
* This method gets the promoted type from the proto message
* @param r
* @return the promoted-type instance from the PB message
*/
public abstract S getPromotedValueFromProto(R r);
{code}
I'm trying to figure out if extracting that actually simplifies things though.
Let me play with that aspect a bit tonight and see if I come up with anything
useful.
> Enforce PB ser/de for Aggregate protocol and associated ColumnInterpreter
> user code bits
> ----------------------------------------------------------------------------------------
>
> Key: HBASE-7405
> URL: https://issues.apache.org/jira/browse/HBASE-7405
> Project: HBase
> Issue Type: Sub-task
> Components: Coprocessors, Protobufs
> Reporter: Devaraj Das
> Assignee: Devaraj Das
> Fix For: 0.96.0
>
> Attachments: 7405-1.patch, 7405-2.patch, 7405-3.patch
>
>
> Enforce PB ser/de for Aggregate protocol and associated ColumnInterpreter
> user code bits
--
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