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

Jonathan Hsieh commented on HBASE-9142:
---------------------------------------

First -- I think life is easier in you should probably create a new hbase95 
sink. :) -- this is a case where 0.94 didn't specify external visibility 
explictly yet and we didn't preserve compat.

I added a method back and named the new method as getFamilyCellMap.  Along the 
way, I went down the rathole of removing what I believe is a java collection of 
generics anti-pattern along the way.  (which if it ends up being clean, we 
should get in to 0.95 before the api freezes).  This may have been intentional 
by my gut says it should be removed.

Specifically it seems that defining this method with List<? extends Cell> where 
List<Cell> is sufficient has caused superfluous casts and extra types to 
percolated throughout the code.  Having gone through -client, -common, and 
-server, none of the uses of the List instances require methods in Cell's 
implementor KeyValue that aren't in the Cell interface.  A List<Cell> can hold 
KeyValue instances doesn't need have a List<KeyValue> type.  Since the maps is 
essentially exposed and can be used for read/write access, it should be the 
collection element typed should be typed invariantly. See [1] for short primer 
and examples. 

[1] 
http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)

                
> Mutation#getFamilyMap() return type change between HBase 94 and 96 breaks 
> downstream apps
> -----------------------------------------------------------------------------------------
>
>                 Key: HBASE-9142
>                 URL: https://issues.apache.org/jira/browse/HBASE-9142
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Hari Shreedharan
>            Assignee: Jonathan Hsieh
>            Priority: Critical
>             Fix For: 0.95.2
>
>
> In Hbase-94, Mutation#getFamilyMap() had signature:
> public Map<byte[],List<KeyValue>> getFamilyMap()
> In Hbase-96 it is:
> public NavigableMap<byte[],List<? extends Cell>> getFamilyMap()
> I understand this might not be an easy fix or even a possible one - but it 
> breaks downstream apps in a nasty way. If the app needs to process the 
> individual columns, then the whole logic is now different. Is there a way to 
> work around this, if this cannot be fixed?

--
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