Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

hbase thrift2 golang client pool

License

NotificationsYou must be signed in to change notification settings

chenjunpc2008/go-hbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Hbase library:https://github.com/chenjunpc2008/go-hbase

Usage

hbasePool


for example:example/pool-test

  1. Use config parameters to create a new pool.

  2. Get() a conn object from pool handle, and don't forget to put it back(use Put()) after you done, otherwise the pool will run out of connections.

    cnf:= hbasepool.Config{Host:"hb-909",Port:9090,MaxIdle:2,MaxActive:1000,IdleTimeout:30*time.Minute,MaxConnLifetime:8*time.Hour,    }hbPool:=hbasepool.NewPool(cnf)// get hbase connc,err:=hbPool.Get()assert.Equal(t,nil,err)// returndeferfunc() {hbPool.Put(c)}()// do some work below// ...
  3. Don't forget to Close() the pool handle before close your application.

    hbPool.Close()

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp