wget http://archive.apache.org/dist/thrift/0.8.0/thrift-0.8.0.tar.gz
//下载thrift插件
tar zxvf thrift-0.8.0.tar.gz
//解压thrift
然后进行配置和编译
#./configure --with-cpp=no --with-ruby=no#make#make install
//检查是否编译完成
thrift
file
Options:
-version Print the compiler version
-o dir Set the output directoryfor gen-* packages
(default: current directory)
-out dir Set the ouput location for generated files.
(no gen-* folder will be created)
-I dir Add adirectorytothe list ofdirectories
searched forinclude directives
-nowarn Suppress all compiler warnings (BAD!)
-strict Strict compiler warnings on
-v[erbose] Verbose mode
-r[ecurse] Also generate included files
-debug Parse debug trace tostdout--allow-neg-keys Allow negative field keys (Used to preserve protocol
compatibility with older .thrift files)
--allow-64bit-consts Do not print warnings about using 64-bit constants--gen STR Generate code with a dynamically-registered generator.
STR has the form language[:key1=val1[,key2,[key3=val3]]].
Keys and values are options passed tothe generator.
Many options will notrequire values.
Available generators (and options):
as3 (AS3):
bindable: Add [bindable] metadata to all the struct classes.
c_glib (C, using GLib):
cocoa (Cocoa):
log_unexpected: Log every timean unexpected field ID or type is encountered.
cpp (C++):
cob_style: Generate "Continuation OBject"-style classes.
no_client_completion:
Omit calls to completion__() in CobClient class.
templates: Generate templatized reader/writer methods.
pure_enums: Generate pure enums instead of wrapper classes.
dense: Generate type specifications forthe dense protocol.
include_prefix: Use full include paths in generated files.
csharp (C#):
delphi (delphi):
ansistr_binary: Use AnsiString as binary properties.
erl (Erlang):
go (Go):
hs (Haskell):
html (HTML):
java (Java):
beans: Members will be private, and setter methods will return void.
private-members: Members will be private, but setter methods will return'this' like usual.
nocamel: Do not use CamelCase field accessors with beans.
hashcode: Generate quality hashCode methods.
android_legacy: Do not use java.io.IOException(throwable) (available for Android 2.3and above).
java5: Generate Java 1.5 compliant code (includes android_legacy flag).
javame (Java ME):
js (java script):
jquery: Generate jQuery compatible code.
node: Generate node.js compatible code.
ocaml (OCaml):
perl (Perl):
php (PHP):
inlined: Generate PHP inlined files
server: Generate PHP server stubs
autoload: Generate PHP with autoload
oop: Generate PHP with object oriented subclasses
rest: Generate PHP REST processors
namespace: Generate PHP namespaces as defined in PHP >= 5.3
py (Python):
new_style: Generate new-style classes.
twisted: Generate Twisted-friendly RPC services.
utf8strings: Encode/decode strings using utf8 inthe generated code.
slots: Generate code using slots for instance members.
dynamic: Generate dynamic code, less code generated but slower.
dynbase=CLS Derive generated classes from class CLS instead of TBase.
dynexc=CLS Derive generated exceptions from CLS instead of TExceptionBase.
dynimport='from foo.bar import CLS'
Add an import lineto generated code to find the dynbase class.
rb (Ruby):
st (Smalltalk):
xsd (XSD):
然后下载hbase源码:产生针对python的hbase的api
下载hbase源码
wget http://mirrors.hust.edu.cn/apache/hbase/0.98.24/hbase-0.98.24-src.tar.gz//下载hbase源码并且解压,进入hbase解压后的目录
find .-name Hbase.thrift
./hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift
//进入目录
cd ./hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift
//然后进行获取秘钥
thrift -gen py Hbase.thrift
//产生一个gen-py
Cp -raf gen -py/hbase/ home/badou/hbase_test