18.2. Using the Redis Data Store Programmatically¶
18.2.1. Creating a Data Store¶
An instance of a Redis 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("redis.url", "redis://localhost:6379");
parameters.put("redis.catalog", "geomesa");
org.geotools.api.data.DataStore dataStore =
org.geotools.api.data.DataStoreFinder.getDataStore(parameters);
18.2.2. Redis Data Store Parameters¶
The data store takes several parameters (required parameters are marked with *
):
Parameter |
Type |
Description |
---|---|---|
|
String |
Redis connection URL. The URL can be used to specify the Redis database and credentials, if required - for example, ‘redis://user:pass@host:port/db’ |
|
String |
The name of the GeoMesa catalog table. In Redis, this is the base key used for inserts |
|
Integer |
Max number of simultaneous connections to use |
|
Boolean |
Test connections when borrowed from the pool. Connections may be closed due to inactivity, which would cause a transient error if validation is disabled |
|
String |
Timeout for socket connections to Redis. The timeout is specified as a duration,
e.g. |
|
Boolean |
Enable pipelining of query requests. This reduces network latency, but restricts queries to a single execution thread |
|
Integer |
The number of threads to use per query (if not pipelining) |
|
String |
The max time a query will be allowed to run before being killed. The
timeout is specified as a duration, e.g. |
|
Boolean |
Toggle collection of statistics for newly created feature types |
|
Boolean |
Audit queries being run. Queries will be written to a log file |
|
Boolean |
Use loose bounding boxes - queries will be faster but may return extraneous results |
|
String |
Comma-delimited superset of authorizations that will be used for queries |
|
Boolean |
Forces authorizations to be empty |
|
Boolean |
For partitioned schemas, execute scans in parallel instead of sequentially |
More information on using GeoTools can be found in the GeoTools user guide.