golang client of hbase (via thrift)
The official thrift package is out of date, need install thrift4go first, then
go get github.com/sdming/goh
address := "192.168.17.129:9090"
client, err := goh.NewTcpClient(address, goh.TBinaryProtocol, false)
if err != nil {
fmt.Println(err)
return
}
if err = client.Open(); err != nil {
fmt.Println(err)
return
}
defer client.Close()
fmt.Println(client.IsTableEnabled(table))
fmt.Println(client.DisableTable(table))
fmt.Println(client.EnableTable(table))
fmt.Println(client.Compact(table))
\demo\client.go for all api example
-
\thrift
thrift4go fork -
\Hbase
generated by thrift compilerthrift --gen go hbase-root/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift
-
\demo
demo code of goh usage
#start
./bin/hbase-daemon.sh start thrift
#set parameter
./bin/hbase-daemon.sh start thrift –threadpool -m 200 -w 500
#stop
./bin/hbase-daemon.sh stop thrift
#set HEAPSIZE (conf/hbase-env.sh)
export HBASE_HEAPSIZE=1000MB
- pomack/thrift4go#61
- TScan doesn't work if FilterString is not empty string
- 1 kick off
- 2 change thrift package from pomack/thrift4go to apesternikov/thrift4go
- http://wiki.apache.org/hadoop/Hbase/ThriftApi
- http://hbase.apache.org/book/thrift.html
- http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/thrift/package-summary.html
- https://github.com/pomack/thrift4go
- https://github.com/apesternikov/thrift4go
- https://github.com/samuel/go-thrift
Apache License v2.0