pool

package
v0.0.0-...-941e108 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlumeClientPool

type FlumeClientPool struct {
	// contains filtered or unexported fields
}

flume连接池

func (*FlumeClientPool) ActivePoolSize

func (self *FlumeClientPool) ActivePoolSize() int

func (*FlumeClientPool) Destroy

func (self *FlumeClientPool) Destroy()

func (*FlumeClientPool) Get

func (self *FlumeClientPool) Get(timeout time.Duration) (*client.FlumeClient, error)

func (*FlumeClientPool) GetHostPort

func (self *FlumeClientPool) GetHostPort() config.HostPort

func (*FlumeClientPool) MonitorPool

func (self *FlumeClientPool) MonitorPool() (int, int, int)

func (*FlumeClientPool) PoolSize

func (self *FlumeClientPool) PoolSize() int

返回当前的poolszie

func (*FlumeClientPool) Release

func (self *FlumeClientPool) Release(fclient *client.FlumeClient) error

* * 归还当前的连接 *

func (*FlumeClientPool) ReleaseBroken

func (self *FlumeClientPool) ReleaseBroken(fclient *client.FlumeClient) error

释放坏的资源

type FlumePoolLink struct {
	FlumePool *FlumeClientPool

	BusinessLink *list.List //使用这个clientpool的业务名称

	Mutex sync.RWMutex //保证在并发情况下能够对list的操作安全
}

flumeclient的pool Link

func NewFlumePoolLink(hp config.HostPort) (error, *FlumePoolLink)

func (*FlumePoolLink) AttachBusiness

func (self *FlumePoolLink) AttachBusiness(business string)

将该business从link加入

func (*FlumePoolLink) DetachBusiness

func (self *FlumePoolLink) DetachBusiness(business string)

将该business从link重移除

func (*FlumePoolLink) IsAttached

func (self *FlumePoolLink) IsAttached(business string) bool

type IdleClient

type IdleClient struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL