MAPREDUCE服务 MRS-创建Connection:代码样例

时间:2024-06-19 14:14:15

代码样例

以下代码片段是创建Connection的示例:

private TableName tableName = null;
private Configuration conf = null;
private Connection conn = null;
public static final String TABLE_NAME = "hbase_sample_table";

public HBaseExample(Configuration conf) throws IOException {
  this.conf = conf;
  this.tableName = TableName.valueOf(TABLE_NAME);
  this.conn = ConnectionFactory.createConnection(conf);
}
support.huaweicloud.com/devg-mrs/mrs_06_0017.html