15.2. 以编程方式使用Acumulo数据存储

15.2.1. 创建数据存储

假设GeoMesa代码位于类路径上,则可以通过常规的GeoTools发现方法获取Acumulo数据存储的实例:

import org.geotools.data.*;

Map<String, String> parameters = new HashMap<>;
parameters.put("accumulo.instance.name", "myInstance");
parameters.put("accumulo.zookeepers", "myZoo1,myZoo2,myZoo3");
parameters.put("accumulo.user", "myUser");
parameters.put("accumulo.password", "myPassword");
parameters.put("accumulo.catalog", "myNamespace.myTable");
DataStore dataStore = DataStoreFinder.getDataStore(parameters);

不是显式指定集群连接,而是使用适当的 accumulo-client.properties 可以添加到类路径中。请参阅 Accumulo documentation 有关必要的配置密钥的信息。任何显式数据存储参数将优先于配置文件。

有关使用GeoTool的更多信息,请参阅 GeoTools user guide

15.2.2. 累积数据存储参数

Acumulo Data Store采用多个参数(必需的参数用标记 * ):

参数

类型

描述

accumulo.catalog *

细绳

GeoMesa目录表的名称,包括Acumulo命名空间(例如“myNamespace.myCatalog”)

accumulo.instance.name

细绳

Acumulo实例的名称

accumulo.zookeepers

细绳

以逗号分隔的ZooKeeper服务器列表(例如“zoo1、zoo2、zoo3”或“localhost:2181”)

accumulo.user

细绳

用于连接到Acumulo的用户名

accumulo.password

细绳

Acumulo用户的密码

accumulo.keytab.path

细绳

包含指定用户条目的Kerberos密钥表文件的路径

geomesa.security.auths

细绳

将用于通过Acumulo进行查询的以逗号分隔的授权超集

geomesa.security.force-empty-auths

布尔型

强制授权为空

geomesa.security.auth-provider

细绳

类的类名。 AuthorizationsProvider 实施

geomesa.query.audit

布尔型

正在运行的审核查询。查询将存储在 <catalog>_queries 表格

geomesa.query.timeout

细绳

在终止查询之前允许运行的最长时间。超时被指定为持续时间,例如 1 minute60 seconds

geomesa.query.threads

整型

每个查询要使用的线程数

geomesa.query.loose-bounding-box

布尔型

使用松散边界框-查询速度更快,但可能会返回无关的结果

accumulo.query.record-threads

整型

用于记录检索的线程数

accumulo.write.threads

整型

用于写入记录的线程数

geomesa.stats.generate

布尔型

切换新创建的要素类型的统计数据收集

accumulo.remote.arrow.enable

布尔型

将Acumulo Tablet服务器中的Arrow编码作为分布式呼叫进行处理

accumulo.remote.bin.enable

布尔型

将Acumulo Tablet服务器中的二进制编码作为分布式呼叫进行处理

accumulo.remote.density.enable

布尔型

将Acumulo Tablet服务器中的热图编码作为分布式呼叫进行处理

accumulo.remote.stats.enable

布尔型

将Acumulo Tablet服务器中的统计计算作为分布式调用进行处理

geomesa.partition.scan.parallel

布尔型

对于分区架构,并行执行扫描,而不是顺序执行

注意:同时指定两者是错误的 accumulo.passwordaccumulo.keytab.path