Search in sources :

Example 1 with CassandraOptions

use of org.locationtech.geowave.datastore.cassandra.config.CassandraOptions in project geowave by locationtech.

the class CassandraStoreTestEnvironment method initOptions.

@Override
protected void initOptions(final StoreFactoryOptions options) {
    final CassandraRequiredOptions cassandraOpts = (CassandraRequiredOptions) options;
    cassandraOpts.getAdditionalOptions().setReplicationFactor(1);
    cassandraOpts.getAdditionalOptions().setDurableWrites(false);
    cassandraOpts.getAdditionalOptions().setGcGraceSeconds(0);
    try {
        final Map<String, String> tableOptions = new HashMap<>();
        tableOptions.put("compaction", new ObjectMapper().writeValueAsString(SchemaBuilder.sizeTieredCompactionStrategy().withMinSSTableSizeInBytes(500000L).withMinThreshold(2).withUncheckedTombstoneCompaction(true).getOptions()));
        tableOptions.put("gc_grace_seconds", new ObjectMapper().writeValueAsString(0));
        cassandraOpts.getAdditionalOptions().setTableOptions(tableOptions);
    } catch (final JsonProcessingException e) {
        throw new RuntimeException(e);
    }
    cassandraOpts.setContactPoints("127.0.0.1");
    ((CassandraOptions) cassandraOpts.getStoreOptions()).setBatchWriteSize(5);
}
Also used : HashMap(java.util.HashMap) CassandraRequiredOptions(org.locationtech.geowave.datastore.cassandra.config.CassandraRequiredOptions) CassandraOptions(org.locationtech.geowave.datastore.cassandra.config.CassandraOptions) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 HashMap (java.util.HashMap)1 CassandraOptions (org.locationtech.geowave.datastore.cassandra.config.CassandraOptions)1 CassandraRequiredOptions (org.locationtech.geowave.datastore.cassandra.config.CassandraRequiredOptions)1