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


Golang zk.NewMetaConn函数代码示例

本文整理汇总了Golang中github.com/youtube/vitess/go/zk.NewMetaConn函数的典型用法代码示例。如果您正苦于以下问题:Golang NewMetaConn函数的具体用法?Golang NewMetaConn怎么用?Golang NewMetaConn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: init

func init() {
	zconn := zk.NewMetaConn(false)
	zkts := zktopo.NewServer(zconn)
	zkoccconn := zk.NewMetaConn(true)
	zktsro := zktopo.NewServer(zkoccconn)
	db.Register("vtdb", &sDriver{zkts, false})
	db.Register("vtdb-zkocc", &sDriver{zktsro, false})
	db.Register("vtdb-streaming", &sDriver{zkts, true})
	db.Register("vtdb-zkocc-streaming", &sDriver{zktsro, true})
	db.Register("vtdb-streaming-zkocc", &sDriver{zktsro, true})
}
开发者ID:rrudduck,项目名称:golang-stuff,代码行数:11,代码来源:sharded.go

示例2: main

func main() {
	defer exit.Recover()
	defer logutil.Flush()

	zknsDomain := flag.String("zkns-domain", "", "The naming hierarchy portion to serve")
	zknsRoot := flag.String("zkns-root", "", "The root path from which to resolve")
	bindAddr := flag.String("bind-addr", ":31981", "Bind the debug http server")
	flag.Parse()

	if *bindAddr != "" {
		go func() {
			err := http.ListenAndServe(*bindAddr, nil)
			if err != nil {
				log.Errorf("ListenAndServe: %s", err)
				exit.Return(1)
			}
		}()
	}

	zconn := zk.NewMetaConn()
	fqdn := netutil.FullyQualifiedHostnameOrPanic()
	zr1 := newZknsResolver(zconn, fqdn, *zknsDomain, *zknsRoot)
	pd := &pdns{zr1}
	pd.Serve(os.Stdin, os.Stdout)
	os.Stdout.Close()
}
开发者ID:pranjal5215,项目名称:vitess,代码行数:26,代码来源:pdns.go

示例3: RegisterShardedDrivers

func RegisterShardedDrivers() {
	// default topo server
	ts := topo.GetServer()
	db.Register("vtdb", &sDriver{ts, false})
	db.Register("vtdb-streaming", &sDriver{ts, true})

	// forced zk topo server
	zconn := zk.NewMetaConn(false)
	zkts := zktopo.NewServer(zconn)
	db.Register("vtdb-zk", &sDriver{zkts, false})
	db.Register("vtdb-zk-streaming", &sDriver{zkts, true})

	// forced zkocc topo server
	zkoccconn := zk.NewMetaConn(true)
	zktsro := zktopo.NewServer(zkoccconn)
	db.Register("vtdb-zkocc", &sDriver{zktsro, false})
	db.Register("vtdb-zkocc-streaming", &sDriver{zktsro, true})
}
开发者ID:kingpro,项目名称:vitess,代码行数:18,代码来源:sharded.go

示例4: init

func init() {
	cmdMap = map[string]cmdFunc{
		"cat":   cmdCat,
		"chmod": cmdChmod,
		"cp":    cmdCp,
		"edit":  cmdEdit,
		"elock": cmdElock,
		"ls":    cmdLs,
		"qlock": cmdQlock,
		"rm":    cmdRm,
		"stat":  cmdStat,
		"touch": cmdTouch,
		"unzip": cmdUnzip,
		"wait":  cmdWait,
		"watch": cmdWatch,
		"zip":   cmdZip,
	}

	zconn = zk.NewMetaConn()
}
开发者ID:CowLeo,项目名称:vitess,代码行数:20,代码来源:zkcmd.go

示例5: init

func init() {
	opts.Description = doc
	cmdMap = map[string]cmdFunc{
		"cat":   cmdCat,
		"chmod": cmdChmod,
		"cp":    cmdCp,
		"edit":  cmdEdit,
		"elock": cmdElock,
		"ls":    cmdLs,
		"qlock": cmdQlock,
		"rm":    cmdRm,
		"stat":  cmdStat,
		"touch": cmdTouch,
		"unzip": cmdUnzip,
		"wait":  cmdWait,
		"watch": cmdWatch,
		"zip":   cmdZip,
	}
	log.SetFlags(0)

	zconn = zk.NewMetaConn(false)
}
开发者ID:ZhuoRoger,项目名称:vitess,代码行数:22,代码来源:zkcmd.go

示例6:

import (
	"flag"
	"reflect"
	"sync"
	"time"

	log "github.com/golang/glog"
	"github.com/youtube/vitess/go/vt/servenv"
	"github.com/youtube/vitess/go/vt/tabletserver"
	"github.com/youtube/vitess/go/zk"
	"launchpad.net/gozk/zookeeper"
)

var (
	// Actual ZkCustomRule object in charge of rule updates
	zkCustomRule = NewZkCustomRule(zk.NewMetaConn())
	// Commandline flag to specify rule path in zookeeper
	zkRulePath = flag.String("zkcustomrules", "", "zookeeper based custom rule path")
)

// Invalid rule version, used to mark invalid query rules
const InvalidQueryRulesVersion int64 = -1

// Zookeeper based custom rule source name
const ZkCustomRuleSource string = "ZK_CUSTOM_RULE"

// ZkCustomRule is Zookeeper backed implementation of CustomRuleManager
type ZkCustomRule struct {
	mu                    sync.Mutex
	path                  string
	zconn                 zk.Conn
开发者ID:ruiaylin,项目名称:vitess,代码行数:31,代码来源:zkcustomrule.go

示例7: init

func init() {
	zconn := zk.NewMetaConn()
	topo.RegisterServer("zookeeper", &Server{zconn: zconn})
}
开发者ID:jmptrader,项目名称:vitess,代码行数:4,代码来源:server.go

示例8: init

func init() {
	zconn := zk.NewMetaConn()
	stats.PublishJSONFunc("ZkMetaConn", zconn.String)
	topo.RegisterServer("zookeeper", &Server{zconn: zconn})
}
开发者ID:richarwu,项目名称:vitess,代码行数:5,代码来源:server.go

示例9: init

func init() {
	zkoccconn := zk.NewMetaConn(true)
	topo.RegisterServer("zkocc", zktopo.NewServer(zkoccconn))
}
开发者ID:chinna1986,项目名称:vitess,代码行数:4,代码来源:plugin_zkocctopo.go

示例10: init

func init() {
	zconn := zk.NewMetaConn(false)
	stats.PublishJSONFunc("ZkMetaConn", zconn.String)
	topo.RegisterServer("zookeeper", NewServer(zconn))
}
开发者ID:chinna1986,项目名称:vitess,代码行数:5,代码来源:server.go

示例11: init

func init() {
	zconn := zk.NewMetaConn(false)
	expvar.Publish("ZkMetaConn", zconn)
	topo.RegisterServer("zookeeper", NewServer(zconn))
}
开发者ID:rrudduck,项目名称:golang-stuff,代码行数:5,代码来源:server.go


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