C# Client for Hypertable

249 views
Skip to first unread message

vive...@gmail.com

unread,
May 12, 2009, 10:06:05 AM5/12/09
to Hypertable Development
Hi,

Is there any way to access Hypertable from my C# code? (My coding
environment is on Windows platform and i want to access Hypertable on
a Linux machine.)

Luke

unread,
May 12, 2009, 2:27:51 PM5/12/09
to Hypertable Development
Yeah, thrift supports C# client. But I personally haven't tested it,
as I don't have the environment.

You can run thrift -gen csharp -r Hql.thrift in the src/cc/
ThriftBroker directory and find client code in generated gen-csharp
directory.

http://wiki.apache.org/thrift/ThriftUsageC%23

Hope it helps, and report back :)

vive...@gmail.com

unread,
May 13, 2009, 2:11:03 AM5/13/09
to Hypertable Development
Thanks a lot Luke for your reply

Can you please clear some of my doubts

1. You said "run thrift -gen csharp -r Hql.thrift in the src/cc/
ThriftBroker", But there is no thrift.exe file in ThriftBroker
directory (I am talking about the ThriftBroker directory which is
created when i installed Hypertable)

2. I downloaded the Thrift code for C# from the link given by you, but
the solution doesnt open. I opened the solution in notepad and found
the project over there. I created the separate solution by adding all
those project. There are some compilation errors in the project
(espacially in ThriftMSBuildTask, Properties needs to be implemented),
but is it really matters because "Thrift" project has been
successfully built and i got the Thrift.dll. Which i can use in my C#
application.

3. Is there any documentation available for Thrift usage?

I am new to Hypertable, thats why you may find my doubts silliy :)
Please help me!!

Luke

unread,
May 13, 2009, 5:17:22 PM5/13/09
to Hypertable Development
vive...@gmail.com wrote:
> Thanks a lot Luke for your reply
>
> Can you please clear some of my doubts
>
> 1. You said "run thrift -gen csharp -r Hql.thrift in the src/cc/
> ThriftBroker", But there is no thrift.exe file in ThriftBroker
> directory (I am talking about the ThriftBroker directory which is
> created when i installed Hypertable)

You need to install thrift (from the links in README) on both client
and server. 'thrift' in the command line is the IDL (interface
definition language) compiler from the thrift package.

src/cc/ThriftBroker/*.thrift are the IDL files. The compiler should
work on both platforms. You can also generate gen-csharp files on
Linux and copy them to Windows.

> 2. I downloaded the Thrift code for C# from the link given by you, but
> the solution doesnt open. I opened the solution in notepad and found
> the project over there. I created the separate solution by adding all
> those project. There are some compilation errors in the project
> (espacially in ThriftMSBuildTask, Properties needs to be implemented),
> but is it really matters because "Thrift" project has been
> successfully built and i got the Thrift.dll. Which i can use in my C#
> application.
>
> 3. Is there any documentation available for Thrift usage?

For thrift in general: http://wiki.apache.org/thrift/FrontPage
For thrift c# examples: checkout the tutorial directory in the thrift
package.
and of course: http://www.google.com/search?q=thrift+c%23+examples

For Hypertable thrift client interface: http://hypertable.org/thrift-api-ref/index.html

> I am new to Hypertable, thats why you may find my doubts silliy :)
> Please help me!!

I'm new to C#, so YMMV :)

vive...@gmail.com

unread,
May 14, 2009, 10:50:13 AM5/14/09
to Hypertable Development
Thanks Luke,
Your post helped a lot.
But here i come with new doubts :)

1. As you said, "thrift compiler should work on both the platforms",
does it mean that i should install Thrift Compiler on both the
machine? Or it is just needed at client end(Windows platform).

2. Extension of the previous question, do i need to have any thrift
server application which will be listening to thrift client calls so
that it can forward those calls to Hypertable database?

3. Can i retrieve data from Hypertable by writing queries in my client
code? How do i insert/update information about an entity (lets say
Employee entity, and information like name, designation) using APIs
provided by the thrift client interface?

Thanks

Luke

unread,
May 14, 2009, 1:15:00 PM5/14/09
to Hypertable Development
On May 14, 7:50 am, "vivek8...@gmail.com" <vivek8...@gmail.com> wrote:
> Thanks Luke,
> Your post helped a lot.
> But here i come with new doubts :)
>
> 1. As you said, "thrift compiler should work on both the platforms",
> does it mean that i should install Thrift Compiler on both the
> machine? Or it is just needed at client end(Windows platform).

Thrift package comes with both libraries and compiler. Compiler is
needed once on either platform. Thrift libraries are required on both
client and server.

> 2. Extension of the previous question, do i need to have any thrift
> server application which will be listening to thrift client calls so
> that it can forward those calls to Hypertable database?

If you install thrift on server, the Hypertable build process
(specifically cmake ...) will detect it and build ThriftBroker, which
is the thrift server that your client (and any other thrift clients in
different languages) connects to.

> 3. Can i retrieve data from Hypertable by writing queries in my client
> code? How do i insert/update information about an entity (lets say
> Employee entity, and information like name, designation) using APIs
> provided by the thrift client interface?

Of course, that's the idea.

__Luke

vive...@gmail.com

unread,
May 15, 2009, 10:25:55 AM5/15/09
to Hypertable Development
Hi Luke,

Please tell me how do i fire HQL queries through any client code?

Thanks

Vivek

Hiram Abiff

unread,
Aug 27, 2014, 3:35:31 PM8/27/14
to hyperta...@googlegroups.com
Yes, there is my project here, using the Thrift-API:

Reply all
Reply to author
Forward
0 new messages