from trove.common.notification import EndNotification from trove.common import utils from trove.guestagent import backup from trove.guestagent.common import operating_system from trove.guestagent.datastore.experimental.redis import service from trove.guestagent.datastore import manager from trove.guestagent import dbaas from trove.guestagent.strategies.replication import get_replication_strategy from trove.guestagent import volume LOG = logging.getLogger(__name__) CONF = cfg.CONF MANAGER = CONF.datastore_manager or 'redis' REPLICATION_STRATEGY = CONF.get(MANAGER).replication_strategy REPLICATION_NAMESPACE = CONF.get(MANAGER).replication_namespace REPLICATION_STRATEGY_CLASS = get_replication_strategy(REPLICATION_STRATEGY, REPLICATION_NAMESPACE) class Manager(manager.Manager): """ This is the Redis manager class. It is dynamically loaded based off of the service_type of the trove instance """ def __init__(self): super(Manager, self).__init__() self._app = service.RedisApp() @property def status(self): return self._app.status
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # from oslo_utils import importutils from trove.common import cfg from trove.guestagent.datastore.mysql_common import manager from trove.guestagent.strategies.replication import get_replication_strategy CONF = cfg.CONF MANAGER = CONF.datastore_manager or 'mysql' REPLICATION_STRATEGY = CONF.get(MANAGER).replication_strategy REPLICATION_NAMESPACE = CONF.get(MANAGER).replication_namespace REPLICATION_STRATEGY_CLASS = get_replication_strategy(REPLICATION_STRATEGY, REPLICATION_NAMESPACE) MYSQL_APP = "trove.guestagent.datastore.experimental.mariadb." \ "service.MySqlApp" MYSQL_APP_STATUS = "trove.guestagent.datastore.experimental.mariadb." \ "service.MySqlAppStatus" MYSQL_ADMIN = "trove.guestagent.datastore.experimental.mariadb.service." \ "MySqlAdmin" class Manager(manager.MySqlManager): def __init__(self): mysql_app = importutils.import_class(MYSQL_APP) mysql_app_status = importutils.import_class(MYSQL_APP_STATUS) mysql_admin = importutils.import_class(MYSQL_ADMIN)
def replication_strategy_class(self): return get_replication_strategy(self._replication_strategy, self._replication_namespace)
def replication_strategy_class(self): return get_replication_strategy(self._replication_strategy, self._replication_namespace)