tabletserver

package
v0.0.0-...-48d5904 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2015 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RC_DELETED = 1

	// MAX_KEY_LEN is a value less than memcache's limit of 250.
	MAX_KEY_LEN = 200

	// MAX_DATA_LEN prevents large rows from being inserted in rowcache.
	MAX_DATA_LEN = 8000
)

Variables

This section is empty.

Functions

func GetMaxPrefix

func GetMaxPrefix() int64

Types

type CachePool

type CachePool struct {
	DeleteExpiry uint64
	// contains filtered or unexported fields
}

func NewCachePool

func NewCachePool(name string, rowCacheConfig RowCacheConfig, queryTimeout time.Duration, idleTimeout time.Duration) *CachePool

func (*CachePool) Available

func (cp *CachePool) Available() int64

func (*CachePool) Capacity

func (cp *CachePool) Capacity() int64

func (*CachePool) Close

func (cp *CachePool) Close()

func (*CachePool) Get

func (cp *CachePool) Get(timeout time.Duration) *memcache.Connection

You must call Put after Get.

func (*CachePool) IdleTimeout

func (cp *CachePool) IdleTimeout() time.Duration

func (*CachePool) IsClosed

func (cp *CachePool) IsClosed() bool

func (*CachePool) MaxCap

func (cp *CachePool) MaxCap() int64

func (*CachePool) Open

func (cp *CachePool) Open()

func (*CachePool) Put

func (cp *CachePool) Put(conn *memcache.Connection)

func (*CachePool) ServeHTTP

func (cp *CachePool) ServeHTTP(response http.ResponseWriter, request *http.Request)

func (*CachePool) StatsJSON

func (cp *CachePool) StatsJSON() string

func (*CachePool) WaitCount

func (cp *CachePool) WaitCount() int64

func (*CachePool) WaitTime

func (cp *CachePool) WaitTime() time.Duration

type CreateCacheFunc

type CreateCacheFunc func() (*memcache.Connection, error)

type DirtyKeys

type DirtyKeys map[string]bool

func (DirtyKeys) Delete

func (dk DirtyKeys) Delete(key string)

Delete just keeps track of what needs to be deleted

type ExecPlan

type ExecPlan struct {
	*planbuilder.ExecPlan
	TableInfo *TableInfo

	QueryCount int64
	Time       time.Duration
	RowCount   int64
	ErrorCount int64
	// contains filtered or unexported fields
}

func (*ExecPlan) AddStats

func (ep *ExecPlan) AddStats(queryCount int64, duration time.Duration, rowCount, errorCount int64)

func (*ExecPlan) Size

func (*ExecPlan) Size() int

func (*ExecPlan) Stats

func (ep *ExecPlan) Stats() (queryCount int64, duration time.Duration, rowCount, errorCount int64)

type MemcacheStats

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

MemcacheStats exports the Memcache internal stats through stats package.

func NewMemcacheStats

func NewMemcacheStats(cachePool *CachePool, main, slabs, items bool) *MemcacheStats

NewMemcacheStats creates a new MemcacheStats based on given CachePool. main, slabs and items specify the categories of stats that need to be exported.

func (*MemcacheStats) Close

func (s *MemcacheStats) Close()

Close clears the variable values and stops exporting the stats.

func (*MemcacheStats) Open

func (s *MemcacheStats) Open()

Open starts exporting the stats.

type OverrideCacheDesc

type OverrideCacheDesc struct {
	Type   string
	Prefix string
	Table  string
}

type RCResult

type RCResult struct {
	Row mysql.RowValue
	Cas uint64
}

type RowCache

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

func NewRowCache

func NewRowCache(tableInfo *TableInfo, cachePool *CachePool) *RowCache

func (*RowCache) Delete

func (rc *RowCache) Delete(key string)

func (*RowCache) Get

func (rc *RowCache) Get(keys []string, tcs []schema.TableColumn) (results map[string]RCResult)

func (*RowCache) Set

func (rc *RowCache) Set(key string, row []byte, cas uint64)

type RowCacheConfig

type RowCacheConfig struct {
	Binary      string `json:"binary"`
	Memory      int    `json:"mem"`
	Socket      string `json:"socket"`
	TcpPort     int    `json:"port"`
	Connections int    `json:"connections"`
	Threads     int    `json:"threads"`
	LockPaged   bool   `json:"lock_paged"`
}

todo: copy from vitess

func (*RowCacheConfig) GetSubprocessFlags

func (c *RowCacheConfig) GetSubprocessFlags() []string

type SchemaInfo

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

func NewSchemaInfo

func NewSchemaInfo(rowCacheConf RowCacheConfig, dbAddr string, user, pwd, dbName string, overrides []SchemaOverride) *SchemaInfo

func (*SchemaInfo) Close

func (si *SchemaInfo) Close()

func (*SchemaInfo) CreateOrUpdateTable

func (si *SchemaInfo) CreateOrUpdateTable(tableName string)

func (*SchemaInfo) DropTable

func (si *SchemaInfo) DropTable(tableName string)

func (*SchemaInfo) Exec

func (si *SchemaInfo) Exec(sql string) (result *mysql.Result, err error)

func (*SchemaInfo) GetSchema

func (si *SchemaInfo) GetSchema() []*schema.Table

func (*SchemaInfo) GetTable

func (si *SchemaInfo) GetTable(tableName string) *TableInfo

func (*SchemaInfo) SetQueryCacheSize

func (si *SchemaInfo) SetQueryCacheSize(size int)

type SchemaOverride

type SchemaOverride struct {
	Name      string
	PKColumns []string
	Cache     *OverrideCacheDesc
}

type TableInfo

type TableInfo struct {
	Lock *lockring.LockRing
	*schema.Table
	Cache *RowCache
	// contains filtered or unexported fields
}

func NewTableInfo

func NewTableInfo(conn *mysql.MySqlConn, tableName string, tableType string, createTime sqltypes.Value,
	comment string, cachePool *CachePool) (ti *TableInfo, err error)

func (*TableInfo) SetPK

func (ti *TableInfo) SetPK(colnames []string) error

func (*TableInfo) Stats

func (ti *TableInfo) Stats() (hits, absent, misses, invalidations int64)

func (*TableInfo) StatsJSON

func (ti *TableInfo) StatsJSON() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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