incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: getIndexedSlices issue using Pelops
Date Tue, 07 Jun 2011 17:32:03 GMT
... also, are you on 0.7.6?  "works on cli but internal error w/
pelops" sounds like pelops is giving an invalid request, 0.7.6 is
better at catching those and giving a real error message.

On Tue, Jun 7, 2011 at 12:31 PM, Jonathan Ellis <jbellis@gmail.com> wrote:
> internal error means look at the cassandra server logs for the stacktrace.
>
> On Tue, Jun 7, 2011 at 12:20 PM, Tan Huynh <thuynh@adobe.com> wrote:
>> Hi,
>>
>>
>>
>> I am using Pelops client to query Cassandra secondary index and I get the e=
>> xception listed below.
>>
>> The code is pretty simple too. I can use Cassandra-cli to query the same
>> secondary index, so there must be something wrong in my code. If you've seen
>> this issue, would you please point me to what I am doing wrong.
>>
>> Thanks.
>>
>> Tan
>>
>>
>>
>> org.scale7.cassandra.pelops.exceptions.ApplicationException: Internal
>> error=  processing get_indexed_slices
>>
>>       at
>> org.scale7.cassandra.pelops.exceptions.IExceptionTranslator$ExceptionTranslator.translate(IExceptionTranslator.java:49)
>>
>>       at org.scale7.cassandra.pelops.Operand.tryOperation(Operand.java:109)
>>
>>       at
>> org.scale7.cassandra.pelops.Selector.getIndexedColumns(Selector.java:1623)
>>
>>       at
>> org.scale7.cassandra.pelops.Selector.getIndexedColumns(Selector.java:1578)
>>
>>       at TestSecondary.<init>(TestSecondary.java:67)
>>
>>       at TestSecondary.main(TestSecondary.java:91)
>>
>> Caused by: org.apache.thrift.TApplicationException: Internal error
>> processing get_indexed_slices
>>
>>       at
>> org.apache.thrift.TApplicationException.read(TApplicationException.java:108)
>>
>>       at
>> org.apache.cassandra.thrift.Cassandra$Client.recv_get_indexed_slices(Cassandra.java:772)
>>
>>       at
>> org.apache.cassandra.thrift.Cassandra$Client.get_indexed_slices(Cassandra.java:752)
>>
>>       at org.scale7.cassandra.pelops.Selector$15.execute(Selector.java:1613)
>>
>>       at org.scale7.cassandra.pelops.Selector$15.execute(Selector.java:1610)
>>
>>       at org.scale7.cassandra.pelops.Operand.tryOperation(Operand.java:82)
>>
>>       ... 4 more
>>
>>
>>
>> This is the code:
>>
>>    try {
>>
>>       String collectionName = "test";
>>
>>       KsDef keyspaceDefinition = null;
>>
>>
>>
>>       cluster = new Cluster("localhost", RPC_PORT);
>>
>>       ClusterManager clusterManager = Pelops.createClusterManager(cluster);
>>
>>
>>
>>
>>
>>       KeyspaceManager keyspaceManager =
>> Pelops.createKeyspaceManager(cluster);
>>
>>
>>
>>       keyspaceDefinition = keyspaceManager.getKeyspaceSchema(KEYSPACE);
>>
>>
>>
>>       if (keyspaceDefinition != null) {
>>
>>         Pelops.addPool(POOL, cluster, KEYSPACE);
>>
>>
>>
>>         IndexClause indexClause;
>>
>>         indexClause = Selector.newIndexClause(
>>
>>             Bytes.EMPTY,
>>
>>             Integer.MAX_VALUE,
>>
>>             Selector.newIndexExpression("birth_date", IndexOperator.EQ,
>>
>>                 Bytes.fromLong(1973)));
>>
>>
>>
>>         SlicePredicate slicePredicate =
>> Selector.newColumnsPredicateAll(false,
>>
>>             Integer.MAX_VALUE);
>>
>>
>>
>>         Selector selector = Pelops.createSelector(POOL);
>>
>>         Map<Bytes, List<Column>> qResults = selector.getIndexedColumns(
>>
>>             collectionName, indexClause, slicePredicate,
>> ConsistencyLevel.ONE);
>>
>>         }
>>
>>       }
>>
>>     } catch (PelopsException e) {
>>
>>       e.printStackTrace();
>>
>>     } catch (Exception e1) {
>>
>>       e1.printStackTrace();
>>
>>     }
>>
>>
>>
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Mime
View raw message