Example usage for org.apache.cassandra.config ParameterizedClass ParameterizedClass

List of usage examples for org.apache.cassandra.config ParameterizedClass ParameterizedClass

Introduction

In this page you can find the example usage for org.apache.cassandra.config ParameterizedClass ParameterizedClass.

Prototype

public ParameterizedClass(String class_name, Map<String, String> parameters) 

Source Link

Usage

From source file:com.meteogroup.cassandra.embedded.EmbeddedConfig.java

License:Open Source License

public EmbeddedConfig() {
    try {//from   www .  ja va2 s .co  m
        datadir = createTempDirectory("cassandra");
    } catch (IOException e) {
        throw new RuntimeException(e);
    }

    memtable_allocation_type = heap_buffers;
    commitlog_sync = batch;
    commitlog_sync_batch_window_in_ms = 1.0;
    commitlog_directory = datadir.resolve("commitlog").toString();
    hints_directory = datadir.resolve("hints").toString();
    partitioner = ByteOrderedPartitioner.class.getCanonicalName();
    listen_address = "127.0.0.1";
    start_native_transport = true;
    saved_caches_directory = datadir.resolve("saved_caches").toString();
    data_file_directories = new String[] { datadir.toString() };
    seed_provider = new ParameterizedClass(SimpleSeedProvider.class.getCanonicalName(),
            Collections.singletonMap("seeds", "127.0.0.1"));
    endpoint_snitch = SimpleSnitch.class.getCanonicalName();
    dynamic_snitch = true;
    request_scheduler = RoundRobinScheduler.class.getCanonicalName();
    request_scheduler_id = RequestSchedulerId.keyspace;
    incremental_backups = true;
    concurrent_compactors = 4;
    row_cache_class_name = "org.apache.cassandra.cache.OHCProvider";
    row_cache_size_in_mb = 64;
    enable_user_defined_functions = true;
    enable_scripted_user_defined_functions = true;
}

From source file:org.meteogroup.cassandra.embedded.EmbeddedConfig.java

License:Open Source License

public EmbeddedConfig() {
    try {/* w  ww .java  2 s.c  om*/
        datadir = createTempDirectory("cassandra");
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    setupFreePorts();
    memtable_allocation_type = heap_buffers;
    commitlog_sync = batch;
    commitlog_sync_batch_window_in_ms = 1.0;
    commitlog_directory = datadir.resolve("commitlog").toString();
    hints_directory = datadir.resolve("hints").toString();
    partitioner = ByteOrderedPartitioner.class.getCanonicalName();
    listen_address = "127.0.0.1";
    start_native_transport = true;
    saved_caches_directory = datadir.resolve("saved_caches").toString();
    data_file_directories = new String[] { datadir.toString() };
    cdc_raw_directory = datadir.toString();
    seed_provider = new ParameterizedClass(SimpleSeedProvider.class.getCanonicalName(),
            Collections.singletonMap("seeds", "127.0.0.1"));
    endpoint_snitch = SimpleSnitch.class.getCanonicalName();
    dynamic_snitch = true;
    request_scheduler = RoundRobinScheduler.class.getCanonicalName();
    request_scheduler_id = RequestSchedulerId.keyspace;
    incremental_backups = true;
    concurrent_compactors = 4;
    row_cache_class_name = "org.apache.cassandra.cache.OHCProvider";
    row_cache_size_in_mb = 64;
    enable_user_defined_functions = true;
    enable_scripted_user_defined_functions = true;
}