PsaraDB for HBase Performance-enhanced Edition allows you to use Apache Flink to connect to the database service. You can use HBase tables as dimension tables or result tables in Flink. For more information, see Create an ApsaraDB for HBase result table and Create an ApsaraDB for HBase dimension table.

When you use Data Definition Language (DDL) statements to create an HBase table as the Flink dimension or result table, you must use the endpoint of ApsaraDB for HBase Performance-enhanced Edition.When you use Flink to connect to ApsaraDB for HBase Performance-enhanced Edition, you can use the endpoint used by Java API. Both the default values of the username and password parameters are root. If you use a new account, make sure that the account has read and write permissions on the tables associated with Flink. The following examples show how to use DDL statements to create HBase tables:

     create table liuxd_user_behavior_test_front ( row_key varchar, from_topic varchar, origin_data varchar, record_create_time varchar, primary key (row_key) ) with ( type = 'cloudhbase', endpoint = 'host:port', -- HBase Java API address  userName = 'root', -- username password = 'root', -- password columnFamily = '<yourColumnFamily>', tableName = '<yourTableName>', batchSize = '500' ) 
   

Create an HBase result table


     create table liuxd_user_behavior_test_front ( row_key varchar, from_topic varchar, origin_data varchar, record_create_time varchar, primary key (row_key) ) with ( type = 'cloudhbase', endpoint = 'host:port', -- HBase Java API address userName = 'root', -- username password = 'root', -- password  columnFamily = '<yourColumnFamily>', tableName = '<yourTableName>', batchSize = '500' ) 
   

Network connection

If you use a Flink cluster in shared mode, you must connect to ApsaraDB for HBase over a Virtual Private Cloud (VPC) network. For more information, see Authorize Flink to access the VPC network. If you use a Flink cluster in exclusive mode, make sure that the Flink cluster and the HBase cluster are in the same VPC network. Otherwise, you can only use the public endpoint to connect to ApsaraDB for HBase.