Wellington Chevreuil created HBASE-17461:

             Summary: HBase shell *major_compact* command should properly 
convert *table_or_region_name* parameter to java byte array properly before 
simply calling *HBaseAdmin.majorCompact* method
                 Key: HBASE-17461
                 URL: https://issues.apache.org/jira/browse/HBASE-17461
             Project: HBase
          Issue Type: Bug
          Components: shell
            Reporter: Wellington Chevreuil

On HBase shell, *major_compact* command simply passes the received 
*table_or_region_name* parameter straight to java *HBaseAdmin.majorCompact* 

On some corner cases, HBase tables row keys may have special characters. Then, 
if a region is split in such a way that row keys with special characters are 
now part of the region name, calling *major_compact* on this regions will fail, 
if the special character ASCII code is higher than 127. This happens because 
Java byte type is signed, while ruby byte type isn't, causing the region name 
to be converted to a wrong string at Java side.

For example, considering a region named as below:


Calling major_compat on it fails as follows:

hbase(main):008:0* major_compact 

ERROR: Illegal character code:44, <,> at 4. User-space table qualifiers can 
only contain 'alphanumeric characters': i.e. [a-zA-Z_0-9-.]: test,�B2!$�

An easy solution is to convert *table_or_region_name* parameter properly, prior 
to calling *HBaseAdmin.majorCompact* in the same way as it's already done on 
some other shell commands, such as *get*:

admin.major_compact(table_or_region_name.to_s.to_java_bytes, family)

This message was sent by Atlassian JIRA

Reply via email to