当前位置: 首页>>代码示例>>Golang>>正文


Golang Mysqld.Cnf方法代码示例

本文整理汇总了Golang中github.com/youtube/vitess/go/vt/mysqlctl.Mysqld.Cnf方法的典型用法代码示例。如果您正苦于以下问题:Golang Mysqld.Cnf方法的具体用法?Golang Mysqld.Cnf怎么用?Golang Mysqld.Cnf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/youtube/vitess/go/vt/mysqlctl.Mysqld的用法示例。


在下文中一共展示了Mysqld.Cnf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Open

// Open runs the invalidation loop.
func (rci *RowcacheInvalidator) Open(dbname string, mysqld *mysqlctl.Mysqld) {
	rp, err := mysqld.MasterStatus()
	if err != nil {
		panic(NewTabletError(FATAL, "Rowcache invalidator aborting: cannot determine replication position: %v", err))
	}
	if mysqld.Cnf().BinLogPath == "" {
		panic(NewTabletError(FATAL, "Rowcache invalidator aborting: binlog path not specified"))
	}

	ok := rci.svm.Go(func(_ *sync2.ServiceManager) {
		rci.mu.Lock()
		rci.dbname = dbname
		rci.mysqld = mysqld
		rci.evs = binlog.NewEventStreamer(dbname, mysqld.Cnf().BinLogPath)
		rci.GroupId.Set(rp.MasterLogGroupId)
		rci.mu.Unlock()

		rci.run()

		rci.mu.Lock()
		rci.evs = nil
		rci.mu.Unlock()
	})
	if ok {
		log.Infof("Rowcache invalidator starting, dbname: %s, path: %s, logfile: %s, position: %d", dbname, mysqld.Cnf().BinLogPath, rp.MasterLogFile, rp.MasterLogPosition)
	} else {
		log.Infof("Rowcache invalidator already running")
	}
}
开发者ID:qman1989,项目名称:vitess,代码行数:30,代码来源:rowcache_invalidator.go

示例2: newBinlogFileStreamer

// newBinlogFileStreamer creates a BinlogStreamer.
//
// dbname specifes the db to stream events for.
func newBinlogFileStreamer(dbname string, mysqld *mysqlctl.Mysqld, startPos myproto.ReplicationPosition, sendTransaction sendTransactionFunc) BinlogStreamer {
	return &binlogFileStreamer{
		dbname:          dbname,
		dir:             path.Dir(mysqld.Cnf().BinLogPath),
		mysqld:          mysqld,
		startPos:        startPos,
		sendTransaction: sendTransaction,
	}
}
开发者ID:chinna1986,项目名称:vitess,代码行数:12,代码来源:binlog_file_streamer.go

示例3: Open

// Open runs the invalidation loop.
func (rci *RowcacheInvalidator) Open(dbname string, mysqld *mysqlctl.Mysqld) {
	rp, err := mysqld.MasterPosition()
	if err != nil {
		panic(NewTabletError(FATAL, "Rowcache invalidator aborting: cannot determine replication position: %v", err))
	}
	if mysqld.Cnf().BinLogPath == "" {
		panic(NewTabletError(FATAL, "Rowcache invalidator aborting: binlog path not specified"))
	}
	rci.dbname = dbname
	rci.mysqld = mysqld
	rci.SetPosition(rp)

	ok := rci.svm.Go(rci.run)
	if ok {
		log.Infof("Rowcache invalidator starting, dbname: %s, path: %s, position: %v", dbname, mysqld.Cnf().BinLogPath, rp)
	} else {
		log.Infof("Rowcache invalidator already running")
	}
}
开发者ID:nangong92t,项目名称:go_src,代码行数:20,代码来源:rowcache_invalidator.go


注:本文中的github.com/youtube/vitess/go/vt/mysqlctl.Mysqld.Cnf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。