vitess.io/vitess@v0.16.2/go/vt/vtctl/localvtctldclient/client_gen.go (about) 1 // Code generated by localvtctldclient-generator. DO NOT EDIT. 2 3 /* 4 Copyright 2021 The Vitess Authors. 5 6 Licensed under the Apache License, Version 2.0 (the "License"); 7 you may not use this file except in compliance with the License. 8 You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 See the License for the specific language governing permissions and 16 limitations under the License. 17 */ 18 19 package localvtctldclient 20 21 import ( 22 "context" 23 24 "google.golang.org/grpc" 25 26 "vitess.io/vitess/go/vt/vtctl/internal/grpcshim" 27 28 vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" 29 vtctlservicepb "vitess.io/vitess/go/vt/proto/vtctlservice" 30 ) 31 32 // AddCellInfo is part of the vtctlservicepb.VtctldClient interface. 33 func (client *localVtctldClient) AddCellInfo(ctx context.Context, in *vtctldatapb.AddCellInfoRequest, opts ...grpc.CallOption) (*vtctldatapb.AddCellInfoResponse, error) { 34 return client.s.AddCellInfo(ctx, in) 35 } 36 37 // AddCellsAlias is part of the vtctlservicepb.VtctldClient interface. 38 func (client *localVtctldClient) AddCellsAlias(ctx context.Context, in *vtctldatapb.AddCellsAliasRequest, opts ...grpc.CallOption) (*vtctldatapb.AddCellsAliasResponse, error) { 39 return client.s.AddCellsAlias(ctx, in) 40 } 41 42 // ApplyRoutingRules is part of the vtctlservicepb.VtctldClient interface. 43 func (client *localVtctldClient) ApplyRoutingRules(ctx context.Context, in *vtctldatapb.ApplyRoutingRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.ApplyRoutingRulesResponse, error) { 44 return client.s.ApplyRoutingRules(ctx, in) 45 } 46 47 // ApplySchema is part of the vtctlservicepb.VtctldClient interface. 48 func (client *localVtctldClient) ApplySchema(ctx context.Context, in *vtctldatapb.ApplySchemaRequest, opts ...grpc.CallOption) (*vtctldatapb.ApplySchemaResponse, error) { 49 return client.s.ApplySchema(ctx, in) 50 } 51 52 // ApplyShardRoutingRules is part of the vtctlservicepb.VtctldClient interface. 53 func (client *localVtctldClient) ApplyShardRoutingRules(ctx context.Context, in *vtctldatapb.ApplyShardRoutingRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.ApplyShardRoutingRulesResponse, error) { 54 return client.s.ApplyShardRoutingRules(ctx, in) 55 } 56 57 // ApplyVSchema is part of the vtctlservicepb.VtctldClient interface. 58 func (client *localVtctldClient) ApplyVSchema(ctx context.Context, in *vtctldatapb.ApplyVSchemaRequest, opts ...grpc.CallOption) (*vtctldatapb.ApplyVSchemaResponse, error) { 59 return client.s.ApplyVSchema(ctx, in) 60 } 61 62 type backupStreamAdapter struct { 63 *grpcshim.BidiStream 64 ch chan *vtctldatapb.BackupResponse 65 } 66 67 func (stream *backupStreamAdapter) Recv() (*vtctldatapb.BackupResponse, error) { 68 select { 69 case <-stream.Context().Done(): 70 return nil, stream.Context().Err() 71 case <-stream.Closed(): 72 // Stream has been closed for future sends. If there are messages that 73 // have already been sent, receive them until there are no more. After 74 // all sent messages have been received, Recv will return the CloseErr. 75 select { 76 case msg := <-stream.ch: 77 return msg, nil 78 default: 79 return nil, stream.CloseErr() 80 } 81 case err := <-stream.ErrCh: 82 return nil, err 83 case msg := <-stream.ch: 84 return msg, nil 85 } 86 } 87 88 func (stream *backupStreamAdapter) Send(msg *vtctldatapb.BackupResponse) error { 89 select { 90 case <-stream.Context().Done(): 91 return stream.Context().Err() 92 case <-stream.Closed(): 93 return grpcshim.ErrStreamClosed 94 case stream.ch <- msg: 95 return nil 96 } 97 } 98 99 // Backup is part of the vtctlservicepb.VtctldClient interface. 100 func (client *localVtctldClient) Backup(ctx context.Context, in *vtctldatapb.BackupRequest, opts ...grpc.CallOption) (vtctlservicepb.Vtctld_BackupClient, error) { 101 stream := &backupStreamAdapter{ 102 BidiStream: grpcshim.NewBidiStream(ctx), 103 ch: make(chan *vtctldatapb.BackupResponse, 1), 104 } 105 go func() { 106 err := client.s.Backup(in, stream) 107 stream.CloseWithError(err) 108 }() 109 110 return stream, nil 111 } 112 113 type backupShardStreamAdapter struct { 114 *grpcshim.BidiStream 115 ch chan *vtctldatapb.BackupResponse 116 } 117 118 func (stream *backupShardStreamAdapter) Recv() (*vtctldatapb.BackupResponse, error) { 119 select { 120 case <-stream.Context().Done(): 121 return nil, stream.Context().Err() 122 case <-stream.Closed(): 123 // Stream has been closed for future sends. If there are messages that 124 // have already been sent, receive them until there are no more. After 125 // all sent messages have been received, Recv will return the CloseErr. 126 select { 127 case msg := <-stream.ch: 128 return msg, nil 129 default: 130 return nil, stream.CloseErr() 131 } 132 case err := <-stream.ErrCh: 133 return nil, err 134 case msg := <-stream.ch: 135 return msg, nil 136 } 137 } 138 139 func (stream *backupShardStreamAdapter) Send(msg *vtctldatapb.BackupResponse) error { 140 select { 141 case <-stream.Context().Done(): 142 return stream.Context().Err() 143 case <-stream.Closed(): 144 return grpcshim.ErrStreamClosed 145 case stream.ch <- msg: 146 return nil 147 } 148 } 149 150 // BackupShard is part of the vtctlservicepb.VtctldClient interface. 151 func (client *localVtctldClient) BackupShard(ctx context.Context, in *vtctldatapb.BackupShardRequest, opts ...grpc.CallOption) (vtctlservicepb.Vtctld_BackupShardClient, error) { 152 stream := &backupShardStreamAdapter{ 153 BidiStream: grpcshim.NewBidiStream(ctx), 154 ch: make(chan *vtctldatapb.BackupResponse, 1), 155 } 156 go func() { 157 err := client.s.BackupShard(in, stream) 158 stream.CloseWithError(err) 159 }() 160 161 return stream, nil 162 } 163 164 // ChangeTabletType is part of the vtctlservicepb.VtctldClient interface. 165 func (client *localVtctldClient) ChangeTabletType(ctx context.Context, in *vtctldatapb.ChangeTabletTypeRequest, opts ...grpc.CallOption) (*vtctldatapb.ChangeTabletTypeResponse, error) { 166 return client.s.ChangeTabletType(ctx, in) 167 } 168 169 // CreateKeyspace is part of the vtctlservicepb.VtctldClient interface. 170 func (client *localVtctldClient) CreateKeyspace(ctx context.Context, in *vtctldatapb.CreateKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.CreateKeyspaceResponse, error) { 171 return client.s.CreateKeyspace(ctx, in) 172 } 173 174 // CreateShard is part of the vtctlservicepb.VtctldClient interface. 175 func (client *localVtctldClient) CreateShard(ctx context.Context, in *vtctldatapb.CreateShardRequest, opts ...grpc.CallOption) (*vtctldatapb.CreateShardResponse, error) { 176 return client.s.CreateShard(ctx, in) 177 } 178 179 // DeleteCellInfo is part of the vtctlservicepb.VtctldClient interface. 180 func (client *localVtctldClient) DeleteCellInfo(ctx context.Context, in *vtctldatapb.DeleteCellInfoRequest, opts ...grpc.CallOption) (*vtctldatapb.DeleteCellInfoResponse, error) { 181 return client.s.DeleteCellInfo(ctx, in) 182 } 183 184 // DeleteCellsAlias is part of the vtctlservicepb.VtctldClient interface. 185 func (client *localVtctldClient) DeleteCellsAlias(ctx context.Context, in *vtctldatapb.DeleteCellsAliasRequest, opts ...grpc.CallOption) (*vtctldatapb.DeleteCellsAliasResponse, error) { 186 return client.s.DeleteCellsAlias(ctx, in) 187 } 188 189 // DeleteKeyspace is part of the vtctlservicepb.VtctldClient interface. 190 func (client *localVtctldClient) DeleteKeyspace(ctx context.Context, in *vtctldatapb.DeleteKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.DeleteKeyspaceResponse, error) { 191 return client.s.DeleteKeyspace(ctx, in) 192 } 193 194 // DeleteShards is part of the vtctlservicepb.VtctldClient interface. 195 func (client *localVtctldClient) DeleteShards(ctx context.Context, in *vtctldatapb.DeleteShardsRequest, opts ...grpc.CallOption) (*vtctldatapb.DeleteShardsResponse, error) { 196 return client.s.DeleteShards(ctx, in) 197 } 198 199 // DeleteSrvVSchema is part of the vtctlservicepb.VtctldClient interface. 200 func (client *localVtctldClient) DeleteSrvVSchema(ctx context.Context, in *vtctldatapb.DeleteSrvVSchemaRequest, opts ...grpc.CallOption) (*vtctldatapb.DeleteSrvVSchemaResponse, error) { 201 return client.s.DeleteSrvVSchema(ctx, in) 202 } 203 204 // DeleteTablets is part of the vtctlservicepb.VtctldClient interface. 205 func (client *localVtctldClient) DeleteTablets(ctx context.Context, in *vtctldatapb.DeleteTabletsRequest, opts ...grpc.CallOption) (*vtctldatapb.DeleteTabletsResponse, error) { 206 return client.s.DeleteTablets(ctx, in) 207 } 208 209 // EmergencyReparentShard is part of the vtctlservicepb.VtctldClient interface. 210 func (client *localVtctldClient) EmergencyReparentShard(ctx context.Context, in *vtctldatapb.EmergencyReparentShardRequest, opts ...grpc.CallOption) (*vtctldatapb.EmergencyReparentShardResponse, error) { 211 return client.s.EmergencyReparentShard(ctx, in) 212 } 213 214 // ExecuteFetchAsApp is part of the vtctlservicepb.VtctldClient interface. 215 func (client *localVtctldClient) ExecuteFetchAsApp(ctx context.Context, in *vtctldatapb.ExecuteFetchAsAppRequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteFetchAsAppResponse, error) { 216 return client.s.ExecuteFetchAsApp(ctx, in) 217 } 218 219 // ExecuteFetchAsDBA is part of the vtctlservicepb.VtctldClient interface. 220 func (client *localVtctldClient) ExecuteFetchAsDBA(ctx context.Context, in *vtctldatapb.ExecuteFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteFetchAsDBAResponse, error) { 221 return client.s.ExecuteFetchAsDBA(ctx, in) 222 } 223 224 // ExecuteHook is part of the vtctlservicepb.VtctldClient interface. 225 func (client *localVtctldClient) ExecuteHook(ctx context.Context, in *vtctldatapb.ExecuteHookRequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteHookResponse, error) { 226 return client.s.ExecuteHook(ctx, in) 227 } 228 229 // FindAllShardsInKeyspace is part of the vtctlservicepb.VtctldClient interface. 230 func (client *localVtctldClient) FindAllShardsInKeyspace(ctx context.Context, in *vtctldatapb.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.FindAllShardsInKeyspaceResponse, error) { 231 return client.s.FindAllShardsInKeyspace(ctx, in) 232 } 233 234 // GetBackups is part of the vtctlservicepb.VtctldClient interface. 235 func (client *localVtctldClient) GetBackups(ctx context.Context, in *vtctldatapb.GetBackupsRequest, opts ...grpc.CallOption) (*vtctldatapb.GetBackupsResponse, error) { 236 return client.s.GetBackups(ctx, in) 237 } 238 239 // GetCellInfo is part of the vtctlservicepb.VtctldClient interface. 240 func (client *localVtctldClient) GetCellInfo(ctx context.Context, in *vtctldatapb.GetCellInfoRequest, opts ...grpc.CallOption) (*vtctldatapb.GetCellInfoResponse, error) { 241 return client.s.GetCellInfo(ctx, in) 242 } 243 244 // GetCellInfoNames is part of the vtctlservicepb.VtctldClient interface. 245 func (client *localVtctldClient) GetCellInfoNames(ctx context.Context, in *vtctldatapb.GetCellInfoNamesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetCellInfoNamesResponse, error) { 246 return client.s.GetCellInfoNames(ctx, in) 247 } 248 249 // GetCellsAliases is part of the vtctlservicepb.VtctldClient interface. 250 func (client *localVtctldClient) GetCellsAliases(ctx context.Context, in *vtctldatapb.GetCellsAliasesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetCellsAliasesResponse, error) { 251 return client.s.GetCellsAliases(ctx, in) 252 } 253 254 // GetFullStatus is part of the vtctlservicepb.VtctldClient interface. 255 func (client *localVtctldClient) GetFullStatus(ctx context.Context, in *vtctldatapb.GetFullStatusRequest, opts ...grpc.CallOption) (*vtctldatapb.GetFullStatusResponse, error) { 256 return client.s.GetFullStatus(ctx, in) 257 } 258 259 // GetKeyspace is part of the vtctlservicepb.VtctldClient interface. 260 func (client *localVtctldClient) GetKeyspace(ctx context.Context, in *vtctldatapb.GetKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.GetKeyspaceResponse, error) { 261 return client.s.GetKeyspace(ctx, in) 262 } 263 264 // GetKeyspaces is part of the vtctlservicepb.VtctldClient interface. 265 func (client *localVtctldClient) GetKeyspaces(ctx context.Context, in *vtctldatapb.GetKeyspacesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetKeyspacesResponse, error) { 266 return client.s.GetKeyspaces(ctx, in) 267 } 268 269 // GetPermissions is part of the vtctlservicepb.VtctldClient interface. 270 func (client *localVtctldClient) GetPermissions(ctx context.Context, in *vtctldatapb.GetPermissionsRequest, opts ...grpc.CallOption) (*vtctldatapb.GetPermissionsResponse, error) { 271 return client.s.GetPermissions(ctx, in) 272 } 273 274 // GetRoutingRules is part of the vtctlservicepb.VtctldClient interface. 275 func (client *localVtctldClient) GetRoutingRules(ctx context.Context, in *vtctldatapb.GetRoutingRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetRoutingRulesResponse, error) { 276 return client.s.GetRoutingRules(ctx, in) 277 } 278 279 // GetSchema is part of the vtctlservicepb.VtctldClient interface. 280 func (client *localVtctldClient) GetSchema(ctx context.Context, in *vtctldatapb.GetSchemaRequest, opts ...grpc.CallOption) (*vtctldatapb.GetSchemaResponse, error) { 281 return client.s.GetSchema(ctx, in) 282 } 283 284 // GetShard is part of the vtctlservicepb.VtctldClient interface. 285 func (client *localVtctldClient) GetShard(ctx context.Context, in *vtctldatapb.GetShardRequest, opts ...grpc.CallOption) (*vtctldatapb.GetShardResponse, error) { 286 return client.s.GetShard(ctx, in) 287 } 288 289 // GetShardRoutingRules is part of the vtctlservicepb.VtctldClient interface. 290 func (client *localVtctldClient) GetShardRoutingRules(ctx context.Context, in *vtctldatapb.GetShardRoutingRulesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetShardRoutingRulesResponse, error) { 291 return client.s.GetShardRoutingRules(ctx, in) 292 } 293 294 // GetSrvKeyspaceNames is part of the vtctlservicepb.VtctldClient interface. 295 func (client *localVtctldClient) GetSrvKeyspaceNames(ctx context.Context, in *vtctldatapb.GetSrvKeyspaceNamesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetSrvKeyspaceNamesResponse, error) { 296 return client.s.GetSrvKeyspaceNames(ctx, in) 297 } 298 299 // GetSrvKeyspaces is part of the vtctlservicepb.VtctldClient interface. 300 func (client *localVtctldClient) GetSrvKeyspaces(ctx context.Context, in *vtctldatapb.GetSrvKeyspacesRequest, opts ...grpc.CallOption) (*vtctldatapb.GetSrvKeyspacesResponse, error) { 301 return client.s.GetSrvKeyspaces(ctx, in) 302 } 303 304 // GetSrvVSchema is part of the vtctlservicepb.VtctldClient interface. 305 func (client *localVtctldClient) GetSrvVSchema(ctx context.Context, in *vtctldatapb.GetSrvVSchemaRequest, opts ...grpc.CallOption) (*vtctldatapb.GetSrvVSchemaResponse, error) { 306 return client.s.GetSrvVSchema(ctx, in) 307 } 308 309 // GetSrvVSchemas is part of the vtctlservicepb.VtctldClient interface. 310 func (client *localVtctldClient) GetSrvVSchemas(ctx context.Context, in *vtctldatapb.GetSrvVSchemasRequest, opts ...grpc.CallOption) (*vtctldatapb.GetSrvVSchemasResponse, error) { 311 return client.s.GetSrvVSchemas(ctx, in) 312 } 313 314 // GetTablet is part of the vtctlservicepb.VtctldClient interface. 315 func (client *localVtctldClient) GetTablet(ctx context.Context, in *vtctldatapb.GetTabletRequest, opts ...grpc.CallOption) (*vtctldatapb.GetTabletResponse, error) { 316 return client.s.GetTablet(ctx, in) 317 } 318 319 // GetTablets is part of the vtctlservicepb.VtctldClient interface. 320 func (client *localVtctldClient) GetTablets(ctx context.Context, in *vtctldatapb.GetTabletsRequest, opts ...grpc.CallOption) (*vtctldatapb.GetTabletsResponse, error) { 321 return client.s.GetTablets(ctx, in) 322 } 323 324 // GetTopologyPath is part of the vtctlservicepb.VtctldClient interface. 325 func (client *localVtctldClient) GetTopologyPath(ctx context.Context, in *vtctldatapb.GetTopologyPathRequest, opts ...grpc.CallOption) (*vtctldatapb.GetTopologyPathResponse, error) { 326 return client.s.GetTopologyPath(ctx, in) 327 } 328 329 // GetVSchema is part of the vtctlservicepb.VtctldClient interface. 330 func (client *localVtctldClient) GetVSchema(ctx context.Context, in *vtctldatapb.GetVSchemaRequest, opts ...grpc.CallOption) (*vtctldatapb.GetVSchemaResponse, error) { 331 return client.s.GetVSchema(ctx, in) 332 } 333 334 // GetVersion is part of the vtctlservicepb.VtctldClient interface. 335 func (client *localVtctldClient) GetVersion(ctx context.Context, in *vtctldatapb.GetVersionRequest, opts ...grpc.CallOption) (*vtctldatapb.GetVersionResponse, error) { 336 return client.s.GetVersion(ctx, in) 337 } 338 339 // GetWorkflows is part of the vtctlservicepb.VtctldClient interface. 340 func (client *localVtctldClient) GetWorkflows(ctx context.Context, in *vtctldatapb.GetWorkflowsRequest, opts ...grpc.CallOption) (*vtctldatapb.GetWorkflowsResponse, error) { 341 return client.s.GetWorkflows(ctx, in) 342 } 343 344 // InitShardPrimary is part of the vtctlservicepb.VtctldClient interface. 345 func (client *localVtctldClient) InitShardPrimary(ctx context.Context, in *vtctldatapb.InitShardPrimaryRequest, opts ...grpc.CallOption) (*vtctldatapb.InitShardPrimaryResponse, error) { 346 return client.s.InitShardPrimary(ctx, in) 347 } 348 349 // PingTablet is part of the vtctlservicepb.VtctldClient interface. 350 func (client *localVtctldClient) PingTablet(ctx context.Context, in *vtctldatapb.PingTabletRequest, opts ...grpc.CallOption) (*vtctldatapb.PingTabletResponse, error) { 351 return client.s.PingTablet(ctx, in) 352 } 353 354 // PlannedReparentShard is part of the vtctlservicepb.VtctldClient interface. 355 func (client *localVtctldClient) PlannedReparentShard(ctx context.Context, in *vtctldatapb.PlannedReparentShardRequest, opts ...grpc.CallOption) (*vtctldatapb.PlannedReparentShardResponse, error) { 356 return client.s.PlannedReparentShard(ctx, in) 357 } 358 359 // RebuildKeyspaceGraph is part of the vtctlservicepb.VtctldClient interface. 360 func (client *localVtctldClient) RebuildKeyspaceGraph(ctx context.Context, in *vtctldatapb.RebuildKeyspaceGraphRequest, opts ...grpc.CallOption) (*vtctldatapb.RebuildKeyspaceGraphResponse, error) { 361 return client.s.RebuildKeyspaceGraph(ctx, in) 362 } 363 364 // RebuildVSchemaGraph is part of the vtctlservicepb.VtctldClient interface. 365 func (client *localVtctldClient) RebuildVSchemaGraph(ctx context.Context, in *vtctldatapb.RebuildVSchemaGraphRequest, opts ...grpc.CallOption) (*vtctldatapb.RebuildVSchemaGraphResponse, error) { 366 return client.s.RebuildVSchemaGraph(ctx, in) 367 } 368 369 // RefreshState is part of the vtctlservicepb.VtctldClient interface. 370 func (client *localVtctldClient) RefreshState(ctx context.Context, in *vtctldatapb.RefreshStateRequest, opts ...grpc.CallOption) (*vtctldatapb.RefreshStateResponse, error) { 371 return client.s.RefreshState(ctx, in) 372 } 373 374 // RefreshStateByShard is part of the vtctlservicepb.VtctldClient interface. 375 func (client *localVtctldClient) RefreshStateByShard(ctx context.Context, in *vtctldatapb.RefreshStateByShardRequest, opts ...grpc.CallOption) (*vtctldatapb.RefreshStateByShardResponse, error) { 376 return client.s.RefreshStateByShard(ctx, in) 377 } 378 379 // ReloadSchema is part of the vtctlservicepb.VtctldClient interface. 380 func (client *localVtctldClient) ReloadSchema(ctx context.Context, in *vtctldatapb.ReloadSchemaRequest, opts ...grpc.CallOption) (*vtctldatapb.ReloadSchemaResponse, error) { 381 return client.s.ReloadSchema(ctx, in) 382 } 383 384 // ReloadSchemaKeyspace is part of the vtctlservicepb.VtctldClient interface. 385 func (client *localVtctldClient) ReloadSchemaKeyspace(ctx context.Context, in *vtctldatapb.ReloadSchemaKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.ReloadSchemaKeyspaceResponse, error) { 386 return client.s.ReloadSchemaKeyspace(ctx, in) 387 } 388 389 // ReloadSchemaShard is part of the vtctlservicepb.VtctldClient interface. 390 func (client *localVtctldClient) ReloadSchemaShard(ctx context.Context, in *vtctldatapb.ReloadSchemaShardRequest, opts ...grpc.CallOption) (*vtctldatapb.ReloadSchemaShardResponse, error) { 391 return client.s.ReloadSchemaShard(ctx, in) 392 } 393 394 // RemoveBackup is part of the vtctlservicepb.VtctldClient interface. 395 func (client *localVtctldClient) RemoveBackup(ctx context.Context, in *vtctldatapb.RemoveBackupRequest, opts ...grpc.CallOption) (*vtctldatapb.RemoveBackupResponse, error) { 396 return client.s.RemoveBackup(ctx, in) 397 } 398 399 // RemoveKeyspaceCell is part of the vtctlservicepb.VtctldClient interface. 400 func (client *localVtctldClient) RemoveKeyspaceCell(ctx context.Context, in *vtctldatapb.RemoveKeyspaceCellRequest, opts ...grpc.CallOption) (*vtctldatapb.RemoveKeyspaceCellResponse, error) { 401 return client.s.RemoveKeyspaceCell(ctx, in) 402 } 403 404 // RemoveShardCell is part of the vtctlservicepb.VtctldClient interface. 405 func (client *localVtctldClient) RemoveShardCell(ctx context.Context, in *vtctldatapb.RemoveShardCellRequest, opts ...grpc.CallOption) (*vtctldatapb.RemoveShardCellResponse, error) { 406 return client.s.RemoveShardCell(ctx, in) 407 } 408 409 // ReparentTablet is part of the vtctlservicepb.VtctldClient interface. 410 func (client *localVtctldClient) ReparentTablet(ctx context.Context, in *vtctldatapb.ReparentTabletRequest, opts ...grpc.CallOption) (*vtctldatapb.ReparentTabletResponse, error) { 411 return client.s.ReparentTablet(ctx, in) 412 } 413 414 type restoreFromBackupStreamAdapter struct { 415 *grpcshim.BidiStream 416 ch chan *vtctldatapb.RestoreFromBackupResponse 417 } 418 419 func (stream *restoreFromBackupStreamAdapter) Recv() (*vtctldatapb.RestoreFromBackupResponse, error) { 420 select { 421 case <-stream.Context().Done(): 422 return nil, stream.Context().Err() 423 case <-stream.Closed(): 424 // Stream has been closed for future sends. If there are messages that 425 // have already been sent, receive them until there are no more. After 426 // all sent messages have been received, Recv will return the CloseErr. 427 select { 428 case msg := <-stream.ch: 429 return msg, nil 430 default: 431 return nil, stream.CloseErr() 432 } 433 case err := <-stream.ErrCh: 434 return nil, err 435 case msg := <-stream.ch: 436 return msg, nil 437 } 438 } 439 440 func (stream *restoreFromBackupStreamAdapter) Send(msg *vtctldatapb.RestoreFromBackupResponse) error { 441 select { 442 case <-stream.Context().Done(): 443 return stream.Context().Err() 444 case <-stream.Closed(): 445 return grpcshim.ErrStreamClosed 446 case stream.ch <- msg: 447 return nil 448 } 449 } 450 451 // RestoreFromBackup is part of the vtctlservicepb.VtctldClient interface. 452 func (client *localVtctldClient) RestoreFromBackup(ctx context.Context, in *vtctldatapb.RestoreFromBackupRequest, opts ...grpc.CallOption) (vtctlservicepb.Vtctld_RestoreFromBackupClient, error) { 453 stream := &restoreFromBackupStreamAdapter{ 454 BidiStream: grpcshim.NewBidiStream(ctx), 455 ch: make(chan *vtctldatapb.RestoreFromBackupResponse, 1), 456 } 457 go func() { 458 err := client.s.RestoreFromBackup(in, stream) 459 stream.CloseWithError(err) 460 }() 461 462 return stream, nil 463 } 464 465 // RunHealthCheck is part of the vtctlservicepb.VtctldClient interface. 466 func (client *localVtctldClient) RunHealthCheck(ctx context.Context, in *vtctldatapb.RunHealthCheckRequest, opts ...grpc.CallOption) (*vtctldatapb.RunHealthCheckResponse, error) { 467 return client.s.RunHealthCheck(ctx, in) 468 } 469 470 // SetKeyspaceDurabilityPolicy is part of the vtctlservicepb.VtctldClient interface. 471 func (client *localVtctldClient) SetKeyspaceDurabilityPolicy(ctx context.Context, in *vtctldatapb.SetKeyspaceDurabilityPolicyRequest, opts ...grpc.CallOption) (*vtctldatapb.SetKeyspaceDurabilityPolicyResponse, error) { 472 return client.s.SetKeyspaceDurabilityPolicy(ctx, in) 473 } 474 475 // SetShardIsPrimaryServing is part of the vtctlservicepb.VtctldClient interface. 476 func (client *localVtctldClient) SetShardIsPrimaryServing(ctx context.Context, in *vtctldatapb.SetShardIsPrimaryServingRequest, opts ...grpc.CallOption) (*vtctldatapb.SetShardIsPrimaryServingResponse, error) { 477 return client.s.SetShardIsPrimaryServing(ctx, in) 478 } 479 480 // SetShardTabletControl is part of the vtctlservicepb.VtctldClient interface. 481 func (client *localVtctldClient) SetShardTabletControl(ctx context.Context, in *vtctldatapb.SetShardTabletControlRequest, opts ...grpc.CallOption) (*vtctldatapb.SetShardTabletControlResponse, error) { 482 return client.s.SetShardTabletControl(ctx, in) 483 } 484 485 // SetWritable is part of the vtctlservicepb.VtctldClient interface. 486 func (client *localVtctldClient) SetWritable(ctx context.Context, in *vtctldatapb.SetWritableRequest, opts ...grpc.CallOption) (*vtctldatapb.SetWritableResponse, error) { 487 return client.s.SetWritable(ctx, in) 488 } 489 490 // ShardReplicationAdd is part of the vtctlservicepb.VtctldClient interface. 491 func (client *localVtctldClient) ShardReplicationAdd(ctx context.Context, in *vtctldatapb.ShardReplicationAddRequest, opts ...grpc.CallOption) (*vtctldatapb.ShardReplicationAddResponse, error) { 492 return client.s.ShardReplicationAdd(ctx, in) 493 } 494 495 // ShardReplicationFix is part of the vtctlservicepb.VtctldClient interface. 496 func (client *localVtctldClient) ShardReplicationFix(ctx context.Context, in *vtctldatapb.ShardReplicationFixRequest, opts ...grpc.CallOption) (*vtctldatapb.ShardReplicationFixResponse, error) { 497 return client.s.ShardReplicationFix(ctx, in) 498 } 499 500 // ShardReplicationPositions is part of the vtctlservicepb.VtctldClient interface. 501 func (client *localVtctldClient) ShardReplicationPositions(ctx context.Context, in *vtctldatapb.ShardReplicationPositionsRequest, opts ...grpc.CallOption) (*vtctldatapb.ShardReplicationPositionsResponse, error) { 502 return client.s.ShardReplicationPositions(ctx, in) 503 } 504 505 // ShardReplicationRemove is part of the vtctlservicepb.VtctldClient interface. 506 func (client *localVtctldClient) ShardReplicationRemove(ctx context.Context, in *vtctldatapb.ShardReplicationRemoveRequest, opts ...grpc.CallOption) (*vtctldatapb.ShardReplicationRemoveResponse, error) { 507 return client.s.ShardReplicationRemove(ctx, in) 508 } 509 510 // SleepTablet is part of the vtctlservicepb.VtctldClient interface. 511 func (client *localVtctldClient) SleepTablet(ctx context.Context, in *vtctldatapb.SleepTabletRequest, opts ...grpc.CallOption) (*vtctldatapb.SleepTabletResponse, error) { 512 return client.s.SleepTablet(ctx, in) 513 } 514 515 // SourceShardAdd is part of the vtctlservicepb.VtctldClient interface. 516 func (client *localVtctldClient) SourceShardAdd(ctx context.Context, in *vtctldatapb.SourceShardAddRequest, opts ...grpc.CallOption) (*vtctldatapb.SourceShardAddResponse, error) { 517 return client.s.SourceShardAdd(ctx, in) 518 } 519 520 // SourceShardDelete is part of the vtctlservicepb.VtctldClient interface. 521 func (client *localVtctldClient) SourceShardDelete(ctx context.Context, in *vtctldatapb.SourceShardDeleteRequest, opts ...grpc.CallOption) (*vtctldatapb.SourceShardDeleteResponse, error) { 522 return client.s.SourceShardDelete(ctx, in) 523 } 524 525 // StartReplication is part of the vtctlservicepb.VtctldClient interface. 526 func (client *localVtctldClient) StartReplication(ctx context.Context, in *vtctldatapb.StartReplicationRequest, opts ...grpc.CallOption) (*vtctldatapb.StartReplicationResponse, error) { 527 return client.s.StartReplication(ctx, in) 528 } 529 530 // StopReplication is part of the vtctlservicepb.VtctldClient interface. 531 func (client *localVtctldClient) StopReplication(ctx context.Context, in *vtctldatapb.StopReplicationRequest, opts ...grpc.CallOption) (*vtctldatapb.StopReplicationResponse, error) { 532 return client.s.StopReplication(ctx, in) 533 } 534 535 // TabletExternallyReparented is part of the vtctlservicepb.VtctldClient interface. 536 func (client *localVtctldClient) TabletExternallyReparented(ctx context.Context, in *vtctldatapb.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*vtctldatapb.TabletExternallyReparentedResponse, error) { 537 return client.s.TabletExternallyReparented(ctx, in) 538 } 539 540 // UpdateCellInfo is part of the vtctlservicepb.VtctldClient interface. 541 func (client *localVtctldClient) UpdateCellInfo(ctx context.Context, in *vtctldatapb.UpdateCellInfoRequest, opts ...grpc.CallOption) (*vtctldatapb.UpdateCellInfoResponse, error) { 542 return client.s.UpdateCellInfo(ctx, in) 543 } 544 545 // UpdateCellsAlias is part of the vtctlservicepb.VtctldClient interface. 546 func (client *localVtctldClient) UpdateCellsAlias(ctx context.Context, in *vtctldatapb.UpdateCellsAliasRequest, opts ...grpc.CallOption) (*vtctldatapb.UpdateCellsAliasResponse, error) { 547 return client.s.UpdateCellsAlias(ctx, in) 548 } 549 550 // UpdateThrottlerConfig is part of the vtctlservicepb.VtctldClient interface. 551 func (client *localVtctldClient) UpdateThrottlerConfig(ctx context.Context, in *vtctldatapb.UpdateThrottlerConfigRequest, opts ...grpc.CallOption) (*vtctldatapb.UpdateThrottlerConfigResponse, error) { 552 return client.s.UpdateThrottlerConfig(ctx, in) 553 } 554 555 // Validate is part of the vtctlservicepb.VtctldClient interface. 556 func (client *localVtctldClient) Validate(ctx context.Context, in *vtctldatapb.ValidateRequest, opts ...grpc.CallOption) (*vtctldatapb.ValidateResponse, error) { 557 return client.s.Validate(ctx, in) 558 } 559 560 // ValidateKeyspace is part of the vtctlservicepb.VtctldClient interface. 561 func (client *localVtctldClient) ValidateKeyspace(ctx context.Context, in *vtctldatapb.ValidateKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.ValidateKeyspaceResponse, error) { 562 return client.s.ValidateKeyspace(ctx, in) 563 } 564 565 // ValidateSchemaKeyspace is part of the vtctlservicepb.VtctldClient interface. 566 func (client *localVtctldClient) ValidateSchemaKeyspace(ctx context.Context, in *vtctldatapb.ValidateSchemaKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.ValidateSchemaKeyspaceResponse, error) { 567 return client.s.ValidateSchemaKeyspace(ctx, in) 568 } 569 570 // ValidateShard is part of the vtctlservicepb.VtctldClient interface. 571 func (client *localVtctldClient) ValidateShard(ctx context.Context, in *vtctldatapb.ValidateShardRequest, opts ...grpc.CallOption) (*vtctldatapb.ValidateShardResponse, error) { 572 return client.s.ValidateShard(ctx, in) 573 } 574 575 // ValidateVSchema is part of the vtctlservicepb.VtctldClient interface. 576 func (client *localVtctldClient) ValidateVSchema(ctx context.Context, in *vtctldatapb.ValidateVSchemaRequest, opts ...grpc.CallOption) (*vtctldatapb.ValidateVSchemaResponse, error) { 577 return client.s.ValidateVSchema(ctx, in) 578 } 579 580 // ValidateVersionKeyspace is part of the vtctlservicepb.VtctldClient interface. 581 func (client *localVtctldClient) ValidateVersionKeyspace(ctx context.Context, in *vtctldatapb.ValidateVersionKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.ValidateVersionKeyspaceResponse, error) { 582 return client.s.ValidateVersionKeyspace(ctx, in) 583 } 584 585 // ValidateVersionShard is part of the vtctlservicepb.VtctldClient interface. 586 func (client *localVtctldClient) ValidateVersionShard(ctx context.Context, in *vtctldatapb.ValidateVersionShardRequest, opts ...grpc.CallOption) (*vtctldatapb.ValidateVersionShardResponse, error) { 587 return client.s.ValidateVersionShard(ctx, in) 588 }