hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "binlijin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-5856) byte <-> String is not consistent between HBaseAdmin and HRegionInfo
Date Mon, 23 Apr 2012 10:07:35 GMT

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

binlijin commented on HBASE-5856:
---------------------------------

for example, one region's information HRegionInfo is :
regionNameStr:  testsplit,\x00\x00\x00\x00\x00\x00\x00\x00,1335169851181.79d80fbc6c4f6cfc2cdca8a5310b7223.

regionName : 
 [116, 101, 115, 116, 115, 112, 108, 105, 116, 44, 0, 0, 0, 0, 0, 0, 0, 0, 44, 49, 51, 51,
53, 49, 54, 57, 56, 53, 49, 49, 56, 49, 46, 55, 57, 100, 56, 48, 102, 98, 99, 54, 99, 52,
102, 54, 99, 102, 99, 50, 99, 100, 99, 97, 56, 97, 53, 51, 49, 48, 98, 55, 50, 50, 51, 46]


if we use HBaseAdmin.split(regionName), this is correct, but if we use HBaseAdmin.split(regionNameStr);
this is wrong.
Because Bytes.toBytes(regionNameStr) will get byte : [116, 101, 115, 116, 115, 112, 108, 105,
116, 44, 92, 120, 48, 48, 92, 120, 48, 48, 92, 120, 48, 48, 92, 120, 48, 48, 92, 120, 48,
48, 92, 120, 48, 48, 92, 120, 48, 48, 92, 120, 48, 48, 44, 49, 51, 51, 53, 49, 54, 57, 56,
53, 49, 49, 56, 49, 46, 55, 57, 100, 56, 48, 102, 98, 99, 54, 99, 52, 102, 54, 99, 102, 99,
50, 99, 100, 99, 97, 56, 97, 53, 51, 49, 48, 98, 55, 50, 50, 51, 46], this will get a TableNotFoundException
in 0.92
                
> byte <-> String is not consistent between HBaseAdmin and HRegionInfo
> --------------------------------------------------------------------
>
>                 Key: HBASE-5856
>                 URL: https://issues.apache.org/jira/browse/HBASE-5856
>             Project: HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.90.6, 0.92.1
>            Reporter: binlijin
>
> In HBaseAdmin 
>   public void split(final String tableNameOrRegionName)
>   throws IOException, InterruptedException {
>     split(Bytes.toBytes(tableNameOrRegionName));  // string -> byte 
>   }
> In HRegionInfo
>   this.regionNameStr = Bytes.toStringBinary(this.regionName);  // byte -> string
> Should we use Bytes.toBytesBinary in HBaseAdmin ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message