Change client protocols from BSON RPC to gRPC.

This commit changes the following protocols:

- binlog_player_protocol
- vtctl_client_protocol

The only BSON protocol left is vtgate pending the implementation of the
gRPC vtgate client.

Note that we originally added this change in
https://github.com/youtube/vitess/pull/1230

However, we reverted it because the Kubernetes tutorial and images were
out of sync. Therefore, this commit technically is the revert of the
revert.

Revert "Revert "Change protocol defaults to grpc.""

This reverts commit 5e5f40a04e.
This commit is contained in:
Michael Berlin 2015-10-23 13:46:52 -07:00
Родитель 597503d3ee
Коммит cf87989c51
6 изменённых файлов: 10 добавлений и 9 удалений

Просмотреть файл

@ -40,7 +40,7 @@ spec:
-log_dir $VTDATAROOT/tmp -log_dir $VTDATAROOT/tmp
-alsologtostderr -alsologtostderr
-port 15000 -port 15000
-service_map 'bsonrpc-vt-vtctl' -service_map 'grpc-vtctl'
-topo_implementation etcd -topo_implementation etcd
-tablet_protocol grpc -tablet_protocol grpc
-tablet_manager_protocol grpc -tablet_manager_protocol grpc

Просмотреть файл

@ -22,7 +22,7 @@ $VTROOT/bin/vtctld -debug -templates $VTTOP/go/cmd/vtctld/templates \
-web_dir $VTTOP/web/vtctld \ -web_dir $VTTOP/web/vtctld \
-tablet_protocol grpc \ -tablet_protocol grpc \
-tablet_manager_protocol grpc \ -tablet_manager_protocol grpc \
-service_map 'bsonrpc-vt-vtctl' \ -service_map 'grpc-vtctl' \
-backup_storage_implementation file \ -backup_storage_implementation file \
-file_backup_storage_root $VTDATAROOT/backups \ -file_backup_storage_root $VTDATAROOT/backups \
-log_dir $VTDATAROOT/tmp -port $port > $VTDATAROOT/tmp/vtctld.out 2>&1 & -log_dir $VTDATAROOT/tmp -port $port > $VTDATAROOT/tmp/vtctld.out 2>&1 &

Просмотреть файл

@ -22,7 +22,7 @@ import (
This file contains the API and registration mechanism for binlog player client. This file contains the API and registration mechanism for binlog player client.
*/ */
var binlogPlayerProtocol = flag.String("binlog_player_protocol", "gorpc", "the protocol to download binlogs from a vttablet") var binlogPlayerProtocol = flag.String("binlog_player_protocol", "grpc", "the protocol to download binlogs from a vttablet")
var binlogPlayerConnTimeout = flag.Duration("binlog_player_conn_timeout", 5*time.Second, "binlog player connection timeout") var binlogPlayerConnTimeout = flag.Duration("binlog_player_conn_timeout", 5*time.Second, "binlog player connection timeout")
// ErrFunc is a return value for streaming events // ErrFunc is a return value for streaming events

Просмотреть файл

@ -15,8 +15,8 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
) )
// VtctlClientProtocol specifices which RPC client implementation should be used. // vtctlClientProtocol specifices which RPC client implementation should be used.
var VtctlClientProtocol = flag.String("vtctl_client_protocol", "gorpc", "the protocol to use to talk to the vtctl server") var vtctlClientProtocol = flag.String("vtctl_client_protocol", "grpc", "the protocol to use to talk to the vtctl server")
// ErrFunc is returned by streaming queries to get the error // ErrFunc is returned by streaming queries to get the error
type ErrFunc func() error type ErrFunc func() error
@ -58,9 +58,9 @@ func UnregisterFactoryForTest(name string) {
// New allows a user of the client library to get its implementation. // New allows a user of the client library to get its implementation.
func New(addr string, connectTimeout time.Duration) (VtctlClient, error) { func New(addr string, connectTimeout time.Duration) (VtctlClient, error) {
factory, ok := factories[*VtctlClientProtocol] factory, ok := factories[*vtctlClientProtocol]
if !ok { if !ok {
return nil, fmt.Errorf("unknown vtctl client protocol: %v", *VtctlClientProtocol) return nil, fmt.Errorf("unknown vtctl client protocol: %v", *vtctlClientProtocol)
} }
return factory(addr, connectTimeout) return factory(addr, connectTimeout)
} }

Просмотреть файл

@ -5,6 +5,7 @@
package testlib package testlib
import ( import (
"flag"
"fmt" "fmt"
"net" "net"
"testing" "testing"
@ -24,7 +25,7 @@ import (
func init() { func init() {
// make sure we use the right protocol // make sure we use the right protocol
*vtctlclient.VtctlClientProtocol = "grpc" flag.Set("vtctl_client_protocol", "grpc")
} }
// VtctlPipe is a vtctl server based on a topo server, and a client that // VtctlPipe is a vtctl server based on a topo server, and a client that

Просмотреть файл

@ -12,7 +12,7 @@ class ProtocolsFlavor(object):
"""Base class for protocols flavor.""" """Base class for protocols flavor."""
def binlog_player_protocol(self): def binlog_player_protocol(self):
"""Tdthe binlog player protocol between vttablets, in go.""" """The binlog player protocol between vttablets, in go."""
raise NotImplementedError('Not implemented in the base class') raise NotImplementedError('Not implemented in the base class')
def binlog_player_python_protocol(self): def binlog_player_python_protocol(self):