|
22 | 22 | import org.apache.hadoop.conf.Configuration; |
23 | 23 | import org.apache.hadoop.hbase.Cell; |
24 | 24 | import org.apache.hadoop.hbase.CellUtil; |
| 25 | +import org.apache.hadoop.hbase.HConstants; |
25 | 26 | import org.apache.hadoop.hbase.TableName; |
26 | 27 | import org.apache.hadoop.hbase.client.*; |
27 | 28 | import org.apache.hadoop.hbase.util.Bytes; |
|
30 | 31 |
|
31 | 32 | import java.io.IOException; |
32 | 33 | import java.util.ArrayList; |
| 34 | +import java.util.Arrays; |
33 | 35 | import java.util.List; |
34 | 36 | import java.util.Optional; |
35 | 37 | import java.util.concurrent.*; |
@@ -990,6 +992,21 @@ public void testRangePartitionWithRegionLocator() throws Exception { |
990 | 992 | }); |
991 | 993 | } |
992 | 994 | } |
| 995 | + @Test |
| 996 | + public void testKeyPartitionWithRegionLocator() throws IOException { |
| 997 | + final String tableNameStr = "test_multi_cf"; |
| 998 | + final TableName tableName = TableName.valueOf(tableNameStr); |
| 999 | + final Configuration conf = ObHTableTestUtil.newConfiguration(); |
| 1000 | + connection = ConnectionFactory.createConnection(conf); |
| 1001 | + hTable = connection.getTable(tableName); |
| 1002 | + RegionLocator locator = connection.getRegionLocator(tableName); |
| 1003 | + byte[][] startKeys = locator.getStartKeys(); |
| 1004 | + byte[][] endKeys = locator.getEndKeys(); |
| 1005 | + Assert.assertEquals("Should have 1 region", 1, startKeys.length); |
| 1006 | + Assert.assertEquals("Should have 1 region", 1, endKeys.length); |
| 1007 | + Assert.assertEquals(startKeys[0], endKeys[0]); |
| 1008 | + Assert.assertEquals(startKeys[0], HConstants.EMPTY_BYTE_ARRAY); |
| 1009 | + } |
993 | 1010 |
|
994 | 1011 | @Test |
995 | 1012 | public void testBufferedMutatorPeriodicFlush() throws Exception { |
|
0 commit comments