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


Golang tmclient.TabletManagerClient类代码示例

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


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

示例1: agentRPCTestHealthStream

func agentRPCTestHealthStream(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	c, errFunc, err := client.HealthStream(ctx, ti)
	if err != nil {
		t.Fatalf("HealthStream failed: %v", err)
	}
	// channel should have one response, then closed
	hsr, ok := <-c
	if !ok {
		t.Fatalf("HealthStream got no response")
	}

	// close HealthStreamSynchronization so server side knows we
	// got the response, and it can send the error
	close(HealthStreamSynchronization)

	_, ok = <-c
	if ok {
		t.Fatalf("HealthStream wasn't closed")
	}
	err = errFunc()
	if !strings.Contains(err.Error(), testRegisterHealthStreamError) {
		t.Fatalf("HealthStream failed with the wrong error: %v", err)
	}
	compareError(t, "HealthStream", nil, *hsr, *testHealthStreamHealthStreamReply)
}
开发者ID:pengmingde,项目名称:vitess,代码行数:25,代码来源:test_agent_rpc.go

示例2: agentRPCTestExecuteFetchPanic

func agentRPCTestExecuteFetchPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	_, err := client.ExecuteFetchAsDba(ctx, ti, testExecuteFetchQuery, testExecuteFetchMaxRows, true, true, false)
	expectRPCWrapPanic(t, err)

	_, err = client.ExecuteFetchAsApp(ctx, ti, testExecuteFetchQuery, testExecuteFetchMaxRows, true)
	expectRPCWrapPanic(t, err)
}
开发者ID:BobbWu,项目名称:vitess,代码行数:7,代码来源:test_agent_rpc.go

示例3: agentRPCTestBackup

func agentRPCTestBackup(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	stream, err := client.Backup(ctx, ti, testBackupConcurrency)
	if err != nil {
		t.Fatalf("Backup failed: %v", err)
	}
	err = compareLoggedStuff(t, "Backup", stream, 10)
	compareError(t, "Backup", err, true, testBackupCalled)
}
开发者ID:aaijazi,项目名称:vitess,代码行数:8,代码来源:test_agent_rpc.go

示例4: agentRPCTestRestoreFromBackup

func agentRPCTestRestoreFromBackup(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
	stream, err := client.RestoreFromBackup(ctx, tablet)
	if err != nil {
		t.Fatalf("RestoreFromBackup failed: %v", err)
	}
	err = compareLoggedStuff(t, "RestoreFromBackup", stream, 10)
	compareError(t, "RestoreFromBackup", err, true, testRestoreFromBackupCalled)
}
开发者ID:yuer2008,项目名称:vitess,代码行数:8,代码来源:test_agent_rpc.go

示例5: agentRPCTestRefreshState

func agentRPCTestRefreshState(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
	err := client.RefreshState(ctx, tablet)
	if err != nil {
		t.Errorf("RefreshState failed: %v", err)
	}
	if !testRefreshStateCalled {
		t.Errorf("RefreshState didn't call the server side")
	}
}
开发者ID:yuer2008,项目名称:vitess,代码行数:9,代码来源:test_agent_rpc.go

示例6: agentRPCTestReloadSchema

func agentRPCTestReloadSchema(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
	err := client.ReloadSchema(ctx, tablet, "")
	if err != nil {
		t.Errorf("ReloadSchema failed: %v", err)
	}
	if !testReloadSchemaCalled {
		t.Errorf("ReloadSchema didn't call the server side")
	}
}
开发者ID:yuer2008,项目名称:vitess,代码行数:9,代码来源:test_agent_rpc.go

示例7: agentRpcTestMultiRestore

func agentRpcTestMultiRestore(t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	logChannel, errFunc, err := client.MultiRestore(ti, testMultiRestoreArgs, time.Minute)
	if err != nil {
		t.Fatalf("MultiRestore failed: %v", err)
	}
	compareLoggedStuff(t, "MultiRestore", logChannel, 1000)
	err = errFunc()
	compareError(t, "MultiRestore", err, true, testMultiRestoreCalled)
}
开发者ID:nangong92t,项目名称:go_src,代码行数:9,代码来源:test_agent_rpc.go

示例8: agentRpcTestMultiSnapshot

func agentRpcTestMultiSnapshot(t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	logChannel, errFunc, err := client.MultiSnapshot(ti, testMultiSnapshotArgs, time.Minute)
	if err != nil {
		t.Fatalf("MultiSnapshot failed: %v", err)
	}
	compareLoggedStuff(t, "MultiSnapshot", logChannel, 100)
	sr, err := errFunc()
	compareError(t, "MultiSnapshot", err, sr, testMultiSnapshotReply)
}
开发者ID:nangong92t,项目名称:go_src,代码行数:9,代码来源:test_agent_rpc.go

示例9: agentRpcTestReloadSchema

func agentRpcTestReloadSchema(t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	err := client.ReloadSchema(ti, time.Minute)
	if err != nil {
		t.Errorf("ReloadSchema failed: %v", err)
	}
	if !testReloadSchemaCalled {
		t.Errorf("ReloadSchema didn't call the server side")
	}
}
开发者ID:nangong92t,项目名称:go_src,代码行数:9,代码来源:test_agent_rpc.go

示例10: agentRPCTestBackupPanic

func agentRPCTestBackupPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	stream, err := client.Backup(ctx, ti, testBackupConcurrency)
	if err != nil {
		t.Fatalf("Backup failed: %v", err)
	}
	e, err := stream.Recv()
	if err == nil {
		t.Fatalf("Unexpected Backup logs: %v", e)
	}
	expectRPCWrapLockActionPanic(t, err)
}
开发者ID:aaijazi,项目名称:vitess,代码行数:11,代码来源:test_agent_rpc.go

示例11: agentRPCTestBackupPanic

func agentRPCTestBackupPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	logChannel, errFunc, err := client.Backup(ctx, ti, testBackupConcurrency)
	if err != nil {
		t.Fatalf("Backup failed: %v", err)
	}
	if e, ok := <-logChannel; ok {
		t.Fatalf("Unexpected Backup logs: %v", e)
	}
	err = errFunc()
	expectRPCWrapLockActionPanic(t, err)
}
开发者ID:BobbWu,项目名称:vitess,代码行数:11,代码来源:test_agent_rpc.go

示例12: agentRPCTestBackupPanic

func agentRPCTestBackupPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
	stream, err := client.Backup(ctx, tablet, testBackupConcurrency)
	if err != nil {
		t.Fatalf("Backup failed: %v", err)
	}
	e, err := stream.Recv()
	if err == nil {
		t.Fatalf("Unexpected Backup logs: %v", e)
	}
	expectHandleRPCPanic(t, "Backup", true /*verbose*/, err)
}
开发者ID:erzel,项目名称:vitess,代码行数:11,代码来源:test_agent_rpc.go

示例13: agentRPCTestRestoreFromBackupPanic

func agentRPCTestRestoreFromBackupPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
	stream, err := client.RestoreFromBackup(ctx, tablet)
	if err != nil {
		t.Fatalf("RestoreFromBackup failed: %v", err)
	}
	e, err := stream.Recv()
	if err == nil {
		t.Fatalf("Unexpected RestoreFromBackup logs: %v", e)
	}
	expectRPCWrapLockActionPanic(t, err)
}
开发者ID:yuer2008,项目名称:vitess,代码行数:11,代码来源:test_agent_rpc.go

示例14: agentRpcTestSetReadOnly

func agentRpcTestSetReadOnly(t *testing.T, client tmclient.TabletManagerClient, ti *topo.TabletInfo) {
	testSetReadOnlyExpectedValue = true
	err := client.SetReadOnly(ti, time.Minute)
	if err != nil {
		t.Errorf("SetReadOnly failed: %v", err)
	}
	testSetReadOnlyExpectedValue = false
	err = client.SetReadWrite(ti, time.Minute)
	if err != nil {
		t.Errorf("SetReadWrite failed: %v", err)
	}
}
开发者ID:nangong92t,项目名称:go_src,代码行数:12,代码来源:test_agent_rpc.go

示例15: agentRPCTestSetReadOnly

func agentRPCTestSetReadOnly(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) {
	testSetReadOnlyExpectedValue = true
	err := client.SetReadOnly(ctx, tablet)
	if err != nil {
		t.Errorf("SetReadOnly failed: %v", err)
	}
	testSetReadOnlyExpectedValue = false
	err = client.SetReadWrite(ctx, tablet)
	if err != nil {
		t.Errorf("SetReadWrite failed: %v", err)
	}
}
开发者ID:yuer2008,项目名称:vitess,代码行数:12,代码来源:test_agent_rpc.go


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