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 9BFA166DE for ; Thu, 26 May 2011 18:56:15 +0000 (UTC) Received: (qmail 84692 invoked by uid 500); 26 May 2011 18:56:13 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 84670 invoked by uid 500); 26 May 2011 18:56:13 -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 84661 invoked by uid 99); 26 May 2011 18:56:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 May 2011 18:56:13 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 May 2011 18:56:06 +0000 Received: by vws12 with SMTP id 12so999250vws.31 for ; Thu, 26 May 2011 11:55:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.31.195 with SMTP id c3mr1766972vdi.141.1306435869666; Thu, 26 May 2011 11:51:09 -0700 (PDT) Received: by 10.52.112.170 with HTTP; Thu, 26 May 2011 11:51:09 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 May 2011 20:51:09 +0200 Message-ID: Subject: Re: PHP CQL Driver From: Kwasi Gyasi - Agyei To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec51d28ceeeebe304a4324d61 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec51d28ceeeebe304a4324d61 Content-Type: text/plain; charset=UTF-8 got system in debug mode the following query fails ------------------------------- CREATE COLUMNFAMILY magic (KEY text PRIMARY KEY, monkey ) WITH comparator = text AND default_validation = text PHP error reads ------------------------- #0 /Volumes/DATA/Project/libs/php/phpCQL/vendor/cassandra/cassandra.Cassandra_execute_cql_query_result.php(52): TBase->_read('Cassandra_execu...', Array, Object(TBinaryProtocol)) #1 /Volumes/DATA/Project/libs/php/phpCQL/vendor/cassandra/cassandra.Cassandra.client.php(1771): cassandra_Cassandra_execute_cql_query_result->read(Object(TBinaryProtocol)) #2 /Volumes/DATA/Project/libs/php/phpCQL/vendor/cassandra/cassandra.Cassandra.client.php(1731): CassandraClient->recv_execute_cql_query() #3 /Volumes/DATA/Project/libs/php/phpCQL/test/index.php(34): CassandraClient->execute_cql_query('CREATE COLUMNFA...', 2) #4 {main} Cassandra logs read ------------------------------ DEBUG 20:48:10,659 Disseminating load info ... DEBUG 20:49:10,661 Disseminating load info ... DEBUG 20:49:22,867 CQL statement type: USE DEBUG 20:49:22,870 logged out: # here is the code I'm using to test -------------------------------------------- phpCQLAutoloader::register(); $socketPool = new TSocketPool(); $socketPool->addServer( "127.0.0.1", 9160 ); $socketPool->setDebug( true ); $framedTransport = new TFramedTransport( $socketPool, true, true ); $bufferedProtocol = new TBinaryProtocol( $framedTransport, true, true ); //new TBinaryProtocolAccelerated( $framedTransport ); $cassandraClient = new CassandraClient( $bufferedProtocol, $bufferedProtocol ); try{ echo "opening connection
"; $framedTransport->open(); try{ echo "settign keyspace to use
"; $result = $cassandraClient->execute_cql_query( "use nnduronic" , cassandra_Compression::NONE); print_r( $result ); }catch( cassandra_InvalidRequestException $exrs ){ echo "USE error occuired --
" . $exrs->getTraceAsString() . "
"; } try{ echo "Executing create column query
"; $query = "CREATE COLUMNFAMILY magic (KEY text PRIMARY KEY, monkey ) WITH comparator = text AND default_validation = text"; $result = $cassandraClient->execute_cql_query( $query , cassandra_Compression::NONE ); echo "|". print_r($result) . "|" . "
"; }catch( cassandra_InvalidRequestException $exrs ){ echo "COLUMNFAMILY error occuired --
" . $exrs->getTraceAsString() . "
"; } echo "closing connnection
"; $framedTransport->close(); I'm lost :( On Thu, May 26, 2011 at 9:17 AM, aaron morton wrote: > Cool, this may be a better discussion for the client-dev list > http://www.mail-archive.com/client-dev@cassandra.apache.org/ > > I would start by turning up the server logging to DEBUG and watching your > update / select queries. > > Cheers > ----------------- > Aaron Morton > Freelance Cassandra Developer > @aaronmorton > http://www.thelastpickle.com > > On 26 May 2011, at 16:15, Kwasi Gyasi - Agyei wrote: > > Hi, > > I have manged to generate thrift interface for php along with implementing > auto-loading of both Cassandra and thrift core class. > > However during my testing the only query that works as expected is the > create keyspace cql query... all other queries don't do or return any > results nor do they throw exceptions even in try catch statement I get > nothing. > > -- > *4Things* > Multimedia and Communication | Property | Entertainment > Kwasi Owusu Gyasi - Agyei > > *cell* (+27) (0) 76 466 4488 > *website *www.4things.co.za > *email *kwasi.gyasiagyei@4things.co.za > *skype *kwasi.gyasiagyei > *role* Developer.Designer.Software Architect > > > -- *4Things* Multimedia and Communication | Property | Entertainment Kwasi Owusu Gyasi - Agyei *cell* (+27) (0) 76 466 4488 *website *www.4things.co.za *email *kwasi.gyasiagyei@4things.co.za *skype *kwasi.gyasiagyei *role* Developer.Designer.Software Architect --bcaec51d28ceeeebe304a4324d61 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable got system in debug mode

the following query fails
-------------= ------------------

CREATE COLUMNFAMILY magic (KEY text PRIMARY KEY, = monkey ) WITH comparator =3D text AND default_validation =3D text

PH= P error reads
-------------------------

#0=20 /Volumes/DATA/Project/libs/php/phpCQL/vendor/cassandra/cassandra.Cassandra_= execute_cql_query_result.php(52): TBase->_read('Cassandra_execu...', Array, Object(TBinaryProtoco= l)) #1=20 /Volumes/DATA/Project/libs/php/phpCQL/vendor/cassandra/cassandra.Cassandra.= client.php(1771): =20 cassandra_Cassandra_execute_cql_query_result->read(Object(TBinaryProtoco= l)) #2 =20 /Volumes/DATA/Project/libs/php/phpCQL/vendor/cassandra/cassandra.Cassandra.= client.php(1731): CassandraClient->recv_execute_cql_query() #3 /Volumes/DATA/Project/libs/php/phpCQL/test/index.php(34):=20 CassandraClient->execute_cql_query('CREATE COLUMNFA...', 2) #4 {main}

Cassandra logs read
------------------------------
=
DEBUG 20:48:10,659 Disseminating load info ...
DEBUG 20:49:10,661 Di= sseminating load info ...
DEBUG 20:49:22,867 CQL statement type: USE
DEBUG 20:49:22,870 logged out: #<User allow_all groups=3D[]>

<= br>here is the code I'm using to test
-----------------------------= ---------------

phpCQLAutoloader::register();

$socketPool=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =3D new TSocketPool();
$socketPool->addServer( "127.0.0.1", 9160 );
$socketPool-&g= t;setDebug( true );

$framedTransport=C2=A0 =3D new TFramedTransport(= $socketPool, true, true );
$bufferedProtocol =3D new TBinaryProtocol( $= framedTransport, true, true ); //new TBinaryProtocolAccelerated( $framedTra= nsport );
$cassandraClient=C2=A0 =3D new CassandraClient( $bufferedProtocol, $buffere= dProtocol );

try{
=C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 echo = "opening connection <br>";
=C2=A0=C2=A0=C2=A0 $framedTra= nsport->open();
=C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 try{
=C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 echo "settign keyspace to use &l= t;br/>";
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 $result =3D $cass= andraClient->execute_cql_query( "use nnduronic" , cassandra_Co= mpression::NONE);
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 print_r( $= result );
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 }catch( cassandra_InvalidRequestException $exrs ){
= =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 echo "USE error occuired -- <br> " . $exrs->getTr= aceAsString() . " <br>";
=C2=A0=C2=A0=C2=A0 }

=C2= =A0=C2=A0=C2=A0 try{
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 echo "Executi= ng create column query <br/>";
=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0 $query=C2=A0 =3D "CREATE COLUMNFAMILY mag= ic (KEY text PRIMARY KEY, monkey ) WITH comparator =3D text AND default_val= idation =3D text";
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 $result =3D $cassa= ndraClient->execute_cql_query( $query , cassandra_Compression::NONE );=C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0= =C2=A0 echo "|". print_r($result) . "|" . "<br&= gt;";
=C2=A0=C2=A0=C2=A0
=C2=A0=C2=A0=C2=A0 }catch( cassandra_I= nvalidRequestException $exrs ){
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 echo "COLUMNFAMILY error occuire= d -- <br> " . $exrs->getTraceAsString() . " <br>&q= uot;;
=C2=A0=C2=A0=C2=A0 }
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 echo= "closing connnection <br>";
=C2=A0=C2=A0=C2=A0 $framedT= ransport->close();


I'm lost :(

On Thu, May 26, 2= 011 at 9:17 AM, aaron morton <aaron@thelastpickle.com> wrote:
Cool, this may be a better discussion f= or the client-dev list=C2=A0
http://www.mail-archive.com= /client-dev@cassandra.apache.org/

I would start by turning up the server logging to DEBUG and watching yo= ur update / select queries.=C2=A0

Cheers
-----------------
Aaron Morton
Freelance Cass= andra Developer
@aaronmorton

On 26 May 2011, at 16:15, Kwasi Gyasi - Agyei wrote:
Hi,

I have manged to generate thrift inte= rface for php along with implementing auto-loading of both Cassandra and th= rift core class.

However during my testing the only query that works as expected is the = create keyspace cql query... all other queries don't do or return any r= esults nor do they throw exceptions even in try catch statement I get nothi= ng.

--
4Things
Multimedia and Communicat= ion | Property | Entertainment
Kwasi Owusu Gyasi - Agyei

cell=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (+27) (0) 76 466 4488
websit= e www.4things.co.za
email=C2=A0=C2=A0=C2=A0=C2=A0 kwasi.gyasiagyei@4things.co.za
skype=C2=A0=C2=A0=C2=A0 kwasi.gyasiagyei
role=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 Developer.Designer.Softw= are Architect




--
4Things<= /b>
Multimedia and C= ommunication | Property | Entertainment
Kwasi Owusu Gyasi - Agyei
cell=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (+27) (0) 76 466 4488=
website ww= w.4things.co.za
email=C2=A0=C2=A0=C2=A0=C2=A0 kwasi.gyasiagyei@4things.co.za
skype=C2=A0=C2=A0=C2=A0 kwasi.gyasiagyei
role=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 Developer.Designer.Softw= are Architect
--bcaec51d28ceeeebe304a4324d61--