cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From A J <s5a...@gmail.com>
Subject Re: Astyanax error
Date Mon, 17 Sep 2012 19:37:49 GMT
I traced this to the misnomer of Integer datatype in Cassandra.
IntegerType in Cassandra is infact a variable length BigInt. Changing
it to Int32Type solved the issue.
https://github.com/Netflix/astyanax/issues/59



On Mon, Sep 17, 2012 at 10:51 AM, A J <s5alye@gmail.com> wrote:
> Hello,
>
> I am tyring to retrieve a list of Column Names (that are defined as
> Integer) from a CF with RowKey as Integer as well. (I don't care for
> the column values that are just nulls)
>
> Following is snippet of my Astyanax code. I am getting 0 columns but I
> know the key that I am querying contains a few hundred columns. Any
> idea what part of the code below is incorrect ?
>
> Thanks.
>
> Astyanax code:
> ============
>         ColumnFamily<Integer, Integer> CF1 =
>                 new ColumnFamily<Integer, Integer>(
>                 "CF1",                 // Column Family Name
>                 IntegerSerializer.get(),   // Key Serializer
>                 IntegerSerializer.get());  // Column Serializer
>
>         //Reading data
>         int NUM_EVENTS = 9;
>
>         StopWatch clock = new StopWatch();
>         clock.start();
>         for (int i = 0; i < NUM_EVENTS; ++i) {
>                 ColumnList<Integer> result = keyspace.prepareQuery(CF1)
>                         .getKey(1919)
>                         .execute().getResult();
>         System.out.println( "results are: " + result.size() );
>         }
>         clock.stop();
>
>
>
> CF definition:
> ===========
> [default@ks1] describe CF1;
>     ColumnFamily: CF1
>       Key Validation Class: org.apache.cassandra.db.marshal.IntegerType
>       Default column value validator: org.apache.cassandra.db.marshal.BytesType
>       Columns sorted by: org.apache.cassandra.db.marshal.IntegerType

Mime
View raw message