Original address: Https://cloud.google.com/bigtable/docs/using-maven
This article uses Google translation.
Cloud BigTable for Java hbase clients are available in the Maven repository, making it easy to use Cloud BigTable in the Apache Maven project.
maven Artifacts Overview
Cloud Bigtable Java client includes three Maven artifacts that you can use in your project:
bigtable-hbase-1.0: Client based on HBase 1.0.x.
bigtable-hbase-1.1: Client based on HBase 1.1.x.
bigtable-hbase-1.2: Client based on HBase 1.2.x.
Bigtable-hbase-mapreduce: The MapReduce job used to import data into cloud bigtable.
Each artifact tracks different versions of the HBase API. The remainder of these instructions assumes that you are using bigtable-hbase-1.2.
Note: The MAVEN repository includes other artifacts of the cloud bigtable. Do not use these additional artifacts in your application.
You must also add the appropriate artifacts to support the encryption of the data. For more information, see "Setting up encryption."
Add a cloud bigtable artifact to a project
To add a cloud bigtable artifact to the MAVEN project, you simply add the artifact to the <dependencies> part of the Pom.xml file and to the artifacts of the HBase client.
To add the required artifacts:
<dependencies>
<groupId> com.google.cloud.bigtable </groupid>
<artifactId> bigtable-hbase-1.2 </artifactid>
<version> 0.9.4 </
version> </dependency> <dependencies>
<groupId> org.apache.hbase </groupid>
<artifactId> hbase-client </artifactid>
<version> 1.2.1 </version> </dependency>
Set Encryption
To encrypt the data, the Netty-tcnative library is used by Cloud Bigtable hbase clients. To simplify installation, you should use a static link to a network artifact of Boringssl (a branch of OpenSSL). This workpiece is called netty-tcnative-boringssl-static.
To use netty-tcnative-boringssl-static, your system must meet the following requirements:
Netty-tcnative-boringssl-static 1.1.33.fork19 must be on the Java class path. (Other versions are incompatible with the cloud Bigtable hbase client.) The following example shows how to add this dependency to the Pom.xml file. You must use Linux,os x or Windows on the x86 64-bit processor.
To add the required artifacts to the Pom.xml file:
<dependencies>
<groupId> io.netty </groupid>
<artifactId> Netty-tcnative-boringssl-static </artifactid>
<version> 1.1.33.fork19 </version>
</ Dependency>