yanghua commented on code in PR #5797:
URL: https://github.com/apache/hudi/pull/5797#discussion_r929508652


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/hbase/SparkHoodieHBaseIndex.java:
##########
@@ -205,14 +205,18 @@ public void close() {
   }
 
   private Get generateStatement(String key) throws IOException {
-    return new 
Get(Bytes.toBytes(key)).setMaxVersions(1).addColumn(SYSTEM_COLUMN_FAMILY, 
COMMIT_TS_COLUMN)
+    return new 
Get(Bytes.toBytes(transformToHbaseKey(key))).setMaxVersions(1).addColumn(SYSTEM_COLUMN_FAMILY,
 COMMIT_TS_COLUMN)
         .addColumn(SYSTEM_COLUMN_FAMILY, 
FILE_NAME_COLUMN).addColumn(SYSTEM_COLUMN_FAMILY, PARTITION_PATH_COLUMN);
   }
 
   private Get generateStatement(String key, long startTime, long endTime) 
throws IOException {
     return generateStatement(key).setTimeRange(startTime, endTime);
   }
 
+  protected String transformToHbaseKey(String key) {

Review Comment:
   ditto



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/hbase/BalanceSparkHoodieHBaseIndex.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.index.hbase;
+
+import org.apache.hudi.config.HoodieWriteConfig;
+
+/**
+ * Extends SparkHoodieHbaseIndex, add random prefix to key for avoiding data 
skew issue in hbase regions
+ */
+public class BalanceSparkHoodieHBaseIndex extends SparkHoodieHBaseIndex  {

Review Comment:
   WDYT renaming to `RebalancedSparkHoodieHBaseIndex`? 



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/hbase/BalanceSparkHoodieHBaseIndex.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.index.hbase;
+
+import org.apache.hudi.config.HoodieWriteConfig;
+
+/**
+ * Extends SparkHoodieHbaseIndex, add random prefix to key for avoiding data 
skew issue in hbase regions

Review Comment:
   Add `{@link SparkHoodieHbaseIndex}`. And add `.` at the end of this line.



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/hbase/BalanceSparkHoodieHBaseIndex.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.index.hbase;
+
+import org.apache.hudi.config.HoodieWriteConfig;
+
+/**
+ * Extends SparkHoodieHbaseIndex, add random prefix to key for avoiding data 
skew issue in hbase regions
+ */
+public class BalanceSparkHoodieHBaseIndex extends SparkHoodieHBaseIndex  {
+
+  public BalanceSparkHoodieHBaseIndex(HoodieWriteConfig config) {
+    super(config);
+  }
+
+  @Override
+  protected String transformToHbaseKey(String originalKey) {

Review Comment:
   what about `getHBaseKey`?



-- 
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