当前位置: 首页>>代码示例>>Python>>正文


Python SparkSubmitHook._resolve_should_track_driver_status方法代码示例

本文整理汇总了Python中airflow.contrib.hooks.spark_submit_hook.SparkSubmitHook._resolve_should_track_driver_status方法的典型用法代码示例。如果您正苦于以下问题:Python SparkSubmitHook._resolve_should_track_driver_status方法的具体用法?Python SparkSubmitHook._resolve_should_track_driver_status怎么用?Python SparkSubmitHook._resolve_should_track_driver_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在airflow.contrib.hooks.spark_submit_hook.SparkSubmitHook的用法示例。


在下文中一共展示了SparkSubmitHook._resolve_should_track_driver_status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_resolve_should_track_driver_status

# 需要导入模块: from airflow.contrib.hooks.spark_submit_hook import SparkSubmitHook [as 别名]
# 或者: from airflow.contrib.hooks.spark_submit_hook.SparkSubmitHook import _resolve_should_track_driver_status [as 别名]
    def test_resolve_should_track_driver_status(self):
        # Given
        hook_default = SparkSubmitHook(conn_id='')
        hook_spark_yarn_cluster = SparkSubmitHook(conn_id='spark_yarn_cluster')
        hook_spark_k8s_cluster = SparkSubmitHook(conn_id='spark_k8s_cluster')
        hook_spark_default_mesos = SparkSubmitHook(conn_id='spark_default_mesos')
        hook_spark_home_set = SparkSubmitHook(conn_id='spark_home_set')
        hook_spark_home_not_set = SparkSubmitHook(conn_id='spark_home_not_set')
        hook_spark_binary_set = SparkSubmitHook(conn_id='spark_binary_set')
        hook_spark_binary_and_home_set = SparkSubmitHook(
            conn_id='spark_binary_and_home_set')
        hook_spark_standalone_cluster = SparkSubmitHook(
            conn_id='spark_standalone_cluster')

        # When
        should_track_driver_status_default = hook_default \
            ._resolve_should_track_driver_status()
        should_track_driver_status_spark_yarn_cluster = hook_spark_yarn_cluster \
            ._resolve_should_track_driver_status()
        should_track_driver_status_spark_k8s_cluster = hook_spark_k8s_cluster \
            ._resolve_should_track_driver_status()
        should_track_driver_status_spark_default_mesos = hook_spark_default_mesos \
            ._resolve_should_track_driver_status()
        should_track_driver_status_spark_home_set = hook_spark_home_set \
            ._resolve_should_track_driver_status()
        should_track_driver_status_spark_home_not_set = hook_spark_home_not_set \
            ._resolve_should_track_driver_status()
        should_track_driver_status_spark_binary_set = hook_spark_binary_set \
            ._resolve_should_track_driver_status()
        should_track_driver_status_spark_binary_and_home_set = \
            hook_spark_binary_and_home_set._resolve_should_track_driver_status()
        should_track_driver_status_spark_standalone_cluster = \
            hook_spark_standalone_cluster._resolve_should_track_driver_status()

        # Then
        self.assertEqual(should_track_driver_status_default, False)
        self.assertEqual(should_track_driver_status_spark_yarn_cluster, False)
        self.assertEqual(should_track_driver_status_spark_k8s_cluster, False)
        self.assertEqual(should_track_driver_status_spark_default_mesos, False)
        self.assertEqual(should_track_driver_status_spark_home_set, False)
        self.assertEqual(should_track_driver_status_spark_home_not_set, False)
        self.assertEqual(should_track_driver_status_spark_binary_set, False)
        self.assertEqual(should_track_driver_status_spark_binary_and_home_set, False)
        self.assertEqual(should_track_driver_status_spark_standalone_cluster, True)
开发者ID:AdamUnger,项目名称:incubator-airflow,代码行数:46,代码来源:test_spark_submit_hook.py


注:本文中的airflow.contrib.hooks.spark_submit_hook.SparkSubmitHook._resolve_should_track_driver_status方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。