Skip to content
 
 

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

golang client of hbase (via thrift)

Install

The official thrift package is out of date, need install thrift4go first, then

go get github.com/sdming/goh

Usage

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

Files

  • \thrift
    thrift4go fork

  • \Hbase
    generated by thrift compiler

    thrift --gen go hbase-root/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift

  • \demo
    demo code of goh usage

Start/Stop thrift

#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

Issues

Changes

  • 1 kick off
  • 2 change thrift package from pomack/thrift4go to apesternikov/thrift4go

Links

License

Apache License v2.0

About

golang client of hbase (via thrift)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages