Reply
Explorer
Posts: 10
Registered: ‎02-03-2015

thrift command not found

Hi,

 

I have loaded the quick start VM and I am trying to generate C# files for talking to HBase via thrift.  I have enabled the HBase service and can find the Hbase.thrift file but when I try to run the command to generate the files I get "thrift: command not found".  Is there anything else I need to do?

 

http://blog.cloudera.com/blog/2013/09/how-to-use-the-hbase-thrift-interface-part-1/

 

Thanks

 

M

Cloudera Employee
Posts: 435
Registered: ‎07-12-2013

Re: thrift command not found

You need to install the thrift compiler. Although thrift is used for RPC in several of the services, the thrift compiler itself is not part of CDH and it's not on the VM by default. The VM is running CentOS 6, so the procedure outlined here is probably exactly what you need to get the thrift compiler: http://thrift.apache.org/docs/install/centos
Explorer
Posts: 10
Registered: ‎02-03-2015

Re: thrift command not found

Thanks that worked :)

 

I am now trying to generate the csharp files for use in a client project.

 

I have run the command but cannot find the generated files.

 

thrift -gen csharp usr/lib/hue/apps/hbase/thrift/Hbase.thrift

 

I don't understand why you need to go through this process in order to generate the files and why the files cannot be previously created. I feel like I am missing something but not sure (I am new to linux).

Cloudera Employee
Posts: 435
Registered: ‎07-12-2013

Re: thrift command not found

thrift -gen csharp usr/lib/hue/apps/hbase/thrift/Hbase.thrift

I assume you had the leading slash before 'usr' to make it an absolute path otherwise you get an error. But the command creates a 'gen-csharp' directory in your current working directory and the files are in there. It may have been hard to notice if you were still in the 'thrift' directory after installing thrift?

Explorer
Posts: 10
Registered: ‎02-03-2015

Re: thrift command not found

Thanks Sean,

 

I found a way to do it through VS in a Windows environment.  Not sure if there are any problems with this.

 

I downloaded the hbase.thrift file from

 

http://svn.apache.org/viewvc/hbase/trunk/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thr...

 

I installed the nuget package through visual studio which adds a reference to the Thrift.dll.  It also downloads the thrift-0.9.1 exe which you can use with the HBase.thrift file downloded to generate the C# files.  

 

It all seems to be working ok.

 

Thanks for your help much apreciated.