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


Golang VTGateConn.SplitQuery方法代码示例

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


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

示例1: testSplitQuery

func testSplitQuery(t *testing.T, conn *vtgateconn.VTGateConn) {
	ctx := context.Background()
	qsl, err := conn.SplitQuery(ctx, splitQueryRequest.Keyspace, splitQueryRequest.Query, splitQueryRequest.SplitCount)
	if err != nil {
		t.Fatalf("SplitQuery failed: %v", err)
	}
	if !reflect.DeepEqual(qsl, splitQueryResult.Splits) {
		t.Errorf("SplitQuery returned worng result: got %v wanted %v", qsl, splitQueryResult.Splits)
	}
}
开发者ID:pranjal5215,项目名称:vitess,代码行数:10,代码来源:client.go

示例2: testEchoSplitQuery

func testEchoSplitQuery(t *testing.T, conn *vtgateconn.VTGateConn) {
	want := &pbg.SplitQueryResponse_Part{
		Query:        tproto.BoundQueryToProto3(echoPrefix+query+":split_column:123", bindVars),
		KeyRangePart: &pbg.SplitQueryResponse_KeyRangePart{Keyspace: keyspace},
	}
	got, err := conn.SplitQuery(context.Background(), keyspace, echoPrefix+query, bindVars, "split_column", 123)
	if err != nil {
		t.Fatalf("SplitQuery error: %v", err)
	}
	// For some reason, proto.Equal() is calling them unequal even though no diffs
	// are found.
	gotstr, wantstr := got[0].String(), want.String()
	if gotstr != wantstr {
		t.Errorf("SplitQuery() = %v, want %v", gotstr, wantstr)
	}
}
开发者ID:richarwu,项目名称:vitess,代码行数:16,代码来源:echo.go

示例3: testSplitQueryPanic

func testSplitQueryPanic(t *testing.T, conn *vtgateconn.VTGateConn) {
	ctx := context.Background()
	_, err := conn.SplitQuery(ctx, splitQueryRequest.Keyspace, splitQueryRequest.Query, splitQueryRequest.SplitCount)
	expectPanic(t, err)
}
开发者ID:pranjal5215,项目名称:vitess,代码行数:5,代码来源:client.go


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