You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ed Anuff <ed...@anuff.com> on 2010/08/17 23:04:45 UTC

Errors on CF with index

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);

Re: Errors on CF with index

Posted by Ed Anuff <ed...@anuff.com>.
Yup, that's it, r986486 on Table.java made the problem go away, talk about
great timing :)

On Tue, Aug 17, 2010 at 2:38 PM, Eric Evans <ee...@rackspace.com> wrote:

> On Tue, 2010-08-17 at 14:04 -0700, Ed Anuff wrote:
> >
> > 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
>
> Looks like https://issues.apache.org/jira/browse/CASSANDRA-1402
>
> --
> Eric Evans
> eevans@rackspace.com
>
>

Re: Errors on CF with index

Posted by Eric Evans <ee...@rackspace.com>.
On Tue, 2010-08-17 at 14:04 -0700, Ed Anuff wrote:
> 
> 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 

Looks like https://issues.apache.org/jira/browse/CASSANDRA-1402

-- 
Eric Evans
eevans@rackspace.com