All Products
Search
Document Center

ApsaraDB for HBase:Connect to HBase Ganos

Last Updated:Sep 02, 2022

The ApsaraDB for HBase Ganos (HBase Ganos) API calls the GeoTools API to interact with ApsaraDB for HBase databases. The data access module in HBase Ganos is created based on the DataStore class in GeoTools. You can use the following method to create a DataStore: DataAccess<SimpleFeatureType,SimpleFeature>. SimpleFeature specifies a vector feature model managed by GeoTools. Each point, line, or polygon can be defined as a SimpleFeature object. The schema of a SimpleFeature object is defined by SimpleFeatureType.

For more information about how to define and use DataStore operations, see GeoTools documentation.

The following table describes the parameters that are used to create an HBase DataStore instance. Parameters marked with an asterisk (*) are required parameters.

Parameter

Type

Description

hbase.catalog *

String

The name of the GeoMesa catalog table.

hbase.zookeepers*

String

The ZooKeeper endpoints. Separate multiple ZooKeeper endpoints with commas (,).

geomesa.query.timeout

String

The validity period of each query.

geomesa.query.threads

Integer

The number of threads that are used to process each query.

You can call the getDataStore method of DataStoreFinder to access a DataStore object. The following code provides an example:

//Configure connection parameters.
Map<String, String> params= new HashMap<>();
params.put("hbase.zookeepers","localhost");
params.put("hbase.catalog","catalog_name");

//Create a DataStore object.
DataStore ds=DataStoreFactory.getDataStore(params);

You can then use the HBase DataStore instance that you created to interact with HBase Ganos. HBase DataStore is a child class of DataStore.