sink_capabilities.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. from materialize.zippy.framework import Capability
  10. from materialize.zippy.view_capabilities import ViewExists
  11. class SinkExists(Capability):
  12. """A sink exists in Materialize."""
  13. name: str
  14. source_view: ViewExists
  15. dest_view: ViewExists
  16. @classmethod
  17. def format_str(cls) -> str:
  18. return "sink_{}"
  19. def __init__(
  20. self,
  21. name: str,
  22. source_view: ViewExists,
  23. dest_view: ViewExists,
  24. cluster_name_out: str,
  25. cluster_name_in: str,
  26. ) -> None:
  27. self.name = name
  28. self.source_view = source_view
  29. self.dest_view = dest_view
  30. self.cluster_name_out = cluster_name_out
  31. self.cluster_name_in = cluster_name_in