module
Version:
v0.0.0-...-90d5307
Opens a new window with list of versions in this module.
Published: Dec 18, 2023
License: MIT
Opens a new window with license information.
README
¶
go-tcp
Go Hbase library: https://github.com/chenjunpc2008/go-hbase
Usage
hbasePool
for example: example/pool-test
-
Use config parameters to create a new pool.
-
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 conn
c, err := hbPool.Get()
assert.Equal(t, nil, err)
// return
defer func() {
hbPool.Put(c)
}()
// do some work below
// ...
-
Don't forget to Close() the pool handle before close your application.
hbPool.Close()
Directories
¶
auto-gen
|
|
|
|
|
|
example
|
|
|
|
|
|
Package hbasepool hbase connection pool
|
Package hbasepool hbase connection pool |
Package util util methods
|
Package util util methods |
Click to show internal directories.
Click to hide internal directories.