Implementing Custom RowKeys
Scenario
Implement custom RowKeys. You can compile RowKey implementation code and import combined RowKeys based on the code logic.
Configuration Method
- When you compile the implementation class of a custom RowKey, inherit the interface. The JAR file path of the interface is Client installation directory/HBase/hbase/lib/hbase-it-bulk-load-*.jar.
[com.huawei.hadoop.hbase.tools.bulkload.RowkeyHandlerInterface]
Interface implementation method:
byte[] getRowkeyBytes(String[] colsValues, RegulationDomain regulation)
Where
- colsValues indicates a collection of one original data row. Each element is a column.
- regulation indicates information about the configuration file to be imported. (Typically, this parameter is not used.)
- Compress the implementation class and its dependent package into a JAR file, save the file to any location on the node where the HBase client resides, and ensure that the user who executes the command has the permission to read and execute the JAR file.
- When you run the import command, add the following two configuration items:
-Dimport.rowkey.jar=Full path of the JAR file in step 2
-Dimport.rowkey.class=Full class name of the user implementation class
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.