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

rajeshbabu edited comment on HBASE-10576 at 4/25/14 6:06 AM:
-------------------------------------------------------------

If I understand the [~jeffreyz] idea in the above 
comment(https://issues.apache.org/jira/browse/HBASE-10576?focusedCommentId=13978998&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13978998)
 correctly, 
I think we can do the same without any changes in the kernel.
The steps are like this
1) Before creating index table we need to disable user table.
2) create index table with the same split keys as user table and disable it. So 
next time onwards index regions wont be assigned anymore by AM.(Need not have 
any special state like shadow)
3) Enable user table. While opening user region we can get corresponing index 
region from meta,htd from namenode and just open it with below method
{code}
  public static HRegion openHRegion(final HRegionInfo info,
      final HTableDescriptor htd, final HLog wal,
      final Configuration conf)
  throws IOException {
    return openHRegion(info, htd, wal, conf, null, null);
  }
{code}
After that maintain user region and index region mapping.
4) While scanning if query conditions involves covering indexes we can just 
scan index region in the hooks and skip scanning user region by bypass.
Otherwise get rowkeys from index region and seek to rowkey in the user region 
and get required information.



was (Author: rajesh23):
If I understand the [~jeffreyz] idea in the above 
comment(https://issues.apache.org/jira/browse/HBASE-10576?focusedCommentId=13978998&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13978998)
 correctly, 
I think we can do the same without any changes in the kernel.
The steps are like this
1) Before creating index table we need to disable user table.
2) create index table with the same split keys as user table and disable it. So 
next time onwards index regions wont be assigned anymore by AM.(Need not have 
any special state like shadow)
3) Enable user table. While opening user region we can get corresponing index 
region from meta,htd from namenode and just open it with below method
{code}
  public static HRegion openHRegion(final HRegionInfo info,
      final HTableDescriptor htd, final HLog wal,
      final Configuration conf)
  throws IOException {
    return openHRegion(info, htd, wal, conf, null, null);
  }
{code}
After taht maintain user region and index region mapping.
4) While scanning if query conditions involves covering indexes we can just 
scan index region in the hooks and skip scanning user region through bypass.
Otherwise get rowkeys from index region and seek to rowkey in the user region 
and get required information.


> Custom load balancer to co-locate the regions of two tables which are having 
> same split keys
> --------------------------------------------------------------------------------------------
>
>                 Key: HBASE-10576
>                 URL: https://issues.apache.org/jira/browse/HBASE-10576
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Balancer
>            Reporter: rajeshbabu
>            Assignee: rajeshbabu
>         Attachments: HBASE-10536_v2.patch, HBASE-10576.patch
>
>
> To support local indexing both user table and index table should have same 
> split keys. This issue to provide custom balancer to colocate the regions of 
> two tables which are having same split keys. 
> This helps in Phoenix as well.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to