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

James Taylor commented on OMID-110:
-----------------------------------

Yes, agreed. But to minimize code duplication, create abstract classes outside 
the shim layer that has all the code that works across HBase versions (i.e.the 
Omid logic). For an example, see Tephra's AbstractTransaction classes. We 
wouldn't want to have to copy/paste the entire snapshot filter implementation. 
I've attached a WIP patch that adds the hbase-2 shim module (probably similar 
to the path you're on?).

> Create an hbase-2 profile to support HBase 2.0 release
> ------------------------------------------------------
>
>                 Key: OMID-110
>                 URL: https://issues.apache.org/jira/browse/OMID-110
>             Project: Apache Omid
>          Issue Type: Improvement
>            Reporter: James Taylor
>            Assignee: Yonatan Gottesman
>            Priority: Major
>         Attachments: OMID-110_wip1.patch
>
>
> Once OMID-107 is committed (which replaced all deprecated methods), the only 
> things I've identified that need to change are:
>  * Instantiation of CellComparator should be done through HBaseShims since 
> it's different between HBase 1.x and 2.x. In HBase 2.0, CellComparator was 
> changed to an interface. Another alternative would be to write our own 
> CellComparator.
> {code:java}
> public static SortedMap<Cell, Optional<Cell>> 
> mapCellsToShadowCells(List<Cell> cells) {
> // Move CellComparator to HBaseSims for 2.0 support
> // Need to access through CellComparatorImpl.COMPARATOR
> SortedMap<Cell, Optional<Cell>> cellToShadowCellMap
> = new TreeMap<Cell, Optional<Cell>>(new CellComparator());{code}
> The HBase 2.0 version would use CellComparatorImpl.COMPARATOR instead of 
> instantiating a CellComparator.
>  * Add createTable method to HBaseShims. Instead of HTableDescriptor, HBase 
> 2.0 uses TableDescriptor and TableDescriptorBuilder. 
> [~chrajeshbab...@gmail.com] and [~an...@apache.org] - do you know why 
> existing admin.createTable(HTableDescriptor) wouldn't work? HTableDescriptor 
> implements TableDescriptor.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to