pool

package
v0.0.0-...-d4c7a2f Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConnection

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

func (*BaseConnection) Begin

func (b *BaseConnection) Begin() error

func (*BaseConnection) Commit

func (b *BaseConnection) Commit() error

func (*BaseConnection) Exec

func (b *BaseConnection) Exec(query string) error

func (*BaseConnection) ID

func (b *BaseConnection) ID() uint64

func (*BaseConnection) Receive

func (b *BaseConnection) Receive() (pgproto.BackendMessage, error)

func (*BaseConnection) Rollback

func (b *BaseConnection) Rollback() error

func (*BaseConnection) Send

type BasePool

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

BasePool implements the Pool interface.

func (*BasePool) Begin

func (p *BasePool) Begin()

func (*BasePool) GetConnection

func (p *BasePool) GetConnection(dataNodeShardId uint64, txn bool) (Connection, error)

GetConnection returns a connection that is allocated to this executor's connection pool.

type Connection

type Connection interface {
	Begin() error
	Send(pgproto.FrontendMessage) error
	Receive() (pgproto.BackendMessage, error)
	ID() uint64
}

Connection represents a tunnel to and from a data node. It is a wrapper around the core.PoolConnection interface but when this connection is released it is returned to the executor's connection pool instead.

func NewConnection

func NewConnection(conn core.PoolConnection, pool *BasePool) Connection

type Pool

type Pool interface {
	Begin()
	GetConnection(dataNodeShardId uint64, txn bool) (Connection, error)
}

Pool is connection manager for the executor.

func NewPool

func NewPool(colony core.Colony, logger timber.Logger) Pool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳