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