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 6123010706 for ; Wed, 3 Jul 2013 12:12:50 +0000 (UTC) Received: (qmail 6309 invoked by uid 500); 3 Jul 2013 12:12:47 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 6263 invoked by uid 500); 3 Jul 2013 12:12:47 -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 6254 invoked by uid 99); 3 Jul 2013 12:12:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 12:12:46 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of smsmittal14@gmail.com designates 209.85.223.173 as permitted sender) Received: from [209.85.223.173] (HELO mail-ie0-f173.google.com) (209.85.223.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 12:12:39 +0000 Received: by mail-ie0-f173.google.com with SMTP id k13so119899iea.32 for ; Wed, 03 Jul 2013 05:12:19 -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=K9+5qg+DB+Ik8pkth3OwspP/kffmwsVNFc59Rk1zpso=; b=m0BUJyfBkHFZOBOItRmxL1yHljS65fY6LNfFMKzIB9Kf8qEi1y1iQRE0XLHwuMZ/q2 jS1VNgbvCH3R57kKsPABvQ5QYmgaBTOeNVXZjC1NecvtCZ9esA35O4RWIzs41YHsf0ow EpdHzvtMHDBINHLgpq5hcxgDohgyc/bNludNJLT2+2Nw60wylgGfxLblWnBfTYc9OP0m P3zDLYQMhBMeJd+AHQYEO99ZZVjEt3YL0Y1X7TV3D+aVF897BezhQUrw9TuhvS9hbJdB DMTxYov9veqwh7oKqvnneLIxMTHukrRqQUQiY00zlfFrzbnehRNjHbKxtn20oNlRxYG/ nJYw== MIME-Version: 1.0 X-Received: by 10.42.189.195 with SMTP id df3mr304687icb.78.1372853538938; Wed, 03 Jul 2013 05:12:18 -0700 (PDT) Received: by 10.64.106.232 with HTTP; Wed, 3 Jul 2013 05:12:18 -0700 (PDT) In-Reply-To: References: <165D0FD6-D9D4-4981-A5A6-A7FE02BB4BC2@gmail.com> Date: Wed, 3 Jul 2013 17:42:18 +0530 Message-ID: Subject: Re: Problem with libcassandra From: Shubham Mittal To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=20cf303bf7ca8465af04e09a5f59 X-Virus-Checked: Checked by ClamAV on apache.org --20cf303bf7ca8465af04e09a5f59 Content-Type: text/plain; charset=ISO-8859-1 Hey, I found out that the problem is caused by this line : c->createKeyspace(ks_def); because the below code works fine. #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"); return 0; } On Wed, Jul 3, 2013 at 5:22 PM, Shubham Mittal wrote: > no Jordan, the cassandra version I have is Cassandra 1.1.12 > > > On Wed, Jul 3, 2013 at 5:21 PM, Shubham Mittal wrote: > >> 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 < >> jeremiah.jordan@gmail.com> 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; >>> } >>> >>> >>> >> > --20cf303bf7ca8465af04e09a5f59 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hey,

I found out that the problem= is caused by this line :
c->cr= eateKeyspace(ks_def);

because the below code works fine.

#include <string.h>
#include <sstream>
#include <iostream>
#include <s= tdlib.h>
= #include <set>
#include <string>
#include <stdio.h>
#include <vector>

#include <libcassandra/cassandra_factory.h>
#include <libcass= andra/cassandra.h>
#include <libcassandra/column_family_definition.h>
#include <= libcassandra/keyspace.h>
#include <libcassandra/keyspace_definition.h>

using na= mespace std;
= using namespace libcassandra;

static string host("127.0.0.1");
static int port=3D 9160;

int main()
{

=A0 =A0 CassandraFactory cf(host, port);
=A0 =A0 tr1::shared= _ptr<Cassandra> c(cf.create());
=
=A0 =A0 KeyspaceDefinition ks_def;
=A0 =A0 ks_def.setName("demo");
=A0 =A0 return 0;
}


On Wed,= Jul 3, 2013 at 5:22 PM, Shubham Mittal <smsmittal14@gmail.com>= wrote:
no Jordan, the cassandra ve= rsion I have is=A0Cassandra 1.1.12=A0


On Wed, Jul 3, 2013 at 5:21 PM, Shubham = Mittal <smsmittal14@gmail.com> wrote:
This is the gdb output
=
[Thread debugging using libthre= ad_db enabled]
terminate called after throwing an instan= ce of '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, Jere= miah D Jordan <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> wrote:

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;
}





--20cf303bf7ca8465af04e09a5f59--