# Copyright 2015, Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. """Contain VTGate shard gateway flavor.""" import gateway class ShardGateway(gateway.VTGateGateway): """Overrides to use shard gateway.""" def setup(self): """Initialize dependent service.""" pass def teardown(self): """Teardown dependent service.""" pass def flags(self, cell=None): """Return a list of args that tell a VTGate process to start with.""" return [] def wipe(self): """Wipe the Vitess paths in the topo server.""" pass gateway.register_flavor('shardgateway', ShardGateway)
# distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Contain VTGate discovery gateway flavor.""" import gateway class DiscoveryGateway(gateway.VTGateGateway): """Overrides to use discovery gateway.""" def flags(self, cell=None, tablets=None): """Return a list of args that tell a VTGate process to start with.""" return [ '-cells_to_watch', cell, '-tablet_refresh_interval', '2s', ] def connection_count_vars(self): """Return the vars name containing the number of serving connections.""" return 'HealthcheckConnections' def no_tablet_found_message(self): """Return the text message that appears in the gateway.""" return 'no valid tablet' gateway.register_flavor('discoverygateway', DiscoveryGateway)
#!/usr/bin/env python # Copyright 2015 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. """Contain VTGate shard gateway flavor.""" import gateway class ShardGateway(gateway.VTGateGateway): """Overrides to use shard gateway.""" def flags(self, cell=None, tablets=None): """Return a list of args that tell a VTGate process to start with.""" return [] gateway.register_flavor('shardgateway', ShardGateway)
#!/usr/bin/env python # Copyright 2015 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. """Contain VTGate discovery gateway flavor.""" import gateway class DiscoveryGateway(gateway.VTGateGateway): """Overrides to use discovery gateway.""" def flags(self, cell=None, tablets=None): """Return a list of args that tell a VTGate process to start with.""" return ['-cells_to_watch', cell] def connection_count_vars(self): """Return the vars name containing the number of serving connections.""" return 'HealthcheckConnections' gateway.register_flavor('discoverygateway', DiscoveryGateway)