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


Python SparkSubmitHook._build_spark_driver_kill_command方法代码示例

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


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

示例1: test_standalone_cluster_process_on_kill

# 需要导入模块: from airflow.contrib.hooks.spark_submit_hook import SparkSubmitHook [as 别名]
# 或者: from airflow.contrib.hooks.spark_submit_hook.SparkSubmitHook import _build_spark_driver_kill_command [as 别名]
    def test_standalone_cluster_process_on_kill(self):
        # Given
        log_lines = [
            'Running Spark using the REST application submission protocol.',
            '17/11/28 11:14:15 INFO RestSubmissionClient: Submitting a request ' +
            'to launch an application in spark://spark-standalone-master:6066',
            '17/11/28 11:14:15 INFO RestSubmissionClient: Submission successfully ' +
            'created as driver-20171128111415-0001. Polling submission state...'
        ]
        hook = SparkSubmitHook(conn_id='spark_standalone_cluster')
        hook._process_spark_submit_log(log_lines)

        # When
        kill_cmd = hook._build_spark_driver_kill_command()

        # Then
        self.assertEqual(kill_cmd[0], '/path/to/spark_home/bin/spark-submit')
        self.assertEqual(kill_cmd[1], '--master')
        self.assertEqual(kill_cmd[2], 'spark://spark-standalone-master:6066')
        self.assertEqual(kill_cmd[3], '--kill')
        self.assertEqual(kill_cmd[4], 'driver-20171128111415-0001')
开发者ID:AdamUnger,项目名称:incubator-airflow,代码行数:23,代码来源:test_spark_submit_hook.py


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