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

    }



Reply via email to