Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5FDB310654 for ; Wed, 3 Jul 2013 11:51:30 +0000 (UTC) Received: (qmail 47663 invoked by uid 500); 3 Jul 2013 11:51:27 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 47476 invoked by uid 500); 3 Jul 2013 11:51:27 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 47468 invoked by uid 99); 3 Jul 2013 11:51:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 11:51:26 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of smsmittal14@gmail.com designates 209.85.223.178 as permitted sender) Received: from [209.85.223.178] (HELO mail-ie0-f178.google.com) (209.85.223.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 11:51:22 +0000 Received: by mail-ie0-f178.google.com with SMTP id u16so77088iet.9 for ; Wed, 03 Jul 2013 04:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=hyq/c29B4eweoP2NJ+FlA5/dobEBNoUBzfj0xAyAXck=; b=QuXYvGrP83d3MM62AZ2w/pOLJitAmN3lxg53Gi9tuf7444nKCISkRSy6ZWPpPMxQdE t5Do1MuK5Jeox/5gyFZs3bnT4AO+1GLs5FOSaB8VdVLppg8LsRD6UeC34DfOwHZk8z6F PS9/yrmUp9JG0RyQv2rEumABLr6bHx5jWH7zGFqPAcw/lt0I5fLSEXZBmlHM4H+uyZqO y9kpWlezrti9lFOK2xTg4DUQG2yK4hDT9IKGhNq7eeDwpvVBSrNHuXa3j9k2x6dZKNV+ 4j3GclXfWVO9C1boPrDr6s5flHXUr0nBgAoimAkdAPr2IvkhlQW0uZsIB1wmh3r7HNOl c76A== MIME-Version: 1.0 X-Received: by 10.50.8.41 with SMTP id o9mr365941iga.9.1372852261531; Wed, 03 Jul 2013 04:51:01 -0700 (PDT) Received: by 10.64.106.232 with HTTP; Wed, 3 Jul 2013 04:51:01 -0700 (PDT) In-Reply-To: <165D0FD6-D9D4-4981-A5A6-A7FE02BB4BC2@gmail.com> References: <165D0FD6-D9D4-4981-A5A6-A7FE02BB4BC2@gmail.com> Date: Wed, 3 Jul 2013 17:21:01 +0530 Message-ID: Subject: Re: Problem with libcassandra From: Shubham Mittal To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=089e01184c1260b9b304e09a13e2 X-Virus-Checked: Checked by ClamAV on apache.org --089e01184c1260b9b304e09a13e2 Content-Type: text/plain; charset=ISO-8859-1 This is the gdb output [Thread debugging using libthread_db enabled] terminate called after throwing an instance of 'org::apache::cassandra::InvalidRequestException' what(): Default TException. Program received signal SIGABRT, Aborted. 0x00007ffff70a0b25 in raise () from /lib/libc.so.6 On Wed, Jul 3, 2013 at 8:38 AM, Jeremiah D Jordan wrote: > If you are using 1.2, I would checkout https://github.com/mstump/libcql > > -Jeremiah > > On Jul 2, 2013, at 5:18 AM, Shubham Mittal wrote: > > I am trying to run below code, but it gives this error. It compiles > without any errors. Kindly help me. > (source of the code : > http://posulliv.github.io/2011/02/27/libcassandra-sec-indexes/) > > terminate called after throwing an instance of > 'org::apache::cassandra::InvalidRequestException' > what(): Default TException. > Aborted > > > #include > #include > #include > #include > #include > #include > #include > #include > > #include > #include > #include > #include > #include > > using namespace std; > using namespace libcassandra; > > static string host("127.0.0.1"); > static int port= 9160; > > int main() > { > > CassandraFactory cf(host, port); > tr1::shared_ptr c(cf.create()); > > KeyspaceDefinition ks_def; > ks_def.setName("demo"); > c->createKeyspace(ks_def); > > ColumnFamilyDefinition cf_def; > cf_def.setName("users"); > cf_def.setKeyspaceName(ks_def.getName()); > > ColumnDefinition name_col; > name_col.setName("full_name"); > name_col.setValidationClass("UTF8Type"); > > ColumnDefinition sec_col; > sec_col.setName("birth_date"); > sec_col.setValidationClass("LongType"); > sec_col.setIndexType(org::apache::cassandra::IndexType::KEYS); > > ColumnDefinition third_col; > third_col.setName("state"); > third_col.setValidationClass("UTF8Type"); > third_col.setIndexType(org::apache::cassandra::IndexType::KEYS); > > cf_def.addColumnMetadata(name_col); > cf_def.addColumnMetadata(sec_col); > cf_def.addColumnMetadata(third_col); > > c->setKeyspace(ks_def.getName()); > c->createColumnFamily(cf_def); > > return 0; > } > > > --089e01184c1260b9b304e09a13e2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
This is the gdb output

[Thread debugging using libthread_db enabled]
terminate called after throwing an instance of = 9;org::apache::cassandra::InvalidRequestException'
=A0 what(): =A0Default TException.

Program received signal SIGABRT, Aborted.
0x00007ffff70a0b25 in raise () from /lib/libc.so.6



On Wed, Jul 3, 2013 at 8:38 AM, Jeremiah D Jor= dan <jeremiah.jordan@gmail.com> wrote:
If you a= re using 1.2, I would checkout=A0https://github.com/mstump/libcql

-Jeremiah
On Jul 2, 2013, at 5:18 AM, Shubham Mittal <smsmittal14@gmail.com> wro= te:

I am trying to run below cod= e, but it gives this error. It compiles without any errors. =A0Kindly help = me.
(source of the code :=A0http://posulliv.github.io= /2011/02/27/libcassandra-sec-indexes/)

terminate called after throwing = an instance of 'org::apache::cassandra::InvalidRequestException'
=A0 what(): =A0Default TException.
Aborted

=
#include <string.h>
#include <sstrea= m>
#include <iostream>
#include <stdlib.h&g= t;
#include <set>
#include <string>
#incl= ude <stdio.h>
#include <vector>

<= div>#include <libcassandra/cassandra_factory.h>
#include &l= t;libcassandra/cassandra.h>
#include <libcassandra/column_family_definition.h>
#in= clude <libcassandra/keyspace.h>
#include <libcassandra/k= eyspace_definition.h>

using namespace std;
using namespace libcassandra;

static string h= ost("127.0.0.1");
static int port=3D 9160;
int main()
{

=A0 =A0 Cassan= draFactory cf(host, port);
=A0 =A0 tr1::shared_ptr<Cassandra> c(cf.create());
=A0 =A0 KeyspaceDefinition ks_def;
=A0 =A0 ks_def.set= Name("demo");
=A0 =A0 c->createKeyspace(ks_def);
=A0 =A0=A0
=A0 =A0 ColumnFamilyDefinition cf_def;
=A0 =A0 cf_def.setNam= e("users");
=A0 =A0 cf_def.setKeyspaceName(ks_def.getNa= me());
=A0 =A0=A0
=A0 =A0 ColumnDefinition name_col;
=A0 =A0 name_col.setName("full_name");
=A0 =A0 name_col.setValidationClass("UTF8Type");
= =A0 =A0=A0
=A0 =A0 ColumnDefinition sec_col;
=A0 =A0 se= c_col.setName("birth_date");
=A0 =A0 sec_col.setValidat= ionClass("LongType");
=A0 =A0 sec_col.setIndexType(org::apache::cassandra::IndexType::KEYS);=
=A0 =A0=A0
=A0 =A0 ColumnDefinition third_col;
=A0 =A0 third_col.setName("state");
=A0 =A0 third_co= l.setValidationClass("UTF8Type");
=A0 =A0 third_col.setIndexType(org::apache::cassandra::IndexType::KEYS= );
=A0 =A0=A0
=A0 =A0 cf_def.addColumnMetadata(name_col= );
=A0 =A0 cf_def.addColumnMetadata(sec_col);
=A0 =A0 c= f_def.addColumnMetadata(third_col);
=A0 =A0=A0
=A0 =A0 c->setKeyspace(ks_def.getName());
=A0 =A0 c->createColumnFamily(cf_def);
=A0 =A0=A0
<= div>=A0 =A0 return 0;
}



--089e01184c1260b9b304e09a13e2--