yzeng1618 commented on code in PR #10295:
URL: https://github.com/apache/seatunnel/pull/10295#discussion_r2674519014


##########
seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/source/HbaseSourceSplitEnumerator.java:
##########
@@ -176,59 +187,88 @@ private void assignSplit(int taskId) {
     public Set<HbaseSourceSplit> getTableSplits() {
 
         try {
-            RegionLocator regionLocator = 
hbaseClient.getRegionLocator(hbaseParameters.getTable());
-            byte[][] startKeys = regionLocator.getStartKeys();
-            byte[][] endKeys = regionLocator.getEndKeys();
-            List<HbaseSourceSplit> splits = new ArrayList<>();
-            boolean isBinaryRowkey = hbaseParameters.isBinaryRowkey();
-            byte[] userStartRowkey =
-                    HBaseUtil.convertRowKey(hbaseParameters.getStartRowkey(), 
isBinaryRowkey);
-            byte[] userEndRowkey =
-                    HBaseUtil.convertRowKey(hbaseParameters.getEndRowkey(), 
isBinaryRowkey);
-            HBaseUtil.validateRowKeyRange(userStartRowkey, userEndRowkey);
-
-            int i = 0;
-            while (i < startKeys.length) {
-                byte[] regionStartKey = startKeys[i];
-                byte[] regionEndKey = endKeys[i];
-                if (userEndRowkey.length > 0
-                        && Bytes.compareTo(userEndRowkey, regionStartKey) <= 0
-                        && Bytes.compareTo(regionStartKey, 
HConstants.EMPTY_BYTE_ARRAY) != 0) {
-                    i++;
-                    continue;
-                }
+            String namespace = hbaseParameters.getNamespace();
+            if (namespace == null || namespace.isEmpty()) {

Review Comment:
    Have modified



##########
seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/client/HbaseClient.java:
##########
@@ -392,4 +396,10 @@ public ResultScanner scan(
     public RegionLocator getRegionLocator(String tableName) throws IOException 
{
         return this.connection.getRegionLocator(TableName.valueOf(tableName));
     }
+
+    public RegionLocator getRegionLocator(String namespace, String tableName) 
throws IOException {
+        String actualNamespace =
+                StringUtils.isBlank(namespace) ? 
HbaseParameters.DEFAULT_NAMESPACE : namespace;

Review Comment:
    Have modified



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to