Implementing RowKeys in a Customized Manner
Scenario
You can implement RowKeys in a customized manner. You can edit RowKey implementation codes and import the combined RowKeys based on the code logic.
Configuration Method
- When you edit the customized RowKey implementation, the following interface needs to be inherited:
[com.huawei.hadoop.hbase.tools.bulkload.RowkeyHandlerInterface]
Interface implementation method:
byte[] getRowkeyBytes(String[] colsValues, RegulationDomain regulation)
In the preceding command:
- colsValues indicates a collection of one original data row. Each element is a column.
- regulation indicates the configuration of imported file information (This parameter is not used in most cases.).
- Package the implementation class and its dependency packages to a JAR file and save the file anywhere on the HBase client.
- When running the command for importing files, add the following two parameter configuration items:
-Dimport.rowkey.jar="indicates the full path of the JAR package in Step 2".
-Dimport.rowkey.class="indicates the full class name of users implementation class".
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.