cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Anuff ...@anuff.com>
Subject Errors on CF with index
Date Tue, 17 Aug 2010 21:04:45 GMT
I'm finding that once I add an index to a column family that I start getting
exceptions as I try to add rows to it.  It works fine if I don't define the
column metadata.  Any ideas what would cause this?

ERROR 12:44:21,477 Error in ThreadPoolExecutor
java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: -70
    at
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:34)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -70
    at org.apache.cassandra.db.Table.apply(Table.java:389)
    at org.apache.cassandra.db.RowMutation.apply(RowMutation.java:196)
    at
org.apache.cassandra.service.StorageProxy$1.runMayThrow(StorageProxy.java:194)
    at
org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30)
    ... 3 more


This is what the code looks like that's creating the keyspace, cf, and
index:

ColumnDef cd = new ColumnDef("type".getBytes(), "UTF8Type");
cd.setIndex_name("type");
cd.setIndex_type(IndexType.KEYS);

List<ColumnDef> columns = new ArrayList<ColumnDef>();
columns.add(cd);

CfDef cf_def = new CfDef();
cf_def.setKeyspace("Domain_00000000_0000_0000_0000_000000000001");
cf_def.setName("Entity_Fields");
cf_def.setComparator_type("BytesType");
cf_def.setColumn_metadata(columns);

List<CfDef> cf_defs = new ArrayList<CfDef>();
cf_defs.add(cf_def);

KsDef ks_def = new KsDef();
ks_def.setName("Domain_00000000_0000_0000_0000_000000000001");
ks_def.setStrategy_class("org.apache.cassandra.locator.SimpleStrategy");
ks_def.setReplication_factor(1);
ks_def.setCf_defs(cf_defs);

thrift_cassandra.system_add_keyspace(ks_def);

Mime
View raw message