當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。