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 2563A9117 for ; Tue, 10 Apr 2012 12:46:16 +0000 (UTC) Received: (qmail 65313 invoked by uid 500); 10 Apr 2012 12:46:13 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 65290 invoked by uid 500); 10 Apr 2012 12:46: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 65281 invoked by uid 99); 10 Apr 2012 12:46:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2012 12:46:13 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jakers@gmail.com designates 209.85.210.43 as permitted sender) Received: from [209.85.210.43] (HELO mail-pz0-f43.google.com) (209.85.210.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2012 12:46:07 +0000 Received: by dadn15 with SMTP id n15so8254499dad.30 for ; Tue, 10 Apr 2012 05:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=VYmjdyyfpO3XFSo5xgsiB6fOp9zvGQyAFxRPTMZq0VE=; b=RO7yYh69fAbKCIz/kNGW4HQHQOhuuWmMgZzRsSIURFdNnWF1oIXC3PG9kdfzQMVyYo RPGa3j6Pm0FYq41Bu4NsLjQlUk8kHebSIziXeoQP3TkbMLNe29kHif8J+IoMyoDfEsAs BArRBFfzZ2yapAAltlPFqXHBzgwPIObVssbY+1WbRMPx9A1ZCWoX1u9jM+VsMcv2cK2d VZ+FntsjxKsRpc4ZIWpcejCdvGZYgwKMQW/2eHeTKnjGl2V1A1KFFJF3RXAftdu8OnI1 ZA2A1vrO9YqJJzqRSi+VcAds8cpS8NYLeCWrwyiBkxge8gyTwyFFChscNmOq62nnoRoD uMPQ== Received: by 10.68.130.170 with SMTP id of10mr21868598pbb.156.1334061945620; Tue, 10 Apr 2012 05:45:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.213.104 with HTTP; Tue, 10 Apr 2012 05:45:25 -0700 (PDT) In-Reply-To: References: <-4313996965939721372@unknownmsgid> From: Jake Luciani Date: Tue, 10 Apr 2012 08:45:25 -0400 Message-ID: Subject: Re: cassandra and .net To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b10cb6d60881304bd5280f2 --047d7b10cb6d60881304bd5280f2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You can also look at using a .net client wrapper like https://github.com/managedfusion/fluentcassandra On Tue, Apr 10, 2012 at 8:06 AM, puneet loya wrote: > thankk uuuu :) :) it works :) > > > On Tue, Apr 10, 2012 at 3:07 PM, Henrik Schr=F6der wro= te: > >> In your code you are using BufferedTransport, but in the Cassandra logs >> you're getting errors when it tries to use FramedTransport. If I remembe= r >> correctly, BufferedTransport is gone, so you should only use >> FramedTransport. Like this: >> >> TTransport transport =3D new TFramedTransport(new TSocket(host, port)); >> >> TProtocol protocol =3D new TBinaryProtocol(transport); >> var client =3D new Cassandra.Client(protocol); >> transport.Open(); >> client.describe_keyspace("abc"); >> >> >> /Henrik >> >> >> On Tue, Apr 10, 2012 at 11:23, puneet loya wrote: >> >>> >>> Log is showing the following exception >>> >>> DEBUG [ScheduledTasks:1] 2012-04-10 14:49:29,654 LoadBroadcaster.java >>> (line 86) Disseminating load info ... >>> DEBUG [Thrift:7] 2012-04-10 14:50:00,820 CustomTThreadPoolServer.java >>> (line 197) Thrift transport error occurred during processing of message= . >>> org.apache.thrift.transport.TTransportException >>> at >>> org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.= java:132) >>> at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) >>> at >>> org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport= .java:129) >>> at >>> org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java= :101) >>> at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) >>> at >>> org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java= :378) >>> at >>> org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java= :297) >>> at >>> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProt= ocol.java:204) >>> at >>> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:= 2877) >>> at >>> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(C= ustomTThreadPoolServer.java:187) >>> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown >>> Source) >>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) >>> at java.lang.Thread.run(Unknown Source) >>> DEBUG [Thrift:7] 2012-04-10 14:50:00,820 ClientState.java (line 104) >>> logged out: # >>> >>> On Tue, Apr 10, 2012 at 11:24 AM, Maki Watanabe >> > wrote: >>> >>>> Check your cassandra log. >>>> If you can't find any interesting log, set cassandra log level >>>> to DEBUG and run your program again. >>>> >>>> maki >>>> >>>> 2012/4/10 puneet loya : >>>> > hi, >>>> > >>>> > sorry i posted the port as 7000. I m using 9160 but still has the sa= me >>>> > error. >>>> > >>>> > "Cannot read, Remote side has closed". >>>> > Can u guess whats happening?? >>>> > >>>> > On Tue, Apr 10, 2012 at 11:00 AM, Pierre Chalamet < >>>> pierre@chalamet.net> >>>> > wrote: >>>> >> >>>> >> hello, >>>> >> >>>> >> 9160 is probably the port to use if you use the default config. >>>> >> >>>> >> - Pierre >>>> >> >>>> >> On Apr 10, 2012, at 7:26 AM, puneet loya >>>> wrote: >>>> >> >>>> >> > using System; >>>> >> > using System.Collections.Generic; >>>> >> > using System.Linq; >>>> >> > using System.Text; >>>> >> > using Thrift.Collections; >>>> >> > using Thrift.Protocol; >>>> >> > using Thrift.Transport; >>>> >> > using Apache.Cassandra; >>>> >> > >>>> >> > namespace ConsoleApplication1 >>>> >> > { >>>> >> > class Program >>>> >> > { >>>> >> > static void Main(string[] args) >>>> >> > { >>>> >> > TTransport transport=3Dnull; >>>> >> > try >>>> >> > { >>>> >> > transport =3D new TBufferedTransport(new >>>> >> > TSocket("127.0.0.1", 7000)); >>>> >> > >>>> >> > >>>> >> > //if(buffered) >>>> >> > // trans =3D new TBufferedTransport(tr= ans >>>> as >>>> >> > TStreamTransport); >>>> >> > //if (framed) >>>> >> > // trans =3D new TFramedTransport(trans); >>>> >> > >>>> >> > TProtocol protocol =3D new >>>> TBinaryProtocol(transport); >>>> >> > Cassandra.Client client =3D new >>>> >> > Cassandra.Client(protocol); >>>> >> > >>>> >> > Console.WriteLine("Opening connection"); >>>> >> > >>>> >> > if (!transport.IsOpen) >>>> >> > transport.Open(); >>>> >> > >>>> >> > client.describe_keyspace("abc"); // >>>> >> > Crashing at this point >>>> >> > >>>> >> > } >>>> >> > catch (Exception ex) >>>> >> > { >>>> >> > Console.WriteLine(ex.Message); >>>> >> > } >>>> >> > finally >>>> >> > { if(transport!=3Dnull) >>>> >> > transport.Close(); } >>>> >> > Console.ReadLine(); >>>> >> > } >>>> >> > } >>>> >> > } >>>> >> > >>>> >> > I m trying to interact with cassandra server(database) from .net. >>>> For >>>> >> > that i have referred two libraries i.e, apacheCassandra08.dll and >>>> >> > thrift.dll.. In the following piece of code the connection is >>>> getting opened >>>> >> > but when i m using client object it is giving an error stating >>>> "Cannot read, >>>> >> > Remote side has closed". >>>> >> > >>>> >> > Can any1 help me out with this? Has any1 faced the same prob? >>>> >> > >>>> >> > >>>> > >>>> > >>>> >>> >>> >> > --=20 http://twitter.com/tjake --047d7b10cb6d60881304bd5280f2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable You can also look at using a .net client wrapper like=A0https://github.com/managedfusion/= fluentcassandra

On Tue, Apr 10, 2012 = at 8:06 AM, puneet loya <puneetloya@gmail.com> wrote:
thankk uuuu :) :) it works :)


On Tue, Apr 10,= 2012 at 3:07 PM, Henrik Schr=F6der <skrolle@gmail.com> wrot= e:
In your code you are using BufferedTransport, but in the Cassandra logs you= 're getting errors when it tries to use FramedTransport. If I remember = correctly, BufferedTransport is gone, so you should only use FramedTranspor= t. Like this:

TTransport transport =3D new TFramedTransport(new TSocket(host, port));=

TProtocol protocol =3D new TBinaryProtocol(transport);
va= r client =3D new Cassandra.Client(protocol);
transport.Open();
client.describe_keyspace("abc");


/Henrik


On Tue, Apr 10,= 2012 at 11:23, puneet loya <puneetloya@gmail.com> wrote:=

Log is showing the following exception
<= br>
DEBUG [ScheduledTasks:1] 2012-04-10 14:49:29,654 LoadBroadcas= ter.java (line 86) Disseminating load info ...
DEBUG [Thrift:7] 2= 012-04-10 14:50:00,820 CustomTThreadPoolServer.java (line 197) Thrift trans= port error occurred during processing of message.
org.apache.thrift.transport.TTransportException
at org.apache.thrift.transport.TIOStreamT= ransport.read(TIOStreamTransport.java:132)
at org.apache.thrift.transport.TTransport.readAll(TT= ransport.java:84)
at org.apache.thrift.tran= sport.TFramedTransport.readFrame(TFramedTransport.java:129)
at org.apache.thrift.transport.TFra= medTransport.read(TFramedTransport.java:101)
at org.apache.thrift.tran= sport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.protocol.TBinaryProtocol.read= All(TBinaryProtocol.java:378)
at org.apache.thrift.prot= ocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297)
at org.apache.thrift.protocol.TBinaryPro= tocol.readMessageBegin(TBinaryProtocol.java:204)
at org.apache.cassandra.t= hrift.Cassandra$Processor.process(Cassandra.java:2877)
at org.apache.cassandra.thrift.CustomTTh= readPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:187)
at java.util.concurrent.T= hreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Wor= ker.run(Unknown Source)
at java.lang.Thread.run(U= nknown Source)
DEBUG [Thrift:7] 2012-04-10 14:50:00,820 ClientSta= te.java (line 104) logged out: #<User allow_all groups=3D[]>

On Tue, Apr 10, 2012 at 11:24 AM,= Maki Watanabe <watanabe.maki@gmail.com> wrote:
Check your cassandra log.
If you can't find any interesting log, set cassandra log level
to DEBUG and run your program again.

maki

2012/4/10 puneet loya <puneetloya@gmail.com>:
> hi,
>
> sorry i posted the port as 7000. I m using 9160 but still has the same=
> error.
>
> "Cannot read, Remote side has closed".
> Can u guess whats happening??
>
> On Tue, Apr 10, 2012 at 11:00 AM, Pierre Chalamet <pierre@chalamet.net>
> wrote:
>>
>> hello,
>>
>> 9160 is probably the port to use if you use the default config. >>
>> - Pierre
>>
>> On Apr 10, 2012, at 7:26 AM, puneet loya <puneetloya@gmail.com> wrote: >>
>> > using System;
>> > using System.Collections.Generic;
>> > using System.Linq;
>> > using System.Text;
>> > using Thrift.Collections;
>> > using Thrift.Protocol;
>> > using Thrift.Transport;
>> > using Apache.Cassandra;
>> >
>> > namespace ConsoleApplication1
>> > {
>> > =A0 =A0 class Program
>> > =A0 =A0 {
>> > =A0 =A0 =A0 =A0 static void Main(string[] args)
>> > =A0 =A0 =A0 =A0 {
>> > =A0 =A0 =A0 =A0 =A0 =A0 TTransport transport=3Dnull;
>> > =A0 =A0 =A0 =A0 =A0 =A0 try
>> > =A0 =A0 =A0 =A0 =A0 =A0 {
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 transport =3D new TBufferedTr= ansport(new
>> > TSocket("127.0.0.1", 7000));
>> >
>> >
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 //if(buffered)
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // =A0 =A0 =A0 =A0 =A0 =A0tra= ns =3D new TBufferedTransport(trans as
>> > TStreamTransport);
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 //if (framed)
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 // =A0 =A0trans =3D new TFram= edTransport(trans);
>> >
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 TProtocol protocol =3D new TB= inaryProtocol(transport);
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Cassandra.Client client =3D n= ew
>> > Cassandra.Client(protocol);
>> >
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Console.WriteLine("Openi= ng connection");
>> >
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!transport.IsOpen)
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 transport.Open();
>> >
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 client.describe_keyspace(&quo= t;abc"); =A0 =A0 =A0 =A0 =A0 =A0 =A0 //
>> > Crashing at this point
>> >
>> > =A0 =A0 =A0 =A0 =A0 }
>> > =A0 =A0 =A0 =A0 =A0 =A0 catch (Exception ex)
>> > =A0 =A0 =A0 =A0 =A0 =A0 {
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Console.WriteLine(ex.Message)= ;
>> > =A0 =A0 =A0 =A0 =A0 =A0 }
>> > =A0 =A0 =A0 =A0 =A0 =A0 finally
>> > =A0 =A0 =A0 =A0 =A0 =A0 { if(transport!=3Dnull)
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 transport.Close(); }
>> > =A0 =A0 =A0 =A0 =A0 =A0 Console.ReadLine();
>> > =A0 =A0 =A0 =A0 }
>> > =A0 =A0 }
>> > }
>> >
>> > I m trying to interact with cassandra server(database) from .= net. For
>> > that i have referred two libraries i.e, apacheCassandra08.dll= and
>> > thrift.dll.. In the following piece of code the connection is= getting opened
>> > but when i m using client object it is giving an error statin= g "Cannot read,
>> > Remote side has closed".
>> >
>> > Can any1 help me out with this? Has any1 faced the same prob?=
>> >
>> >
>
>






--
= http://twitter.com/t= jake
--047d7b10cb6d60881304bd5280f2--