Documentation ¶
Index ¶
Constants ¶
View Source
const ( KB = 1 << (10 * iota) MB GB TB PB DefaultDataPartitionSize = 120 * GB TaskWorkerInterval = 1 )
View Source
const ( BlockCount = 1024 BlockSize = 65536 * 2 ReadBlockSize = BlockSize PerBlockCrcSize = 4 ExtentSize = BlockCount * BlockSize PacketHeaderSize = 57 BlockHeaderSize = 4096 )
View Source
const (
ConnectIdleTime = 30
)
View Source
const (
DefaultTinySizeLimit = 1 * MB // TODO explain tiny extent?
)
View Source
const MEMINFO = "/proc/meminfo"
Variables ¶
View Source
var (
ErrNoValidMaster = errors.New("no valid master")
)
Functions ¶
func GetMemInfo ¶
GetMemInfo returns the memory information.
Types ¶
type ConnectPool ¶
func NewConnectPool ¶
func NewConnectPool() (cp *ConnectPool)
func (*ConnectPool) GetConnect ¶
func (cp *ConnectPool) GetConnect(targetAddr string) (c *net.TCPConn, err error)
func (*ConnectPool) PutConnect ¶
func (cp *ConnectPool) PutConnect(c *net.TCPConn, forceClose bool)
type MasterHelper ¶
type MasterHelper interface { AddNode(address string) Nodes() []string Leader() string Request(method, path string, param map[string]string, body []byte) (data []byte, err error) }
MasterHelper defines the helper struct to manage the master.
func NewMasterHelper ¶
func NewMasterHelper() MasterHelper
NewMasterHelper returns a new MasterHelper instance.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) PutConnectObjectToPool ¶
Click to show internal directories.
Click to hide internal directories.