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


Python SparkSubmitHook._process_spark_status_log方法代码示例

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


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

示例1: test_process_spark_driver_status_log

# 需要导入模块: from airflow.contrib.hooks.spark_submit_hook import SparkSubmitHook [as 别名]
# 或者: from airflow.contrib.hooks.spark_submit_hook.SparkSubmitHook import _process_spark_status_log [as 别名]
    def test_process_spark_driver_status_log(self):
        # Given
        hook = SparkSubmitHook(conn_id='spark_standalone_cluster')
        log_lines = [
            'Submitting a request for the status of submission ' +
            'driver-20171128111415-0001 in spark://spark-standalone-master:6066',
            '17/11/28 11:15:37 INFO RestSubmissionClient: Server responded with ' +
            'SubmissionStatusResponse:',
            '{',
            '"action" : "SubmissionStatusResponse",',
            '"driverState" : "RUNNING",',
            '"serverSparkVersion" : "1.6.0",',
            '"submissionId" : "driver-20171128111415-0001",',
            '"success" : true,',
            '"workerHostPort" : "172.18.0.7:38561",',
            '"workerId" : "worker-20171128110741-172.18.0.7-38561"',
            '}'
        ]
        # When
        hook._process_spark_status_log(log_lines)

        # Then

        self.assertEqual(hook._driver_status, 'RUNNING')
开发者ID:gfalcone,项目名称:incubator-airflow,代码行数:26,代码来源:test_spark_submit_hook.py


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