@@ -93,35 +93,37 @@ type VttabletProcess struct {
9393
9494// Setup starts vttablet process with required arguements
9595func (vttablet * VttabletProcess ) Setup () (err error ) {
96- flags := make (map [string ]string )
96+
97+ flags := map [string ]string {
98+ "--topo-implementation" : vttablet .TopoImplementation ,
99+ "--topo-global-server-address" : vttablet .TopoGlobalAddress ,
100+ "--topo-global-root" : vttablet .TopoGlobalRoot ,
101+ "--log_queries_to_file" : vttablet .FileToLogQueries ,
102+ "--tablet-path" : vttablet .TabletPath ,
103+ "--port" : fmt .Sprintf ("%d" , vttablet .Port ),
104+ "--grpc_port" : fmt .Sprintf ("%d" , vttablet .GrpcPort ),
105+ "--init_shard" : vttablet .Shard ,
106+ "--log_dir" : vttablet .LogDir ,
107+ "--tablet_hostname" : vttablet .TabletHostname ,
108+ "--init_keyspace" : vttablet .Keyspace ,
109+ "--init_tablet_type" : vttablet .TabletType ,
110+ "--health_check_interval" : fmt .Sprintf ("%ds" , vttablet .HealthCheckInterval ),
111+ "--backup_storage_implementation" : vttablet .BackupStorageImplementation ,
112+ "--file_backup_storage_root" : vttablet .FileBackupStorageRoot ,
113+ "--service_map" : vttablet .ServiceMap ,
114+ "--db_charset" : vttablet .Charset ,
115+ "--bind-address" : "127.0.0.1" ,
116+ "--grpc_bind_address" : "127.0.0.1" ,
117+ }
97118
98119 utils .SetFlagVariantsForTests (flags , "--topo-implementation" , vttablet .TopoImplementation )
99120 utils .SetFlagVariantsForTests (flags , "--topo-global-server-address" , vttablet .TopoGlobalAddress )
100121 utils .SetFlagVariantsForTests (flags , "--topo-global-root" , vttablet .TopoGlobalRoot )
101122
102- vttablet .proc = exec .Command (
103- vttablet .Binary ,
104- flags ["--topo-implementation" ],
105- flags ["--topo-global-server-address" ],
106- flags ["--topo-global-root" ],
107- "--log_queries_to_file" , vttablet .FileToLogQueries ,
108- "--tablet-path" , vttablet .TabletPath ,
109- "--port" , fmt .Sprintf ("%d" , vttablet .Port ),
110- "--grpc_port" , fmt .Sprintf ("%d" , vttablet .GrpcPort ),
111- "--init_shard" , vttablet .Shard ,
112- "--log_dir" , vttablet .LogDir ,
113- "--tablet_hostname" , vttablet .TabletHostname ,
114- "--init_keyspace" , vttablet .Keyspace ,
115- "--init_tablet_type" , vttablet .TabletType ,
116- "--health_check_interval" , fmt .Sprintf ("%ds" , vttablet .HealthCheckInterval ),
117- "--enable_replication_reporter" ,
118- "--backup_storage_implementation" , vttablet .BackupStorageImplementation ,
119- "--file_backup_storage_root" , vttablet .FileBackupStorageRoot ,
120- "--service_map" , vttablet .ServiceMap ,
121- "--db_charset" , vttablet .Charset ,
122- "--bind-address" , "127.0.0.1" ,
123- "--grpc_bind_address" , "127.0.0.1" ,
124- )
123+ vttablet .proc = exec .Command (vttablet .Binary , "--enable_replication_reporter" )
124+ for flag , value := range flags {
125+ vttablet .proc .Args = append (vttablet .proc .Args , flag , value )
126+ }
125127
126128 if * isCoverage {
127129 vttablet .proc .Args = append (vttablet .proc .Args , "--test.coverprofile=" + getCoveragePath ("vttablet.out" ))
0 commit comments