mysqldriver

package
v0.0.0-...-930013b Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADD_CHUNKSERVER_SQL = "INSERT INTO chunkserver (chunkserver_id, group_id, ip, port, status," +
		" total_free_space, max_free_space, pend_writes, writing_count, data_path, " +
		" reading_count, total_chunks, conn_counts, create_time) " +
		" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, now())"

	EXIST_CHUNKSERVER_SQL  = "SELECT * FROM chunkserver WHERE group_id = ? AND ip = ? AND port = ? AND deleted = 0"
	UPDATE_CHUNKSERVER_SQL = "UPDATE chunkserver SET total_free_space = ?, max_free_space = ?, pend_writes = ?, writing_count = ?, " +
		" data_path = ?, reading_count = ?, total_chunks = ?, conn_counts = ? " +
		" WHERE group_id = ? AND ip = ? AND port = ? AND deleted = 0"

	UPDATE_CHUNKSERVER_INFO_SQL = "UPDATE chunkserver SET total_free_space = ?, max_free_space = ?, pend_writes = ?, writing_count = ?, " +
		" data_path = ?, reading_count = ?, total_chunks = ?, conn_counts = ? , status = ?" +
		" WHERE group_id = ? AND ip = ? AND port = ? AND status = ? AND deleted = 0"

	UPDATE_CHUNKSERVER_STATUS_SQL = "UPDATE chunkserver SET  status = ?" +
		" WHERE group_id = ? AND ip = ? AND port = ? AND status = ? AND deleted = 0"

	UPDATE_CHUNKSERVER_NORMAL_STATUS = "UPDATE chunkserver SET abnormal_count = 0, status = ? WHERE ip = ? AND port = ? AND deleted = 0 AND status != ?"

	UPDATE_CHUNKSERVER_ERROR_STATUS = "UPDATE chunkserver SET status = ? WHERE ip = ? AND port = ? AND deleted = 0 AND  abnormal_count > ?"

	LIST_CHUNKSERVER_GROUPID_SQL = "SELECT chunkserver_id, group_id, ip, port, " +
		"status, global_status, total_free_space, max_free_space, pend_writes, " +
		"writing_count, data_path, reading_count, total_chunks, conn_counts " +
		" FROM chunkserver WHERE deleted = 0 and group_id=?"

	LIST_CHUNKSERVER_SQL = "SELECT chunkserver_id, group_id, ip, port, " +
		"status, global_status, total_free_space, max_free_space, pend_writes, " +
		"writing_count, data_path, reading_count, total_chunks, conn_counts " +
		" FROM chunkserver WHERE deleted = 0 "
)
View Source
const (
	UPDATE_FID_SQL = "UPDATE gen_fid SET fid = ? "
	GET_FID_SQL    = "SELECT fid FROM gen_fid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MySqlConn

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

func NewMySqlConn

func NewMySqlConn(ip string, port string, user string, passwd string, database string) (*MySqlConn, error)

func (*MySqlConn) AddChunkserver

func (conn *MySqlConn) AddChunkserver(chunkserver *metadata.Chunkserver) error

func (*MySqlConn) Close

func (conn *MySqlConn) Close() error

func (*MySqlConn) GetFid

func (conn *MySqlConn) GetFid() (uint64, error)

func (*MySqlConn) IsExistChunkserver

func (conn *MySqlConn) IsExistChunkserver(chunkserver *metadata.Chunkserver) (bool, error)

func (*MySqlConn) ListChunkserver

func (conn *MySqlConn) ListChunkserver() (metadata.Chunkservers, error)

func (*MySqlConn) ListChunkserverGroup

func (conn *MySqlConn) ListChunkserverGroup(groupId int) (metadata.Chunkservers, error)

func (*MySqlConn) SetMaxIdleConns

func (conn *MySqlConn) SetMaxIdleConns(n int)

func (*MySqlConn) SetMaxOpenConns

func (conn *MySqlConn) SetMaxOpenConns(n int)

func (*MySqlConn) UpdateChunkserverERROR

func (conn *MySqlConn) UpdateChunkserverERROR(ip string, port, status, count int) error

func (*MySqlConn) UpdateChunkserverInfo

func (conn *MySqlConn) UpdateChunkserverInfo(chunkserver *metadata.Chunkserver, preStatus int, status int) error

func (*MySqlConn) UpdateChunkserverNORMAL

func (conn *MySqlConn) UpdateChunkserverNORMAL(ip string, port, status, errStatus int) error

func (*MySqlConn) UpdateChunkserverStatus

func (conn *MySqlConn) UpdateChunkserverStatus(chunkserver *metadata.Chunkserver, preStatus int, status int) error

func (*MySqlConn) UpdateFid

func (conn *MySqlConn) UpdateFid(fid uint64) error

Jump to

Keyboard shortcuts

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