Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 1152 invoked from network); 8 Nov 2010 18:55:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Nov 2010 18:55:35 -0000 Received: (qmail 91722 invoked by uid 500); 8 Nov 2010 18:56:05 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 91674 invoked by uid 500); 8 Nov 2010 18:56:04 -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 91666 invoked by uid 99); 8 Nov 2010 18:56:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Nov 2010 18:56:04 +0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.149.67] (HELO na3sys009aog101.obsmtp.com) (74.125.149.67) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 08 Nov 2010 18:55:54 +0000 Received: from source ([209.85.213.45]) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKTNhHoFUGGGorVCVygZXQpmgtwukGmrmd@postini.com; Mon, 08 Nov 2010 10:55:34 PST Received: by mail-yw0-f45.google.com with SMTP id 8so3945362ywa.4 for ; Mon, 08 Nov 2010 10:55:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.229.202 with SMTP id jj10mr3779728icb.237.1289242528584; Mon, 08 Nov 2010 10:55:28 -0800 (PST) Received: by 10.231.174.143 with HTTP; Mon, 8 Nov 2010 10:55:28 -0800 (PST) Date: Mon, 8 Nov 2010 13:55:28 -0500 Message-ID: Subject: Cassandra With C++ From: David Replogle To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=20cf30549d3bf2158304948f2a8b X-Virus-Checked: Checked by ClamAV on apache.org --20cf30549d3bf2158304948f2a8b Content-Type: text/plain; charset=UTF-8 I'm using Cassandra 0.7beta3 and it's running on localhost:9160 and Python works with it just fine. So, I go to run C++ against the system and I get: TTransportException: No more data to read. I did the thrift --gen cpp interface/cassandra.thrift in my 0.7beta3 folder then included those files in the C++ code, and it builds fine, and runs. It bombs out on the set_keyspace call... the code is short so I'll paste it here (not counting includes and using calls): --- const string host("localhost"); const int port= 9160; int main() { try { boost::shared_ptr socket(new TSocket(host, port)); boost::shared_ptr transport(new TBufferedTransport(socket)); boost::shared_ptr protocol(new TBinaryProtocol(transport)); CassandraClient client(protocol); transport->open(); string version; client.set_keyspace("Crawldata"); transport->close(); } catch (apache::thrift::transport::TTransportException &tte) { cout << "TTransportException: " << tte.what() << endl; } return 0; } --- It throws this same error with a series of other calls. This is probably (hopefully) something stupid I'm missing. Do I really need to run the C++ server component (which seems superfluous since it's not actually my Cassandra instance) as detailed here: http://wiki.apache.org/thrift/ThriftUsageC%2B%2B -- David Replogle | Senior Programmer Analyst Catalyst SGC 44 Grandville Ave SW, Ste. 270, Grand Rapids, MI 49503 Office: 616.855.5522 x204 | Mobile: 616.293.2788 --20cf30549d3bf2158304948f2a8b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm using Cassandra 0.7beta3 and it's running on localhost:9160 and= Python works with it just fine. So, I go to run C++ against the system and= I get:

TTransportException: No more data to read.

I did the thrift --gen cpp interface/cassandra.thrift i= n my 0.7beta3 folder
then included those files in the C++ code, a= nd it builds fine, and runs.

It bombs out on the s= et_keyspace call... the code is short so I'll paste it here (not counti= ng includes and using calls):

---

const string host(&qu= ot;localhost");
const int port=3D 9160;

=
int main()
{
=C2=A0=C2=A0 =C2=A0try {
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0boost::shared_ptr<TSocket> = socket(new TSocket(host, port));
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0boost::shared_ptr<TTransport> t= ransport(new TBufferedTransport(socket));
=C2=A0=C2=A0 =C2=A0 =C2= =A0 =C2=A0boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(t= ransport));

=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0Cassa= ndraClient client(protocol);
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0transport->open();

<= /div>
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0string version;
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0client.set_keyspace("Crawldata");
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0transport->close();
=C2=A0=C2=A0 =C2=A0} catch (apache::thrift::transport::TTransportExceptio= n &tte) {
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0cout << "TTransportExcepti= on: " << tte.what() << endl;
=C2=A0=C2=A0 =C2=A0= }
=C2=A0=C2=A0 =C2=A0return 0;
}

---

It throws this same error with a series of= other calls. This is probably (hopefully) something stupid I'm missing= . Do I really need to run the C++ server component (which seems superfluous= since it's not actually my Cassandra instance) as detailed here:=C2=A0= http://wiki.ap= ache.org/thrift/ThriftUsageC%2B%2B

--
Dav= id Replogle | Senior Programmer Analyst
Cat= alyst SGC
44 Grandville Ave SW, Ste. 270, Grand Rapids, MI 49503
Offi= ce: 616.855.5522 x204 | Mobile: 616.293.2788

--20cf30549d3bf2158304948f2a8b--