You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by puneet loya <pu...@gmail.com> on 2012/04/10 07:26:11 UTC
cassandra and .net
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=null;
try
{
transport = new TBufferedTransport(new TSocket("127.0.0.1",
7000));
//if(buffered)
// trans = new TBufferedTransport(trans as
TStreamTransport);
//if (framed)
// trans = new TFramedTransport(trans);
TProtocol protocol = new TBinaryProtocol(transport);
Cassandra.Client client = 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!=null)
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?
Re: cassandra and .net
Posted by puneet loya <pu...@gmail.com>.
I checked logs of cassandra.. in the debug state..
I got this response
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(TBinaryProtocol.java:204)
at
org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2877)
at
org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.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: #<User allow_all groups=[]>
On Tue, Apr 10, 2012 at 12:03 PM, Pierre Chalamet <pi...@chalamet.net>wrote:
> **
> Another tentative : try using TFramedTransport with an instance of TSocket
> directly.
>
> - Pierre
> ------------------------------
> *From: * puneet loya <pu...@gmail.com>
> *Date: *Tue, 10 Apr 2012 11:06:22 +0530
> *To: *<us...@cassandra.apache.org>
> *ReplyTo: * user@cassandra.apache.org
> *Subject: *Re: cassandra and .net
>
> 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 <pi...@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 <pu...@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
>> > {
>> > class Program
>> > {
>> > static void Main(string[] args)
>> > {
>> > TTransport transport=null;
>> > try
>> > {
>> > transport = new TBufferedTransport(new
>> TSocket("127.0.0.1", 7000));
>> >
>> >
>> > //if(buffered)
>> > // trans = new TBufferedTransport(trans as
>> TStreamTransport);
>> > //if (framed)
>> > // trans = new TFramedTransport(trans);
>> >
>> > TProtocol protocol = new TBinaryProtocol(transport);
>> > Cassandra.Client client = 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!=null)
>> > 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?
>> >
>> >
>>
>
>
Re: cassandra and .net
Posted by Pierre Chalamet <pi...@chalamet.net>.
Another tentative : try using TFramedTransport with an instance of TSocket directly.
- Pierre
-----Original Message-----
From: puneet loya <pu...@gmail.com>
Date: Tue, 10 Apr 2012 11:06:22
To: <us...@cassandra.apache.org>
Reply-To: user@cassandra.apache.org
Subject: Re: cassandra and .net
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 <pi...@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 <pu...@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
> > {
> > class Program
> > {
> > static void Main(string[] args)
> > {
> > TTransport transport=null;
> > try
> > {
> > transport = new TBufferedTransport(new
> TSocket("127.0.0.1", 7000));
> >
> >
> > //if(buffered)
> > // trans = new TBufferedTransport(trans as
> TStreamTransport);
> > //if (framed)
> > // trans = new TFramedTransport(trans);
> >
> > TProtocol protocol = new TBinaryProtocol(transport);
> > Cassandra.Client client = 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!=null)
> > 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?
> >
> >
>
Re: cassandra and .net
Posted by Jake Luciani <ja...@gmail.com>.
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 <pu...@gmail.com> wrote:
> thankk uuuu :) :) it works :)
>
>
> On Tue, Apr 10, 2012 at 3:07 PM, Henrik Schröder <sk...@gmail.com>wrote:
>
>> 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
>> FramedTransport. Like this:
>>
>> TTransport transport = new TFramedTransport(new TSocket(host, port));
>>
>> TProtocol protocol = new TBinaryProtocol(transport);
>> var client = new Cassandra.Client(protocol);
>> transport.Open();
>> client.describe_keyspace("abc");
>>
>>
>> /Henrik
>>
>>
>> On Tue, Apr 10, 2012 at 11:23, puneet loya <pu...@gmail.com> 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(TBinaryProtocol.java:204)
>>> at
>>> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2877)
>>> at
>>> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.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: #<User allow_all groups=[]>
>>>
>>> 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 <pu...@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 <pu...@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
>>>> >> > {
>>>> >> > class Program
>>>> >> > {
>>>> >> > static void Main(string[] args)
>>>> >> > {
>>>> >> > TTransport transport=null;
>>>> >> > try
>>>> >> > {
>>>> >> > transport = new TBufferedTransport(new
>>>> >> > TSocket("127.0.0.1", 7000));
>>>> >> >
>>>> >> >
>>>> >> > //if(buffered)
>>>> >> > // trans = new TBufferedTransport(trans
>>>> as
>>>> >> > TStreamTransport);
>>>> >> > //if (framed)
>>>> >> > // trans = new TFramedTransport(trans);
>>>> >> >
>>>> >> > TProtocol protocol = new
>>>> TBinaryProtocol(transport);
>>>> >> > Cassandra.Client client = 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!=null)
>>>> >> > 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?
>>>> >> >
>>>> >> >
>>>> >
>>>> >
>>>>
>>>
>>>
>>
>
--
http://twitter.com/tjake
Re: cassandra and .net
Posted by puneet loya <pu...@gmail.com>.
thankk uuuu :) :) it works :)
On Tue, Apr 10, 2012 at 3:07 PM, Henrik Schröder <sk...@gmail.com> wrote:
> 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
> FramedTransport. Like this:
>
> TTransport transport = new TFramedTransport(new TSocket(host, port));
>
> TProtocol protocol = new TBinaryProtocol(transport);
> var client = new Cassandra.Client(protocol);
> transport.Open();
> client.describe_keyspace("abc");
>
>
> /Henrik
>
>
> On Tue, Apr 10, 2012 at 11:23, puneet loya <pu...@gmail.com> 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(TBinaryProtocol.java:204)
>> at
>> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2877)
>> at
>> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.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: #<User allow_all groups=[]>
>>
>> On Tue, Apr 10, 2012 at 11:24 AM, Maki Watanabe <wa...@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 <pu...@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 <pu...@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
>>> >> > {
>>> >> > class Program
>>> >> > {
>>> >> > static void Main(string[] args)
>>> >> > {
>>> >> > TTransport transport=null;
>>> >> > try
>>> >> > {
>>> >> > transport = new TBufferedTransport(new
>>> >> > TSocket("127.0.0.1", 7000));
>>> >> >
>>> >> >
>>> >> > //if(buffered)
>>> >> > // trans = new TBufferedTransport(trans
>>> as
>>> >> > TStreamTransport);
>>> >> > //if (framed)
>>> >> > // trans = new TFramedTransport(trans);
>>> >> >
>>> >> > TProtocol protocol = new TBinaryProtocol(transport);
>>> >> > Cassandra.Client client = 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!=null)
>>> >> > 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?
>>> >> >
>>> >> >
>>> >
>>> >
>>>
>>
>>
>
Re: cassandra and .net
Posted by Henrik Schröder <sk...@gmail.com>.
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
FramedTransport. Like this:
TTransport transport = new TFramedTransport(new TSocket(host, port));
TProtocol protocol = new TBinaryProtocol(transport);
var client = new Cassandra.Client(protocol);
transport.Open();
client.describe_keyspace("abc");
/Henrik
On Tue, Apr 10, 2012 at 11:23, puneet loya <pu...@gmail.com> 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(TBinaryProtocol.java:204)
> at
> org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2877)
> at
> org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.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: #<User allow_all groups=[]>
>
> On Tue, Apr 10, 2012 at 11:24 AM, Maki Watanabe <wa...@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 <pu...@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 <pi...@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 <pu...@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
>> >> > {
>> >> > class Program
>> >> > {
>> >> > static void Main(string[] args)
>> >> > {
>> >> > TTransport transport=null;
>> >> > try
>> >> > {
>> >> > transport = new TBufferedTransport(new
>> >> > TSocket("127.0.0.1", 7000));
>> >> >
>> >> >
>> >> > //if(buffered)
>> >> > // trans = new TBufferedTransport(trans as
>> >> > TStreamTransport);
>> >> > //if (framed)
>> >> > // trans = new TFramedTransport(trans);
>> >> >
>> >> > TProtocol protocol = new TBinaryProtocol(transport);
>> >> > Cassandra.Client client = 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!=null)
>> >> > 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?
>> >> >
>> >> >
>> >
>> >
>>
>
>
Re: cassandra and .net
Posted by puneet loya <pu...@gmail.com>.
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(TBinaryProtocol.java:204)
at
org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2877)
at
org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.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: #<User allow_all groups=[]>
On Tue, Apr 10, 2012 at 11:24 AM, Maki Watanabe <wa...@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 <pu...@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 <pi...@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 <pu...@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
> >> > {
> >> > class Program
> >> > {
> >> > static void Main(string[] args)
> >> > {
> >> > TTransport transport=null;
> >> > try
> >> > {
> >> > transport = new TBufferedTransport(new
> >> > TSocket("127.0.0.1", 7000));
> >> >
> >> >
> >> > //if(buffered)
> >> > // trans = new TBufferedTransport(trans as
> >> > TStreamTransport);
> >> > //if (framed)
> >> > // trans = new TFramedTransport(trans);
> >> >
> >> > TProtocol protocol = new TBinaryProtocol(transport);
> >> > Cassandra.Client client = 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!=null)
> >> > 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?
> >> >
> >> >
> >
> >
>
Re: cassandra and .net
Posted by puneet loya <pu...@gmail.com>.
is using cassandra from datastax community center software an issue for not
be able to connect with .net?
On Tue, Apr 10, 2012 at 11:24 AM, Maki Watanabe <wa...@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 <pu...@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 <pi...@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 <pu...@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
> >> > {
> >> > class Program
> >> > {
> >> > static void Main(string[] args)
> >> > {
> >> > TTransport transport=null;
> >> > try
> >> > {
> >> > transport = new TBufferedTransport(new
> >> > TSocket("127.0.0.1", 7000));
> >> >
> >> >
> >> > //if(buffered)
> >> > // trans = new TBufferedTransport(trans as
> >> > TStreamTransport);
> >> > //if (framed)
> >> > // trans = new TFramedTransport(trans);
> >> >
> >> > TProtocol protocol = new TBinaryProtocol(transport);
> >> > Cassandra.Client client = 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!=null)
> >> > 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?
> >> >
> >> >
> >
> >
>
Re: cassandra and .net
Posted by Maki Watanabe <wa...@gmail.com>.
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 <pu...@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 <pi...@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 <pu...@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
>> > {
>> > class Program
>> > {
>> > static void Main(string[] args)
>> > {
>> > TTransport transport=null;
>> > try
>> > {
>> > transport = new TBufferedTransport(new
>> > TSocket("127.0.0.1", 7000));
>> >
>> >
>> > //if(buffered)
>> > // trans = new TBufferedTransport(trans as
>> > TStreamTransport);
>> > //if (framed)
>> > // trans = new TFramedTransport(trans);
>> >
>> > TProtocol protocol = new TBinaryProtocol(transport);
>> > Cassandra.Client client = 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!=null)
>> > 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?
>> >
>> >
>
>
Re: cassandra and .net
Posted by puneet loya <pu...@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 <pi...@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 <pu...@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
> > {
> > class Program
> > {
> > static void Main(string[] args)
> > {
> > TTransport transport=null;
> > try
> > {
> > transport = new TBufferedTransport(new
> TSocket("127.0.0.1", 7000));
> >
> >
> > //if(buffered)
> > // trans = new TBufferedTransport(trans as
> TStreamTransport);
> > //if (framed)
> > // trans = new TFramedTransport(trans);
> >
> > TProtocol protocol = new TBinaryProtocol(transport);
> > Cassandra.Client client = 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!=null)
> > 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?
> >
> >
>
Re: cassandra and .net
Posted by Pierre Chalamet <pi...@chalamet.net>.
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 <pu...@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
> {
> class Program
> {
> static void Main(string[] args)
> {
> TTransport transport=null;
> try
> {
> transport = new TBufferedTransport(new TSocket("127.0.0.1", 7000));
>
>
> //if(buffered)
> // trans = new TBufferedTransport(trans as TStreamTransport);
> //if (framed)
> // trans = new TFramedTransport(trans);
>
> TProtocol protocol = new TBinaryProtocol(transport);
> Cassandra.Client client = 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!=null)
> 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?
>
>