From ab1f75628df752c8d755d4235b9a25f0f552715b Mon Sep 17 00:00:00 2001 From: Qian Sun Date: Thu, 11 Jul 2024 09:18:34 +0000 Subject: [PATCH] add header and fix style error in doc --- docs/docs/en/guide/task/aliyun-adb-spark.md | 19 ++++++----- docs/docs/zh/guide/task/aliyun-adb-spark.md | 33 ++++++++++--------- .../plugin/task/adbspark/AdbSparkState.java | 17 ++++++++++ 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/docs/docs/en/guide/task/aliyun-adb-spark.md b/docs/docs/en/guide/task/aliyun-adb-spark.md index 0067e1da5e2a..2ffebea0fd01 100644 --- a/docs/docs/en/guide/task/aliyun-adb-spark.md +++ b/docs/docs/en/guide/task/aliyun-adb-spark.md @@ -28,7 +28,7 @@ - Please refer to [DolphinScheduler Task Parameters Appendix](appendix.md) `Default Task Parameters` section for default parameters. -| **Parameters** | **Description** | +| **Parameters** | **Description** | |---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Datasource types | The type of datasource the task uses, should be `ADBSPARK`. | | Datasource instances | The instance of `ADBSPARK` datasource. | @@ -43,18 +43,19 @@ #### Batch Type Application -| **Parameters** | **Example Values / Operations** | -|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Aliyun ADB Cluster ID | amv-example | -| Aliyun ADB Resource Group | spark | -| Aliyun ADB App Type | Batch | -| Aliyun ADB Spark Data |{
        "comments":  [
                "--  Here  is  just  an  example  of  SparkPi.  Modify  the  content  and  run  your  spark  program."
        ],
        "args":  [
                "1000"
        ],
        "file":  "local:///tmp/spark-examples.jar",
        "name":  "SparkPi",
        "className":  "org.apache.spark.examples.SparkPi",
        "conf":  {
                "spark.driver.resourceSpec":  "medium",
                "spark.executor.instances":  2,
                "spark.executor.resourceSpec":  "medium"
        }
}| +| **Parameters** | **Example Values / Operations** | +|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Aliyun ADB Cluster ID | amv-example | +| Aliyun ADB Resource Group | spark | +| Aliyun ADB App Type | Batch | +| Aliyun ADB Spark Data | {
        "comments":  [
                "--  Here  is  just  an  example  of  SparkPi.  Modify  the  content  and  run  your  spark  program."
        ],
        "args":  [
                "1000"
        ],
        "file":  "local:///tmp/spark-examples.jar",
        "name":  "SparkPi",
        "className":  "org.apache.spark.examples.SparkPi",
        "conf":  {
                "spark.driver.resourceSpec":  "medium",
                "spark.executor.instances":  2,
                "spark.executor.resourceSpec":  "medium"
        }
} | #### SQL Type Application -| **Parameters** | **Example Values / Operations** | +| **Parameters** | **Example Values / Operations** | |---------------------------|---------------------------------------------| | Aliyun ADB Cluster ID | amv-example | | Aliyun ADB Resource Group | spark | | Aliyun ADB App Type | Batch | -| Aliyun ADB Spark Data | show databases;
select * from example; | \ No newline at end of file +| Aliyun ADB Spark Data | show databases;
select * from example; | + diff --git a/docs/docs/zh/guide/task/aliyun-adb-spark.md b/docs/docs/zh/guide/task/aliyun-adb-spark.md index e33da30ed139..464b2d0f2b04 100644 --- a/docs/docs/zh/guide/task/aliyun-adb-spark.md +++ b/docs/docs/zh/guide/task/aliyun-adb-spark.md @@ -28,14 +28,14 @@ - 默认参数说明请参考[DolphinScheduler任务参数附录](appendix.md)`默认任务参数`一栏。 -| **Parameters** | **Description** | -|---------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------| -| Datasource types | 数据源类型,应该选择 `ADBSPARK`. | -| Datasource instances | `ADBSPARK` 数据源实例. | -| Aliyun ADB Cluster ID | AnalyticDB MySQL 湖仓版(3.0)集群 ID。 | -| Aliyun ADB Resource Group | Job 型资源组名称。 | -| Aliyun ADB App Type | 应用类型,取值说明:Batch(默认值), SQL。 | -| Aliyun ADB Spark Data | 应用模板数据。应用模板配置,请参见[《Spark 应用配置指南》](https://help.aliyun.com/zh/analyticdb-for-mysql/spark-application-configuration-guide?spm=a2c4g.11186623.0.i18)。 | +| **Parameters** | **Description** | +|---------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------| +| Datasource types | 数据源类型,应该选择 `ADBSPARK`. | +| Datasource instances | `ADBSPARK` 数据源实例. | +| Aliyun ADB Cluster ID | AnalyticDB MySQL 湖仓版(3.0)集群 ID。 | +| Aliyun ADB Resource Group | Job 型资源组名称。 | +| Aliyun ADB App Type | 应用类型,取值说明:Batch(默认值), SQL。 | +| Aliyun ADB Spark Data | 应用模板数据。应用模板配置,请参见[《Spark 应用配置指南》](https://help.aliyun.com/zh/analyticdb-for-mysql/spark-application-configuration-guide?spm=a2c4g.11186623.0.i18)。 | ## 示例 @@ -43,18 +43,19 @@ #### Batch 类型应用 -| **Parameters** | **Example Values / Operations** | -|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Aliyun ADB Cluster ID | amv-example | -| Aliyun ADB Resource Group | spark | -| Aliyun ADB App Type | Batch | -| Aliyun ADB Spark Data |{
        "comments":  [
                "--  Here  is  just  an  example  of  SparkPi.  Modify  the  content  and  run  your  spark  program."
        ],
        "args":  [
                "1000"
        ],
        "file":  "local:///tmp/spark-examples.jar",
        "name":  "SparkPi",
        "className":  "org.apache.spark.examples.SparkPi",
        "conf":  {
                "spark.driver.resourceSpec":  "medium",
                "spark.executor.instances":  2,
                "spark.executor.resourceSpec":  "medium"
        }
}| +| **Parameters** | **Example Values / Operations** | +|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Aliyun ADB Cluster ID | amv-example | +| Aliyun ADB Resource Group | spark | +| Aliyun ADB App Type | Batch | +| Aliyun ADB Spark Data | {
        "comments":  [
                "--  Here  is  just  an  example  of  SparkPi.  Modify  the  content  and  run  your  spark  program."
        ],
        "args":  [
                "1000"
        ],
        "file":  "local:///tmp/spark-examples.jar",
        "name":  "SparkPi",
        "className":  "org.apache.spark.examples.SparkPi",
        "conf":  {
                "spark.driver.resourceSpec":  "medium",
                "spark.executor.instances":  2,
                "spark.executor.resourceSpec":  "medium"
        }
} | #### SQL 类型应用 -| **Parameters** | **Example Values / Operations** | +| **Parameters** | **Example Values / Operations** | |---------------------------|---------------------------------------------| | Aliyun ADB Cluster ID | amv-example | | Aliyun ADB Resource Group | spark | | Aliyun ADB App Type | Batch | -| Aliyun ADB Spark Data | show databases;
select * from example; | \ No newline at end of file +| Aliyun ADB Spark Data | show databases;
select * from example; | + diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-adbspark/src/main/java/org/apache/dolphinscheduler/plugin/task/adbspark/AdbSparkState.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-adbspark/src/main/java/org/apache/dolphinscheduler/plugin/task/adbspark/AdbSparkState.java index 7305d1a2dbc9..4395c145ddab 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-adbspark/src/main/java/org/apache/dolphinscheduler/plugin/task/adbspark/AdbSparkState.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-adbspark/src/main/java/org/apache/dolphinscheduler/plugin/task/adbspark/AdbSparkState.java @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.apache.dolphinscheduler.plugin.task.adbspark; import org.apache.commons.lang3.StringUtils;