16.2. Using the Cassandra DataStore Programmatically¶
16.2.1. Creating a Data Store¶
An instance of a Cassandra data store can be obtained through the normal GeoTools discovery methods, assuming that the GeoMesa code is on the classpath.
Map<String, Serializable> parameters = new HashMap<>();
parameters.put("cassandra.contact.point", "127.0.0.1:9142");
parameters.put("cassandra.keyspace", "geomesa");
parameters.put("cassandra.catalog", "mycatalog");
org.geotools.api.data.DataStore dataStore =
org.geotools.api.data.DataStoreFinder.getDataStore(parameters);
16.2.2. Cassandra Data Store Parameters¶
The data store takes several parameters (required parameters are marked with *
):
Parameter |
Type |
Description |
---|---|---|
|
String |
The name of the GeoMesa catalog table (previously |
|
String |
The connection point for Cassandra, in the form |
|
String |
The Cassandra keyspace to use (must exist already) |
|
String |
Cassandra user |
|
String |
Cassandra password |
|
Boolean |
Audit queries being run. Queries will be written to a log file |
|
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 |
|
Boolean |
Toggle collection of statistics (currently not implemented) |
More information on using GeoTools can be found in the GeoTools user guide.