23.3. Using the Lambda Data Store Programmatically¶
23.3.1. Creating a Data Store¶
An instance of a Lambda data store can be obtained through the normal GeoTools discovery methods, assuming that the GeoMesa code is on the classpath:
Map<String, String> parameters = new HashMap<>;
parameters.put("lambda.accumulo.instance.id", "myInstance");
parameters.put("lambda.accumulo.zookeepers", "zoo1,zoo2,zoo3");
parameters.put("lambda.accumulo.user", "myUser");
parameters.put("lambda.accumulo.password", "myPassword");
parameters.put("lambda.accumulo.tableName", "my_table");
parameters.put("lambda.kafka.brokers", "kafka1:9092,kafka2:9092");
parameters.put("lambda.kafka.zookeepers", "zoo1,zoo2,zoo3");
parameters.put("lambda.expiry", "10 minutes");
org.geotools.data.DataStore dataStore = org.geotools.data.DataStoreFinder.getDataStore(parameters);
More information on using GeoTools can be found in the GeoTools user guide.
23.3.2. Lambda Data Store Parameters¶
The data store takes several parameters (required parameters are marked with *
):
Parameter |
Type |
Description |
---|---|---|
|
String |
The instance ID of the Accumulo installation |
|
String |
A comma separated list of zookeeper servers (e.g. “zoo1,zoo2,zoo3” or “localhost:2181”) |
|
String |
The name of the GeoMesa catalog table |
|
String |
Accumulo username |
|
String |
Accumulo password |
|
String |
Path to a Kerberos keytab file containing an entry for the specified user |
|
String |
A comma separated list of kafka brokers (e.g. |
|
String |
A comma separated list of zookeeper servers (e.g. |
|
Integer |
Number of partitions used to create new topics. You should generally set this to the number of writer instances you plan to run |
|
Integer |
Number of consumers used to load data into the in-memory cache |
|
String |
Java-properties-formatted string that is passed directly to the Kafka producer. See Producer Configs |
|
String |
Java-properties-formatted string that is passed directly to the Kafka consumer. See New Consumer Configs |
|
String |
A duration for how long features are kept in memory before being persisted (e.g. |
|
Boolean |
Whether expired features should be persisted to Accumulo or just discarded |
|
String |
Comma-delimited superset of authorizations that will be used for queries via Accumulo |
|
Boolean |
Forces authorizations to be empty |
|
String |
Class name for an |
|
Boolean |
Audit queries being run. Queries will be stored in a |
|
String |
The max time a query will be allowed to run before being killed. The
timeout is specified as a duration, e.g. |
|
Integer |
The number of threads to use per query |
|
Boolean |
Use loose bounding boxes - queries will be faster but may return extraneous results |
|
Integer |
The number of threads to use for record retrieval |
|
Integer |
The number of threads to use for writing records |
|
Boolean |
Toggle collection of statistics for newly created feature types |
|
Boolean |
Toggle caching of results |
Note: one (but not both) of lambda.accumulo.password
and lambda.accumulo.keytab.path
must be provided.