hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hsieh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-4371) When scanning .META., STARTROW with only table name ignores table.
Date Sun, 11 Sep 2011 21:40:08 GMT

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

Jonathan Hsieh commented on HBASE-4371:
---------------------------------------

Repost to show formatted code.
{code}
  public void testMetaComparatorTableOnlyOk() {
    MetaComparator c = new KeyValue.MetaComparator();
    long now = System.currentTimeMillis();
    // A user can enter arbitrary values from shell when scanning meta.
    KeyValue a = new KeyValue(Bytes.toBytes("table1"), now);
    KeyValue b = new KeyValue(Bytes.toBytes("table2"), now);
    // This seems wrong.
    assertTrue(c.compare(a, b) == 0);
  }
{code}

> When scanning .META.,  STARTROW with only table name ignores table.
> -------------------------------------------------------------------
>
>                 Key: HBASE-4371
>                 URL: https://issues.apache.org/jira/browse/HBASE-4371
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Jonathan Hsieh
>
> When writing unit tests for HBASE-4325, I noticed this:
> create 'table0', 'f1','f2'
> create 'table1', 'f1','f2'
> create 'table2', 'f1','f2'
> scan '.META.', { STARTROW=> 'table2' }
> Which outputs table1 which is < table2.
> hbase(main):007:0> scan '.META.', { STARTROW => 'table2' }
> ROW                                                          COLUMN+CELL            
                                                                                         
                                                             
>  table0,,1315776873140.ddc11620ad6d62eb6840853ecca46f39.     column=info:regioninfo,
timestamp=1315776873202, value=REGION => {NAME => 'table0,,1315776873140.ddc11620ad6d62eb6840853ecca46f39.',
TableName => 'table0', STARTKEY => '', END
>                                                              KEY => '', ENCODED =>
ddc11620ad6d62eb6840853ecca46f39,}                                                       
                                                               
>  table0,,1315776873140.ddc11620ad6d62eb6840853ecca46f39.     column=info:server, timestamp=1315776873233,
value=grimlock:44226                                                                     
                                        
>  table0,,1315776873140.ddc11620ad6d62eb6840853ecca46f39.     column=info:serverstartcode,
timestamp=1315776873233, value=1315776026457                                             
                                                        
>  table1,,1315776052776.dfbfdd038b1e42d38eff46e8282a15e5.     column=info:regioninfo,
timestamp=1315776052829, value=REGION => {NAME => 'table1,,1315776052776.dfbfdd038b1e42d38eff46e8282a15e5.',
TableName => 'table1', STARTKEY => '', END
>                                                              KEY => '', ENCODED =>
dfbfdd038b1e42d38eff46e8282a15e5,}                                                       
                                                               
>  table1,,1315776052776.dfbfdd038b1e42d38eff46e8282a15e5.     column=info:server, timestamp=1315776052871,
value=grimlock:44226                                                                     
                                        
>  table1,,1315776052776.dfbfdd038b1e42d38eff46e8282a15e5.     column=info:serverstartcode,
timestamp=1315776052871, value=1315776026457                                             
                                                        
>  table2,,1315776057157.5c6df57acb426b02660315e97bff80ff.     column=info:regioninfo,
timestamp=1315776057207, value=REGION => {NAME => 'table2,,1315776057157.5c6df57acb426b02660315e97bff80ff.',
TableName => 'table2', STARTKEY => '', END
>                                                              KEY => '', ENCODED =>
5c6df57acb426b02660315e97bff80ff,}                                                       
                                                               
>  table2,,1315776057157.5c6df57acb426b02660315e97bff80ff.     column=info:server, timestamp=1315776057232,
value=grimlock:44226                                                                     
                                        
>  table2,,1315776057157.5c6df57acb426b02660315e97bff80ff.     column=info:serverstartcode,
timestamp=1315776057232, value=1315776026457                                             
                                                        
> 3 row(s) in 0.0370 seconds

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message