You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Tan Huynh <th...@adobe.com> on 2011/06/07 19:20:30 UTC

getIndexedSlices issue using Pelops

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

    }




RE: getIndexedSlices issue using Pelops

Posted by Tan Huynh <th...@adobe.com>.
Thanks Jonathan for the pointer.  It turns out the issue has to do w/ the count number that I specify in the index clause (Integer.MAX_VALUE).   The StorageProxy.scan() method allocates a list of this size, causing Cassandra running out of heap space. Changing the count value to smaller value fixes the problem.
Tan

-----Original Message-----
From: Jonathan Ellis [mailto:jbellis@gmail.com] 
Sent: Tuesday, June 07, 2011 10:32 AM
To: user@cassandra.apache.org
Subject: Re: getIndexedSlices issue using Pelops

... 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 <jb...@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 <th...@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

Re: getIndexedSlices issue using Pelops

Posted by Jonathan Ellis <jb...@gmail.com>.
... 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 <jb...@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 <th...@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

Re: getIndexedSlices issue using Pelops

Posted by Jonathan Ellis <jb...@gmail.com>.
internal error means look at the cassandra server logs for the stacktrace.

On Tue, Jun 7, 2011 at 12:20 PM, Tan Huynh <th...@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