Weichen Ye created HBASE-12716:
----------------------------------

             Summary: A bug in RegionSplitter.UniformSplit algorithm
                 Key: HBASE-12716
                 URL: https://issues.apache.org/jira/browse/HBASE-12716
             Project: HBase
          Issue Type: Bug
          Components: regionserver
    Affects Versions: 0.98.6
            Reporter: Weichen Ye


I`m working for another issues HBASE-12590 and trying to use the UniformSplit 
algorithm in RegionSplitter. When the last bytes of start key and end key are 
adjacent in alphabetical order or ASCII order, the UniformSplit algorithm meet 
an NPE.
Like startkey: aaa, endkey :aab
       startkey:1111 endkey: 1112

For example, we write this simple test code:
import org.apache.hadoop.hbase.util.RegionSplitter.UniformSplit;
                ......
                byte[] a1 = { 'a', 'a', 'a' };
                byte[] a2 = { 'a', 'a', 'b' };
                UniformSplit us = new UniformSplit();
                byte[] mid = us.split(a1, a2);
                for (byte b : mid) {
                        System.out.print(b + "  ");
                }
                System.out.println("\n" + new String(mid));

We will get the ERROR:
Exception in thread "main" java.lang.NullPointerException
        at 
org.apache.hadoop.hbase.util.RegionSplitter$UniformSplit.split(RegionSplitter.java:986)
        at test.ByteMid.main(ByteMid.java:196)








--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to