cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Morton <>
Subject Re: Starting up cassandra 0.7
Date Tue, 16 Nov 2010 20:24:51 GMT
I've not used the embedded service. 

The code in o.a.c.service.EmbeddedCassandraService says it will read the yaml file. If the
cluster does not have a schema stored I think it will load the one from yaml. 

Have you tried starting it up with an empty system data dir ? Does it pickup the schema from
the yaml?

On 17 Nov, 2010,at 09:17 AM, CassUser CassUser <> wrote:

Loading yaml file like so:
        FileInputStream yamlInputStream = new FileInputStream(
        Constructor constructor = new Constructor(Config.class);
        Yaml yaml = new Yaml(new Loader(constructor));
        Config conf = (Config) yaml.load(yamlInputStream);

Fails on the last line.

Although if i have the CFs defined like this:
- column_families:
  - !!org.apache.cassandra.config.RawColumnFamily
    column_metadata: []
    column_type: null
    comment: null
    compare_subcolumns_with: null
    compare_with: BytesType
    default_validation_class: null
    gc_grace_seconds: 864000
    keys_cached: 200000.0
    max_compaction_threshold: 32
    min_compaction_threshold: 4
    name: Similarity
    preload_row_cache: false
    read_repair_chance: 1.0
    rows_cached: 0.0

it appears to startup.  Any idea whats going on here?

On Tue, Nov 16, 2010 at 11:58 AM, CassUser CassUser <> wrote:
This is embedded for testing cassandra 0.7 beta2.  using EmbeddedCassandraService.

and manually adding schema programmatically using:
        for (KSMetaData table : DatabaseDescriptor.readTablesFromYaml()) {
            for (CFMetaData cfm : table.cfMetaData().values()) {

Is this the correct way to start up a test server, with the schema loaded?

On Tue, Nov 16, 2010 at 11:41 AM, Aaron Morton <> wrote:
AFAIK the ArrayStoreException is similar to a type mismatch. Is it possible you have something
mixed up in your class path or source code if you built from source? 

It looks like the column family info was deserialised into a o.a.c.config.RawColumnFamily
but when that object was added to the RawColumnFamily[] array on o.a.c.config.RawKeyspace
if was the wrong type. 

Have you tried a clean build ? There are some things in the call stack which look custom,
are you starting from the command line or is this embedded for testing?

Hope that helps.

On 17 Nov, 2010,at 08:09 AM, CassUser CassUser <> wrote:

Here is the yaml:

# Cassandra YAML generated from previous config
# Configuration wiki:
authenticator: org.apache.cassandra.auth.AllowAllAuthenticator
auto_bootstrap: false
binary_memtable_throughput_in_mb: 256
cluster_name: Test Cluster
column_index_size_in_kb: 64
commitlog_rotation_threshold_in_mb: 128
commitlog_sync: periodic
commitlog_sync_period_in_ms: 10000
compaction_thread_priority: 1
concurrent_reads: 8
concurrent_writes: 32
disk_access_mode: auto
dynamic_snitch: false
endpoint_snitch: org.apache.cassandra.locator.SimpleSnitch
request_scheduler: org.apache.cassandra.scheduler.RoundRobinScheduler
request_scheduler_id: keyspace
hinted_handoff_enabled: true
in_memory_compaction_limit_in_mb: 128
index_interval: 128
    - name: myKeyspace
      replica_placement_strategy: orgapache.cassandra.locator.SimpleStrategy

      replication_factor: 1
        - name: Standard1
          rows_cached: 100
          keys_cached: 1
          compare_with: UTF8Type
memtable_flush_after_mins: 60
memtable_operations_in_millions: 0.3
memtable_throughput_in_mb: 64
partitioner: org.apache.cassandra.dht.RandomPartitioner
phi_convict_threshold: 8
rpc_keepalive: true
rpc_port: 9160
rpc_timeout_in_ms: 10000
sliced_buffer_size_in_kb: 64
snapshot_before_compaction: false
storage_port: 7000
thrift_framed_transport_size_in_mb: 15
thrift_max_message_length_in_mb: 16

and here is the exception i'm receiving:

Caused by: Can't construct a java object for,2002:org.apache.cassandra.config.Config;
exception=Cannot create property=keyspaces for Java
Bean=org.apache.cassandra.config.Config@12e43f1; Cannot create property=column_families for
 in "<reader>", line 3, column 1:
    authenticator: org.apache.cassan ...

        at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(
        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(
        at org.yaml.snakeyaml.constructor.BaseConstructorconstructDocument(

        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(
        at org.yaml.snakeyaml.Loader.load(
        at org.yaml.snakeyaml.Yaml.load(
        at com.atsid.cassandra.testutils.CassandraTestRunner.updateYamlConfig(
        at com.atsid.cassandra.testutils.CassandraTestRunner.init(
        at com.atsid.cassandra.testutils.CassandraTestRunner.main(
        ... 6 more
Caused by: org.yaml.snakeyaml.error.YAMLException: Cannot create property=keyspaces for JavaBean=org.apache.cassandra.config.Config@12e43f1;
Cannot cr
eate property=column_families for JavaBean=org.apache.cassandra.config.RawKeyspace@1a8bd74;
        at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(
        at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(
        at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(
        ... 14 more
Caused by: org.yaml.snakeyaml.error.YAMLException: Cannot create property=column_families
for JavaBean=org.apache.cassandra.config.RawKeyspace@1a8bd74
; null
        at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(
        at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(
        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(
        at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequenceStep2(
        at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequence(
        at org.yaml.snakeyaml.constructorConstructor$ConstructSequence.construct(

        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(
        at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(
        ... 16 more
Caused by: java.lang.ArrayStoreException
        at java.lang.Systemarraycopy(Native Method)
        at java.util.Arrays.copyOf(
        at java.util.ArrayList.toArray(
        at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(
        ... 23 more

  • Unnamed multipart/alternative (inline, None, 0 bytes)
    • Unnamed multipart/related (inline, None, 0 bytes)
View raw message