misc.python.materialize.checks.backup_actions

 1# Copyright Materialize, Inc. and contributors. All rights reserved.
 2#
 3# Use of this software is governed by the Business Source License
 4# included in the LICENSE file at the root of this repository.
 5#
 6# As of the Change Date specified in that file, in accordance with
 7# the Business Source License, use of this software will be governed
 8# by the Apache License, Version 2.0.
 9
10
11from materialize.checks.actions import Action
12from materialize.checks.executors import Executor
13
14
15class Backup(Action):
16    def execute(self, e: Executor) -> None:
17        c = e.mzcompose_composition()
18        c.backup()
19
20    def join(self, e: Executor) -> None:
21        # Action is blocking
22        pass
23
24
25class Restore(Action):
26    def __init__(self, restart_mz=True):
27        self.restart_mz = restart_mz
28
29    def execute(self, e: Executor) -> None:
30        c = e.mzcompose_composition()
31        c.restore(restart_mz=self.restart_mz)
32
33    def join(self, e: Executor) -> None:
34        # Action is blocking
35        pass
class Backup(materialize.checks.actions.Action):
16class Backup(Action):
17    def execute(self, e: Executor) -> None:
18        c = e.mzcompose_composition()
19        c.backup()
20
21    def join(self, e: Executor) -> None:
22        # Action is blocking
23        pass
def execute(self, e: materialize.checks.executors.Executor) -> None:
17    def execute(self, e: Executor) -> None:
18        c = e.mzcompose_composition()
19        c.backup()
def join(self, e: materialize.checks.executors.Executor) -> None:
21    def join(self, e: Executor) -> None:
22        # Action is blocking
23        pass
class Restore(materialize.checks.actions.Action):
26class Restore(Action):
27    def __init__(self, restart_mz=True):
28        self.restart_mz = restart_mz
29
30    def execute(self, e: Executor) -> None:
31        c = e.mzcompose_composition()
32        c.restore(restart_mz=self.restart_mz)
33
34    def join(self, e: Executor) -> None:
35        # Action is blocking
36        pass
Restore(restart_mz=True)
27    def __init__(self, restart_mz=True):
28        self.restart_mz = restart_mz
restart_mz
def execute(self, e: materialize.checks.executors.Executor) -> None:
30    def execute(self, e: Executor) -> None:
31        c = e.mzcompose_composition()
32        c.restore(restart_mz=self.restart_mz)
def join(self, e: materialize.checks.executors.Executor) -> None:
34    def join(self, e: Executor) -> None:
35        # Action is blocking
36        pass