diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertStatus.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertStatus.java index 42ea05f75d1f7f36c05c215971b6b03c899caa67..3457296737563f863b54ae12eeb0d00e2ed7e983 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertStatus.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertStatus.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -29,8 +30,7 @@ public enum AlertStatus { EXECUTION_SUCCESS(1, "execute successfully"), EXECUTION_FAILURE(2, "execute failed"); - - AlertStatus(int code, String descp){ + AlertStatus(int code, String descp) { this.code = code; this.descp = descp; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertType.java index 3c757f53379bd5fce2b31b5f58801b91d3338203..fb16608906cbe4ae403f486dce4f5cad76f62079 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AlertType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -28,8 +29,7 @@ public enum AlertType { EMAIL(0, "email"), SMS(1, "SMS"); - - AlertType(int code, String descp){ + AlertType(int code, String descp) { this.code = code; this.descp = descp; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AuthorizationType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AuthorizationType.java index 633f5f962371a4e985fc2bd1936fc5f88268c11d..5d7934d06952f51937c8f9aa5e6b5f8a03fe9b5c 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AuthorizationType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/AuthorizationType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -35,7 +36,7 @@ public enum AuthorizationType { DATASOURCE(3, "data source"), UDF(4, "udf function"); - AuthorizationType(int code, String descp){ + AuthorizationType(int code, String descp) { this.code = code; this.descp = descp; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CommandType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CommandType.java index 9bff968b732467c68738cecd2f19c6bc1414c672..35b64821aff08639d60dd81558c0eee63717b34b 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CommandType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CommandType.java @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.enums; -import com.baomidou.mybatisplus.annotation.EnumValue; +package org.apache.dolphinscheduler.common.enums; import java.util.HashMap; import java.util.Map; +import com.baomidou.mybatisplus.annotation.EnumValue; + /** * command types */ @@ -54,7 +55,7 @@ public enum CommandType { RECOVER_SERIAL_WAIT(11, "recover serial wait"), ; - CommandType(int code, String descp){ + CommandType(int code, String descp) { this.code = code; this.descp = descp; } @@ -79,7 +80,6 @@ public enum CommandType { } } - public static CommandType of(Integer status) { if (COMMAND_TYPE_MAP.containsKey(status)) { return COMMAND_TYPE_MAP.get(status); diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CycleEnum.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CycleEnum.java index 633a3da4098ad79201d6a5d906a80b0ee3a6aa87..7e12b9de600fca34fd3bfe79628f459e1158524c 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CycleEnum.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/CycleEnum.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DataType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DataType.java index 2b0930d32d95db22114a875d7c9b43a7b01494d7..6f4e563a9750ea89561d27218e4eab4a33769186 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DataType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DataType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependResult.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependResult.java index f906c866aabcca992959b03af861ad91d2d912da..a32626a221bc1916a3a2344acacdba176bcfb41b 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependResult.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependResult.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependentRelation.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependentRelation.java index f84a37e4ed61844c44a92a60ae3f98b9fd6be684..ff4aef0be02ccd33d3b609f483578aa6f21395f0 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependentRelation.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DependentRelation.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Direct.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Direct.java index 2eb9f3106c4c245482cb29fafaa267647daee2ad..f9a761a4e83d7278040d205e72c80afbd883c246 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Direct.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Direct.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/FailureStrategy.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/FailureStrategy.java index c9c0c3293040925fce274656a785d9d89c06adc1..7e188e1eae41832311565048436625f03fa76912 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/FailureStrategy.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/FailureStrategy.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -23,27 +24,27 @@ import com.baomidou.mybatisplus.annotation.EnumValue; */ public enum FailureStrategy { - /** - * 0 ending process when some tasks failed. - * 1 continue running when some tasks failed. - **/ - END(0, "end"), - CONTINUE(1, "continue"); - - FailureStrategy(int code, String descp){ - this.code = code; - this.descp = descp; - } - - @EnumValue - private final int code; - private final String descp; - - public int getCode() { - return code; - } - - public String getDescp() { - return descp; - } + /** + * 0 ending process when some tasks failed. + * 1 continue running when some tasks failed. + **/ + END(0, "end"), + CONTINUE(1, "continue"); + + FailureStrategy(int code, String descp) { + this.code = code; + this.descp = descp; + } + + @EnumValue + private final int code; + private final String descp; + + public int getCode() { + return code; + } + + public String getDescp() { + return descp; + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Flag.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Flag.java index fa69f2978dfd6c4d45b6dfc2fe4abc4fbbb6fedd..83a7069142f74f0a1c4efdcd9cf08fcaa345964b 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Flag.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Flag.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpCheckCondition.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpCheckCondition.java index 15d0ca4ddfa19f136cd76f46f43416e2c8deb31d..278e71e738ad7977dd8fa8d0cbf3e6aa71e5027d 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpCheckCondition.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpCheckCondition.java @@ -14,17 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** * http check condition */ public enum HttpCheckCondition { - /** - * 0 status_code_default:200 - * 1 status_code_custom - * 2 body_contains - * 3 body_not_contains - */ - STATUS_CODE_DEFAULT,STATUS_CODE_CUSTOM, BODY_CONTAINS, BODY_NOT_CONTAINS + /** + * 0 status_code_default:200 + * 1 status_code_custom + * 2 body_contains + * 3 body_not_contains + */ + STATUS_CODE_DEFAULT,STATUS_CODE_CUSTOM, BODY_CONTAINS, BODY_NOT_CONTAINS } \ No newline at end of file diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpMethod.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpMethod.java index abceedd9f6426357536fdbfd4b66f715a3cf845f..509fd7c14747beeff9f3013463368096473a194c 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpMethod.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpMethod.java @@ -14,18 +14,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** * http method */ public enum HttpMethod { - /** - * 0 get - * 1 post - * 2 head - * 3 put - * 4 delete - */ - GET, POST, HEAD, PUT, DELETE + /** + * 0 get + * 1 post + * 2 head + * 3 put + * 4 delete + */ + GET, POST, HEAD, PUT, DELETE } \ No newline at end of file diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpParametersType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpParametersType.java index 857ebf612d6fb0d33e5adecf8bf583b7d758aad5..0f7299ebe5096c5e8ad70771d4dd402025bdb17b 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpParametersType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/HttpParametersType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/NodeType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/NodeType.java index cb247cf2f4fe2856acac6d93dd3ea46863f9cced..548b951a30ec84819175fb2d424e18806e64dc69 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/NodeType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/NodeType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; public enum NodeType { diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Priority.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Priority.java index 53ca3f9c74ccb1ed700c05231714ae425f5c9441..1ccfb6fe4e3373462255ae4d580fb6408136993d 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Priority.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/Priority.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ProgramType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ProgramType.java index 45e88d63c2d40cd4c5c4c40d87b9ecdd94ff6098..5064b1f394599f0a1881474e4d89bc96762def02 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ProgramType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ProgramType.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.enums; +package org.apache.dolphinscheduler.common.enums; /** * support program types diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ReleaseState.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ReleaseState.java index 51e9a3393bcc6e5f46685e3eaa3f7e70c1799c56..e5100655e4fec66807cc15409676006ebbc84b86 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ReleaseState.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ReleaseState.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -30,7 +31,7 @@ public enum ReleaseState { OFFLINE(0, "offline"), ONLINE(1, "online"); - ReleaseState(int code, String descp){ + ReleaseState(int code, String descp) { this.code = code; this.descp = descp; } @@ -39,9 +40,9 @@ public enum ReleaseState { private final int code; private final String descp; - public static ReleaseState getEnum(int value){ + public static ReleaseState getEnum(int value) { for (ReleaseState e:ReleaseState.values()) { - if(e.ordinal() == value) { + if (e.ordinal() == value) { return e; } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ResUploadType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ResUploadType.java index 0155c1268c2102750bd300d777bd2fab05804d61..35372aeff53831dd1f3d873a66b4adad30064388 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ResUploadType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ResUploadType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/RunMode.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/RunMode.java index 44fdb5b1b66c801b567846936808ffa706fdeacc..9d231cce0096b0ec583bc58d95960ded4c408b40 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/RunMode.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/RunMode.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -29,7 +30,7 @@ public enum RunMode { RUN_MODE_SERIAL(0, "serial run"), RUN_MODE_PARALLEL(1, "parallel run"); - RunMode(int code, String descp){ + RunMode(int code, String descp) { this.code = code; this.descp = descp; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SparkVersion.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SparkVersion.java index 867d063a641408cc01247c3641b883e77b49e3ee..ba5bcdd511e262e18cfa81c3fa2277d60b3b689a 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SparkVersion.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SparkVersion.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -27,7 +28,7 @@ public enum SparkVersion { SPARK1(0, "SPARK1"), SPARK2(1, "SPARK2"); - SparkVersion(int code, String descp){ + SparkVersion(int code, String descp) { this.code = code; this.descp = descp; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SqoopJobType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SqoopJobType.java index f1fde279280cc4392b2a0b017ebd9a190c9698bf..2f69f060cc11366594090b93e14e643d7838d18c 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SqoopJobType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/SqoopJobType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -22,7 +23,7 @@ public enum SqoopJobType { CUSTOM(0, "CUSTOM"), TEMPLATE(1, "TEMPLATE"); - SqoopJobType(int code, String descp){ + SqoopJobType(int code, String descp) { this.code = code; this.descp = descp; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskDependType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskDependType.java index 401fecf3ea8bbc0c027a36a51300fdf90ea53048..030194756466bbf4f683cda788ce2ef99ad9ce83 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskDependType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskDependType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -22,29 +23,29 @@ import com.baomidou.mybatisplus.annotation.EnumValue; * task node depend type */ public enum TaskDependType { - /** - * 0 run current tasks only - * 1 run current tasks and previous tasks - * 2 run current tasks and the other tasks that depend on current tasks; - */ - TASK_ONLY(0, "task only"), - TASK_PRE(1, "task pre"), - TASK_POST(2, "task post"); + /** + * 0 run current tasks only + * 1 run current tasks and previous tasks + * 2 run current tasks and the other tasks that depend on current tasks; + */ + TASK_ONLY(0, "task only"), + TASK_PRE(1, "task pre"), + TASK_POST(2, "task post"); - TaskDependType(int code, String descp){ - this.code = code; - this.descp = descp; - } + TaskDependType(int code, String descp) { + this.code = code; + this.descp = descp; + } - @EnumValue - private final int code; - private final String descp; + @EnumValue + private final int code; + private final String descp; - public int getCode() { - return code; - } + public int getCode() { + return code; + } - public String getDescp() { - return descp; - } + public String getDescp() { + return descp; + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskRecordStatus.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskRecordStatus.java index 842fd7584688738dfdedc025e971be17035ac3d0..faa9d0ceabd9d838d1af337d1d99291a4d4ceb25 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskRecordStatus.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskRecordStatus.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.enums; +package org.apache.dolphinscheduler.common.enums; /** * task record status diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskStateType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskStateType.java index 36766a7f4d0404958e4c43f05dd65bd0f4c1358b..a730fa84c3d02c55f3905a42ee7ba980e79df53e 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskStateType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskStateType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskTimeoutStrategy.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskTimeoutStrategy.java index a203fd4d53d3b25151c43fe98069cd9fbad72cdd..08ad60f17e45048d168af33a4e7c70eddb0f8ebf 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskTimeoutStrategy.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskTimeoutStrategy.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskType.java index d5338cad4cbe729f4be2940ccdba2891f41922c2..a6c539d72dae648f419c8fb1e6ed1361178d81a4 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/TaskType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/UdfType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/UdfType.java index 2351cca40b164cb816bc7dad39e7f68ad97f1028..211061681bc53c0a644aec600ca0581f221de779 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/UdfType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/UdfType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/UserType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/UserType.java index 75a5df6fb90e7f802b762a5755cab756b803b7e2..ebab5da74239e8bfcdf7baca201e850305a712a1 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/UserType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/UserType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -28,8 +29,7 @@ public enum UserType { ADMIN_USER(0, "admin user"), GENERAL_USER(1, "general user"); - - UserType(int code, String descp){ + UserType(int code, String descp) { this.code = code; this.descp = descp; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/WarningType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/WarningType.java index 3a65760716de87ca9917d922cda57f720cd1e6f7..d3cbffd391ee47ea2a690f60e07267cba68b5c3c 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/WarningType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/WarningType.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.enums; import com.baomidou.mybatisplus.annotation.EnumValue; @@ -22,32 +23,31 @@ import com.baomidou.mybatisplus.annotation.EnumValue; * types for whether to send warning when process ending; */ public enum WarningType { - /** - * 0 do not send warning; - * 1 send if process success; - * 2 send if process failed; - * 3 send if process ending; - */ - NONE(0, "none"), - SUCCESS(1, "success"), - FAILURE(2, "failure"), - ALL(3, "all"); - + /** + * 0 do not send warning; + * 1 send if process success; + * 2 send if process failed; + * 3 send if process ending; + */ + NONE(0, "none"), + SUCCESS(1, "success"), + FAILURE(2, "failure"), + ALL(3, "all"); - WarningType(int code, String descp){ - this.code = code; - this.descp = descp; - } + WarningType(int code, String descp) { + this.code = code; + this.descp = descp; + } - @EnumValue - private final int code; - private final String descp; + @EnumValue + private final int code; + private final String descp; - public int getCode() { - return code; - } + public int getCode() { + return code; + } - public String getDescp() { - return descp; - } + public String getDescp() { + return descp; + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/graph/DAG.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/graph/DAG.java index fe5593463571879b06c265c94e33ebe4199f87a9..e57b3dd93e6617f73c025b5f3c07da2a64b83bc0 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/graph/DAG.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/graph/DAG.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.graph; import org.apache.commons.collections4.CollectionUtils; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DateInterval.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DateInterval.java index 2ff3922c18b3b99d5982dd55f78713ed3e134e2c..81adcd763a927fb4d15952c0a5763b9c98061bf8 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DateInterval.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DateInterval.java @@ -14,26 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.model; -import com.fasterxml.jackson.annotation.JsonFormat; +package org.apache.dolphinscheduler.common.model; import java.util.Date; import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonFormat; + /** * date interval class */ public class DateInterval { - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date startTime; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date endTime; - public DateInterval(Date beginTime, Date endTime){ + public DateInterval(Date beginTime, Date endTime) { this.startTime = beginTime; this.endTime = endTime; - } @Override @@ -44,8 +44,8 @@ public class DateInterval { return true; } else { DateInterval that = (DateInterval) obj; - return startTime.equals(that.startTime) && - endTime.equals(that.endTime); + return startTime.equals(that.startTime) + && endTime.equals(that.endTime); } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DependentTaskModel.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DependentTaskModel.java index 93647bae04e47dfdc2f75118fce3258c276ee767..eb56ee7dbe78d81a1ca8b892783cbe4be7c5fb08 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DependentTaskModel.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/DependentTaskModel.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.model; import org.apache.dolphinscheduler.common.enums.DependentRelation; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/Server.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/Server.java index 69d718c2865b1406fc00ea2dff8f400a75f1cea0..d0d1394367d170400be6a26e7c85a5b51c646460 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/Server.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/Server.java @@ -14,13 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.model; +import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; -import java.util.Date; - /** * server */ @@ -54,13 +54,13 @@ public class Server { /** * create time */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date createTime; /** * laster heart beat time */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date lastHeartbeatTime; public int getId() { diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/TaskNodeRelation.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/TaskNodeRelation.java index e4741574e40ad7c554fd309d49e004eb8058ae71..7ee83226013b70701da0c354cddaf4339a8b9415 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/TaskNodeRelation.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/TaskNodeRelation.java @@ -14,66 +14,66 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.model; import java.util.Objects; public class TaskNodeRelation { - /** - * task start node name - */ - private String startNode; - - /** - * task end node name - */ - private String endNode; + /** + * task start node name + */ + private String startNode; - public TaskNodeRelation() { - } + /** + * task end node name + */ + private String endNode; - public TaskNodeRelation(String startNode, String endNode) { - this.startNode = startNode; - this.endNode = endNode; - } + public TaskNodeRelation() { + } - public String getStartNode() { - return startNode; - } + public TaskNodeRelation(String startNode, String endNode) { + this.startNode = startNode; + this.endNode = endNode; + } - public void setStartNode(String startNode) { - this.startNode = startNode; - } + public String getStartNode() { + return startNode; + } - public String getEndNode() { - return endNode; - } + public void setStartNode(String startNode) { + this.startNode = startNode; + } - public void setEndNode(String endNode) { - this.endNode = endNode; - } + public String getEndNode() { + return endNode; + } + public void setEndNode(String endNode) { + this.endNode = endNode; + } - @Override - public boolean equals(Object o){ - if (!(o instanceof TaskNodeRelation)) { - return false; + @Override + public boolean equals(Object o) { + if (!(o instanceof TaskNodeRelation)) { + return false; + } + TaskNodeRelation relation = (TaskNodeRelation)o; + return (relation.getStartNode().equals(this.startNode) && relation.getEndNode().equals(this.endNode)); } - TaskNodeRelation relation = (TaskNodeRelation)o; - return (relation.getStartNode().equals(this.startNode) && relation.getEndNode().equals(this.endNode)); - } - @Override - public String toString() { - return "TaskNodeRelation{" + - "startNode='" + startNode + '\'' + - ", endNode='" + endNode + '\'' + - '}'; - } + @Override + public String toString() { + return "TaskNodeRelation{" + + "startNode='" + startNode + '\'' + + ", endNode='" + endNode + '\'' + + '}'; + } - @Override - public int hashCode() { - return Objects.hash(startNode, endNode); - } + @Override + public int hashCode() { + return Objects.hash(startNode, endNode); + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/WorkerServerModel.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/WorkerServerModel.java index 984124b872140ef7b5c5036166c8be7d79f3f871..0c2ab2f72ed9b72c68319aedcab10f1d9cd5f594 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/WorkerServerModel.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/model/WorkerServerModel.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.model; +package org.apache.dolphinscheduler.common.model; import java.util.Date; import java.util.Set; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/HttpProperty.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/HttpProperty.java index 71a3fd9db8a772c9476bca6c6243e8baa31f8e76..ab259f4181afc9ea2ef1d240865304646ec41c07 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/HttpProperty.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/HttpProperty.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.process; import org.apache.dolphinscheduler.common.enums.HttpParametersType; @@ -21,105 +22,102 @@ import org.apache.dolphinscheduler.common.enums.HttpParametersType; import java.util.Objects; public class HttpProperty { - /** - * key - */ - private String prop; - - /** - * httpParametersType - */ - private HttpParametersType httpParametersType; - - /** - * value - */ - private String value; - - public HttpProperty() { - } - - public HttpProperty(String prop, HttpParametersType httpParametersType, String value) { - this.prop = prop; - this.httpParametersType = httpParametersType; - this.value = value; - } - - /** - * getter method - * - * @return the prop - * @see HttpProperty#prop - */ - public String getProp() { - return prop; - } - - /** - * setter method - * - * @param prop the prop to set - * @see HttpProperty#prop - */ - public void setProp(String prop) { - this.prop = prop; - } - - /** - * getter method - * - * @return the value - * @see HttpProperty#value - */ - public String getValue() { - return value; - } - - /** - * setter method - * - * @param value the value to set - * @see HttpProperty#value - */ - public void setValue(String value) { - this.value = value; - } - - public HttpParametersType getHttpParametersType() { - return httpParametersType; - } - - public void setHttpParametersType(HttpParametersType httpParametersType) { - this.httpParametersType = httpParametersType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * key + */ + private String prop; + + /** + * httpParametersType + */ + private HttpParametersType httpParametersType; + + /** + * value + */ + private String value; + + public HttpProperty() { + } + + public HttpProperty(String prop, HttpParametersType httpParametersType, String value) { + this.prop = prop; + this.httpParametersType = httpParametersType; + this.value = value; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * getter method + * + * @return the prop + * @see HttpProperty#prop + */ + public String getProp() { + return prop; } - HttpProperty property = (HttpProperty) o; - return Objects.equals(prop, property.prop) && - Objects.equals(value, property.value); - } + /** + * setter method + * + * @param prop the prop to set + * @see HttpProperty#prop + */ + public void setProp(String prop) { + this.prop = prop; + } - @Override - public int hashCode() { - return Objects.hash(prop, value); - } + /** + * getter method + * + * @return the value + * @see HttpProperty#value + */ + public String getValue() { + return value; + } - @Override - public String toString() { - return "HttpProperty{" + - "prop='" + prop + '\'' + - ", httpParametersType=" + httpParametersType + - ", value='" + value + '\'' + - '}'; - } + /** + * setter method + * + * @param value the value to set + * @see HttpProperty#value + */ + public void setValue(String value) { + this.value = value; + } + public HttpParametersType getHttpParametersType() { + return httpParametersType; + } + public void setHttpParametersType(HttpParametersType httpParametersType) { + this.httpParametersType = httpParametersType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HttpProperty property = (HttpProperty) o; + return Objects.equals(prop, property.prop) + && Objects.equals(value, property.value); + } + + @Override + public int hashCode() { + return Objects.hash(prop, value); + } + + @Override + public String toString() { + return "HttpProperty{" + + "prop='" + prop + '\'' + + ", httpParametersType=" + httpParametersType + + ", value='" + value + '\'' + + '}'; + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ProcessDag.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ProcessDag.java index 465fcbe2f603f9fffd1ea40a4927801bceba4637..357e4ca6b1e1e80fa80f5a3c1e0087820d828a24 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ProcessDag.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ProcessDag.java @@ -14,9 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.process; - +package org.apache.dolphinscheduler.common.process; import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.model.TaskNodeRelation; @@ -25,61 +24,61 @@ import java.util.List; public class ProcessDag { - /** - * DAG edge list - **/ - private List edges; + /** + * DAG edge list + **/ + private List edges; - /** - * DAG node list - */ - private List nodes; + /** + * DAG node list + */ + private List nodes; - /** - * getter method - * - * @return the edges - * @see ProcessDag#edges - */ - public List getEdges() { - return edges; - } + /** + * getter method + * + * @return the edges + * @see ProcessDag#edges + */ + public List getEdges() { + return edges; + } - /** - * setter method - * - * @param edges the edges to set - * @see ProcessDag#edges - */ - public void setEdges(List edges) { - this.edges = edges; - } + /** + * setter method + * + * @param edges the edges to set + * @see ProcessDag#edges + */ + public void setEdges(List edges) { + this.edges = edges; + } - /** - * getter method - * - * @return the nodes - * @see ProcessDag#nodes - */ - public List getNodes() { - return nodes; - } + /** + * getter method + * + * @return the nodes + * @see ProcessDag#nodes + */ + public List getNodes() { + return nodes; + } - /** - * setter method - * - * @param nodes the nodes to set - * @see ProcessDag#nodes - */ - public void setNodes(List nodes) { - this.nodes = nodes; - } + /** + * setter method + * + * @param nodes the nodes to set + * @see ProcessDag#nodes + */ + public void setNodes(List nodes) { + this.nodes = nodes; + } - @Override - public String toString() { - return "ProcessDag{" + - "edges=" + edges + - ", nodes=" + nodes + - '}'; - } + @Override + public String toString() { + return "ProcessDag{" + + "edges=" + edges + + ", nodes=" + nodes + + '}'; + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/Property.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/Property.java index 9ec9b1ae57d4b3bfdd0d3a2519c21261ef6854ae..2f9556e57807ca7d17294e4d590a9ca9f2cc96a8 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/Property.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/Property.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.process; +package org.apache.dolphinscheduler.common.process; import org.apache.dolphinscheduler.common.enums.DataType; import org.apache.dolphinscheduler.common.enums.Direct; @@ -24,121 +24,117 @@ import java.io.Serializable; import java.util.Objects; public class Property implements Serializable { - /** - * key - */ - private String prop; - - /** - * input/output - */ - private Direct direct; - - /** - * data type - */ - private DataType type; - - /** - * value - */ - private String value; - - public Property() { - } - - public Property(String prop,Direct direct,DataType type,String value) { - this.prop = prop; - this.direct = direct; - this.type = type; - this.value = value; - } - - /** - * getter method - * - * @return the prop - * @see Property#prop - */ - public String getProp() { - return prop; - } - - /** - * setter method - * - * @param prop the prop to set - * @see Property#prop - */ - public void setProp(String prop) { - this.prop = prop; - } - - /** - * getter method - * - * @return the value - * @see Property#value - */ - public String getValue() { - return value; - } - - /** - * setter method - * - * @param value the value to set - * @see Property#value - */ - public void setValue(String value) { - this.value = value; - } - - - public Direct getDirect() { - return direct; - } - - public void setDirect(Direct direct) { - this.direct = direct; - } - - public DataType getType() { - return type; - } - - public void setType(DataType type) { - this.type = type; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + /** + * key + */ + private String prop; + + /** + * input/output + */ + private Direct direct; + + /** + * data type + */ + private DataType type; + + /** + * value + */ + private String value; + + public Property() { + } + + public Property(String prop,Direct direct,DataType type,String value) { + this.prop = prop; + this.direct = direct; + this.type = type; + this.value = value; + } + + /** + * getter method + * + * @return the prop + * @see Property#prop + */ + public String getProp() { + return prop; + } + + /** + * setter method + * + * @param prop the prop to set + * @see Property#prop + */ + public void setProp(String prop) { + this.prop = prop; + } + + /** + * getter method + * + * @return the value + * @see Property#value + */ + public String getValue() { + return value; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * setter method + * + * @param value the value to set + * @see Property#value + */ + public void setValue(String value) { + this.value = value; + } + + public Direct getDirect() { + return direct; + } + + public void setDirect(Direct direct) { + this.direct = direct; } - Property property = (Property) o; - return Objects.equals(prop, property.prop) && - Objects.equals(value, property.value); - } + public DataType getType() { + return type; + } - @Override - public int hashCode() { - return Objects.hash(prop, value); - } + public void setType(DataType type) { + this.type = type; + } - @Override - public String toString() { - return "Property{" + - "prop='" + prop + '\'' + - ", direct=" + direct + - ", type=" + type + - ", value='" + value + '\'' + - '}'; - } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Property property = (Property) o; + return Objects.equals(prop, property.prop) + && Objects.equals(value, property.value); + } + @Override + public int hashCode() { + return Objects.hash(prop, value); + } + @Override + public String toString() { + return "Property{" + + "prop='" + prop + '\'' + + ", direct=" + direct + + ", type=" + type + + ", value='" + value + '\'' + + '}'; + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java index cacdbf5579f40d59a257c563327789661900c5a2..adc86b2f1ce08ef4fe6f097b559c934487ceecd9 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/process/ResourceInfo.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.process; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/AbstractShell.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/AbstractShell.java index 9a24fdb407930f043be31212470b24a599be51c6..63e43a9f787f9176a98c01609e9d127dd4bdce79 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/AbstractShell.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/AbstractShell.java @@ -14,8 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.shell; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.BufferedReader; import java.io.File; import java.io.IOException; @@ -27,11 +31,7 @@ import java.util.TimerTask; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** +/** * A base class for running a Unix command. * * AbstractShell can be used to run unix commands like du or @@ -40,318 +40,316 @@ import org.slf4j.LoggerFactory; */ public abstract class AbstractShell { - private static final Logger logger = LoggerFactory.getLogger(AbstractShell.class); + private static final Logger logger = LoggerFactory.getLogger(AbstractShell.class); - /** - * Time after which the executing script would be timedout - */ - protected long timeOutInterval = 0L; - /** - * If or not script timed out - */ - private AtomicBoolean timedOut; - - /** - * refresh interval in msec - */ - private long interval; - - /** - * last time the command was performed - */ - private long lastTime; - - /** - * env for the command execution - */ - private Map environment; - private File dir; - - /** - * sub process used to execute the command - */ - private Process process; - private int exitCode; - - /** - * If or not script finished executing - */ - private AtomicBoolean completed; - - public AbstractShell() { - this(0L); - } - - /** - * @param interval the minimum duration to wait before re-executing the - * command. - */ - public AbstractShell(long interval ) { - this.interval = interval; - this.lastTime = (interval<0) ? 0 : -interval; - } + /** + * Time after which the executing script would be timedout + */ + protected long timeOutInterval = 0L; + /** + * If or not script timed out + */ + private AtomicBoolean timedOut; + + /** + * refresh interval in msec + */ + private long interval; + + /** + * last time the command was performed + */ + private long lastTime; + /** + * env for the command execution + */ + private Map environment; + private File dir; + /** + * sub process used to execute the command + */ + private Process process; + private int exitCode; + + /** + * If or not script finished executing + */ + private AtomicBoolean completed; - /** - * set the environment for the command - * @param env Mapping of environment variables - */ - protected void setEnvironment(Map env) { - this.environment = env; - } - - /** - * set the working directory - * @param dir The directory where the command would be executed - */ - protected void setWorkingDirectory(File dir) { - this.dir = dir; - } - - /** - * check to see if a command needs to be executed and execute if needed - * @throws IOException errors - */ - protected void run() throws IOException { - if (lastTime + interval > System.currentTimeMillis()) { - return; + public AbstractShell() { + this(0L); } - // reset for next run - exitCode = 0; - runCommand(); - } - - /** - * Run a command actual work - */ - private void runCommand() throws IOException { - ProcessBuilder builder = new ProcessBuilder(getExecString()); - Timer timeOutTimer = null; - ShellTimeoutTimerTask timeoutTimerTask = null; - timedOut = new AtomicBoolean(false); - completed = new AtomicBoolean(false); - - if (environment != null) { - builder.environment().putAll(this.environment); + /** + * @param interval the minimum duration to wait before re-executing the + * command. + */ + public AbstractShell(long interval) { + this.interval = interval; + this.lastTime = (interval < 0) ? 0 : -interval; } - if (dir != null) { - builder.directory(this.dir); + + /** + * set the environment for the command + * @param env Mapping of environment variables + */ + protected void setEnvironment(Map env) { + this.environment = env; } - - process = builder.start(); - ProcessContainer.putProcess(process); - - if (timeOutInterval > 0) { - timeOutTimer = new Timer(); - timeoutTimerTask = new ShellTimeoutTimerTask( - this); - //One time scheduling. - timeOutTimer.schedule(timeoutTimerTask, timeOutInterval); + + /** + * set the working directory + * @param dir The directory where the command would be executed + */ + protected void setWorkingDirectory(File dir) { + this.dir = dir; + } + + /** + * check to see if a command needs to be executed and execute if needed + * @throws IOException errors + */ + protected void run() throws IOException { + if (lastTime + interval > System.currentTimeMillis()) { + return; + } + // reset for next run + exitCode = 0; + runCommand(); } - final BufferedReader errReader = - new BufferedReader( - new InputStreamReader(process.getErrorStream())); - BufferedReader inReader = - new BufferedReader( - new InputStreamReader(process.getInputStream())); - final StringBuilder errMsg = new StringBuilder(); - - // read error and input streams as this would free up the buffers - // free the error stream buffer - Thread errThread = new Thread() { - @Override - public void run() { + + /** + * Run a command actual work + */ + private void runCommand() throws IOException { + ProcessBuilder builder = new ProcessBuilder(getExecString()); + Timer timeOutTimer = null; + ShellTimeoutTimerTask timeoutTimerTask = null; + timedOut = new AtomicBoolean(false); + completed = new AtomicBoolean(false); + + if (environment != null) { + builder.environment().putAll(this.environment); + } + if (dir != null) { + builder.directory(this.dir); + } + + process = builder.start(); + ProcessContainer.putProcess(process); + + if (timeOutInterval > 0) { + timeOutTimer = new Timer(); + timeoutTimerTask = new ShellTimeoutTimerTask(this); + //One time scheduling. + timeOutTimer.schedule(timeoutTimerTask, timeOutInterval); + } + final BufferedReader errReader = + new BufferedReader( + new InputStreamReader(process.getErrorStream())); + BufferedReader inReader = + new BufferedReader( + new InputStreamReader(process.getInputStream())); + final StringBuilder errMsg = new StringBuilder(); + + // read error and input streams as this would free up the buffers + // free the error stream buffer + Thread errThread = new Thread() { + @Override + public void run() { + try { + String line = errReader.readLine(); + while ((line != null) && !isInterrupted()) { + errMsg.append(line); + errMsg.append(System.getProperty("line.separator")); + line = errReader.readLine(); + } + } catch (IOException ioe) { + logger.warn("Error reading the error stream", ioe); + } + } + }; + Thread inThread = new Thread() { + @Override + public void run() { + try { + parseExecResult(inReader); + } catch (IOException ioe) { + logger.warn("Error reading the in stream", ioe); + } + super.run(); + } + }; try { - String line = errReader.readLine(); - while((line != null) && !isInterrupted()) { - errMsg.append(line); - errMsg.append(System.getProperty("line.separator")); - line = errReader.readLine(); - } - } catch(IOException ioe) { - logger.warn("Error reading the error stream", ioe); + errThread.start(); + inThread.start(); + } catch (IllegalStateException ise) { + logger.warn("Illegal while starting the error and in thread", ise); } - } - }; - Thread inThread = new Thread() { - @Override - public void run() { try { - parseExecResult(inReader); - } catch (IOException ioe) { - logger.warn("Error reading the in stream", ioe); + // parse the output + exitCode = process.waitFor(); + try { + // make sure that the error and in thread exits + errThread.join(); + inThread.join(); + } catch (InterruptedException ie) { + logger.warn("Interrupted while reading the error and in stream", ie); + } + completed.compareAndSet(false,true); + //the timeout thread handling + //taken care in finally block + if (exitCode != 0 || errMsg.length() > 0) { + throw new ExitCodeException(exitCode, errMsg.toString()); + } + } catch (InterruptedException ie) { + throw new IOException(ie.toString()); + } finally { + if ((timeOutTimer != null) && !timedOut.get()) { + timeOutTimer.cancel(); + } + // close the input stream + try { + inReader.close(); + } catch (IOException ioe) { + logger.warn("Error while closing the input stream", ioe); + } + if (!completed.get()) { + errThread.interrupt(); + } + try { + errReader.close(); + } catch (IOException ioe) { + logger.warn("Error while closing the error stream", ioe); + } + ProcessContainer.removeProcess(process); + process.destroy(); + lastTime = System.currentTimeMillis(); } - super.run(); - } - }; - try { - errThread.start(); - inThread.start(); - } catch (IllegalStateException ise) { } - try { - // parse the output - exitCode = process.waitFor(); - try { - // make sure that the error and in thread exits - errThread.join(); - inThread.join(); - } catch (InterruptedException ie) { - logger.warn("Interrupted while reading the error and in stream", ie); - } - completed.compareAndSet(false,true); - //the timeout thread handling - //taken care in finally block - if (exitCode != 0 || errMsg.length() > 0) { - throw new ExitCodeException(exitCode, errMsg.toString()); - } - } catch (InterruptedException ie) { - throw new IOException(ie.toString()); - } finally { - if ((timeOutTimer!=null) && !timedOut.get()) { - timeOutTimer.cancel(); - } - // close the input stream - try { - inReader.close(); - } catch (IOException ioe) { - logger.warn("Error while closing the input stream", ioe); - } - if (!completed.get()) { - errThread.interrupt(); - } - try { - errReader.close(); - } catch (IOException ioe) { - logger.warn("Error while closing the error stream", ioe); - } - ProcessContainer.removeProcess(process); - process.destroy(); - lastTime = System.currentTimeMillis(); } - } - /** - * - * @return an array containing the command name and its parameters - */ - protected abstract String[] getExecString(); - - /** - * Parse the execution result - * @param lines lines - * @throws IOException errors - */ - protected abstract void parseExecResult(BufferedReader lines) - throws IOException; - - /** - * get the current sub-process executing the given command - * @return process executing the command - */ - public Process getProcess() { - return process; - } - - /** get the exit code - * @return the exit code of the process - */ - public int getExitCode() { - return exitCode; - } - - /** - * Set if the command has timed out. - * - */ - private void setTimedOut() { - this.timedOut.set(true); - } + /** + * + * @return an array containing the command name and its parameters + */ + protected abstract String[] getExecString(); + /** + * Parse the execution result + * @param lines lines + * @throws IOException errors + */ + protected abstract void parseExecResult(BufferedReader lines) throws IOException; + /** + * get the current sub-process executing the given command + * @return process executing the command + */ + public Process getProcess() { + return process; + } - /** - * Timer which is used to timeout scripts spawned off by shell. - */ - private static class ShellTimeoutTimerTask extends TimerTask { - - private AbstractShell shell; + /** get the exit code + * @return the exit code of the process + */ + public int getExitCode() { + return exitCode; + } - public ShellTimeoutTimerTask(AbstractShell shell) { - this.shell = shell; + /** + * Set if the command has timed out. + * + */ + private void setTimedOut() { + this.timedOut.set(true); } - @Override - public void run() { - Process p = shell.getProcess(); - try { - p.exitValue(); - } catch (Exception e) { - //Process has not terminated. - //So check if it has completed - //if not just destroy it. - if (p != null && !shell.completed.get()) { - shell.setTimedOut(); - p.destroy(); + /** + * Timer which is used to timeout scripts spawned off by shell. + */ + private static class ShellTimeoutTimerTask extends TimerTask { + + private AbstractShell shell; + + public ShellTimeoutTimerTask(AbstractShell shell) { + this.shell = shell; + } + + @Override + public void run() { + Process p = shell.getProcess(); + try { + p.exitValue(); + } catch (Exception e) { + //Process has not terminated. + //So check if it has completed + //if not just destroy it. + if (p != null && !shell.completed.get()) { + shell.setTimedOut(); + p.destroy(); + } + } } - } } - } - - /** - * This is an IOException with exit code added. - */ - public static class ExitCodeException extends IOException { - int exitCode; - - public ExitCodeException(int exitCode, String message) { - super(message); - this.exitCode = exitCode; + + /** + * This is an IOException with exit code added. + */ + public static class ExitCodeException extends IOException { + int exitCode; + + public ExitCodeException(int exitCode, String message) { + super(message); + this.exitCode = exitCode; + } + + public int getExitCode() { + return exitCode; + } } - - public int getExitCode() { - return exitCode; + + /** + * process manage container + * + */ + public static class ProcessContainer extends ConcurrentHashMap { + private static final ProcessContainer container = new ProcessContainer(); + + private ProcessContainer() { + super(); + } + + public static final ProcessContainer getInstance() { + return container; + } + + public static void putProcess(Process process) { + getInstance().put(process.hashCode(), process); + } + + public static int processSize() { + return getInstance().size(); + } + + public static void removeProcess(Process process) { + getInstance().remove(process.hashCode()); + } + + public static void destroyAllProcess() { + Set> set = getInstance().entrySet(); + for (Entry entry : set) { + try { + entry.getValue().destroy(); + } catch (Exception e) { + logger.error("Destroy All Processes error", e); + } + } + + logger.info("close " + set.size() + " executing process tasks"); + } } - } - - /** - * process manage container - * - */ - public static class ProcessContainer extends ConcurrentHashMap{ - private static final ProcessContainer container = new ProcessContainer(); - private ProcessContainer(){ - super(); - } - public static final ProcessContainer getInstance(){ - return container; - } - - public static void putProcess(Process process){ - getInstance().put(process.hashCode(), process); - } - public static int processSize(){ - return getInstance().size(); - } - - public static void removeProcess(Process process){ - getInstance().remove(process.hashCode()); - } - - public static void destroyAllProcess(){ - Set> set = getInstance().entrySet(); - for (Entry entry : set) { - try{ - entry.getValue().destroy(); - } catch (Exception e) { - logger.error("Destroy All Processes error", e); - } - } - - logger.info("close " + set.size() + " executing process tasks"); - } - } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/ShellExecutor.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/ShellExecutor.java index 8d2b76808420938bbcb9d2d3c3eead7a80bcd086..ac1eae590a1b75019fd3225e4510ff8b80652157 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/ShellExecutor.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/ShellExecutor.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.shell; import java.io.BufferedReader; @@ -34,7 +35,6 @@ public class ShellExecutor extends AbstractShell { private String[] command; private StringBuffer output; - public ShellExecutor(String... execString) { this(execString, null); } @@ -45,7 +45,7 @@ public class ShellExecutor extends AbstractShell { public ShellExecutor(String[] execString, File dir, Map env) { - this(execString, dir, env , 0L); + this(execString, dir, env,0L); } /** @@ -74,7 +74,6 @@ public class ShellExecutor extends AbstractShell { timeOutInterval = timeout; } - /** * Static method to execute a shell command. * Covers most of the simple cases without requiring the user to implement @@ -114,7 +113,7 @@ public class ShellExecutor extends AbstractShell { * @return the output of the executed command. * @throws IOException errors */ - public static String execCommand(Map env, String ... cmd) + public static String execCommand(Map env, String... cmd) throws IOException { return execCommand(env, cmd, 0L); } @@ -138,7 +137,7 @@ public class ShellExecutor extends AbstractShell { char[] buf = new char[1024]; int nRead; String line = ""; - while ( (nRead = lines.read(buf, 0, buf.length)) > 0 ) { + while ((nRead = lines.read(buf, 0, buf.length)) > 0) { line = new String(buf,0,nRead); output.append(line); } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/AbstractParameters.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/AbstractParameters.java index 5714c8a96b6a4bb7e291c0bd967409b8a5c7ad3d..4886e52c29500387e23213265f7fced2b5654c51 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/AbstractParameters.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/AbstractParameters.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task; import org.apache.dolphinscheduler.common.enums.Direct; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/IParameters.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/IParameters.java index 63c2aa04cd6ce8aa810f1a96b5470216a997f1af..f64e7098a694cd7123ea05014a69621b2396289d 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/IParameters.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/IParameters.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task; import org.apache.dolphinscheduler.common.process.ResourceInfo; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/TaskTimeoutParameter.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/TaskTimeoutParameter.java index 245b1358a6179b196b2943f6c8547db6ae17c6d8..cc1bf4e202082ff3a981ee5e1ac13c4895d55af9 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/TaskTimeoutParameter.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/TaskTimeoutParameter.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task; import org.apache.dolphinscheduler.common.enums.TaskTimeoutStrategy; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/dependent/DependentParameters.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/dependent/DependentParameters.java index 5f2e0e1853f0aabea2dd7d4231ddde0391d1417e..b62cd4813e7f4542fa500b00a3028824fe128d4c 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/dependent/DependentParameters.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/dependent/DependentParameters.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.dependent; import org.apache.dolphinscheduler.common.enums.DependentRelation; @@ -29,8 +30,6 @@ public class DependentParameters extends AbstractParameters { private List dependTaskList; private DependentRelation relation; - - @Override public boolean checkParameters() { return true; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/http/HttpParameters.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/http/HttpParameters.java index 04bc39128c38d513b688c32d552fe2130a15263d..df2c26846bb48779d5faeef6842d7bbaa944cc1e 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/http/HttpParameters.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/http/HttpParameters.java @@ -62,13 +62,13 @@ public class HttpParameters extends AbstractParameters { * Connect Timeout * Unit: ms */ - private int connectTimeout ; + private int connectTimeout; /** * Socket Timeout * Unit: ms */ - private int socketTimeout ; + private int socketTimeout; @Override public boolean checkParameters() { diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/mr/MapReduceParameters.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/mr/MapReduceParameters.java index 762ee4275ab9b67a4ea0285884c157405e631388..e9b54a3bb1599aa21d62429f9dfe110f2d19894e 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/mr/MapReduceParameters.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/mr/MapReduceParameters.java @@ -70,7 +70,6 @@ public class MapReduceParameters extends AbstractParameters { */ private ProgramType programType; - public String getMainClass() { return mainClass; } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/python/PythonParameters.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/python/PythonParameters.java index 35dbd8ed86cb9914b0804f5ce77d5e0ef68994a3..48c5e31dbb6f7ddedfa76115755caf12049b8888 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/python/PythonParameters.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/python/PythonParameters.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.task.python; +package org.apache.dolphinscheduler.common.task.python; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.AbstractParameters; @@ -23,39 +23,39 @@ import org.apache.dolphinscheduler.common.task.AbstractParameters; import java.util.List; public class PythonParameters extends AbstractParameters { - /** - * origin python script - */ - private String rawScript; - - /** - * resource list - */ - private List resourceList; - - public String getRawScript() { - return rawScript; - } - - public void setRawScript(String rawScript) { - this.rawScript = rawScript; - } - - public List getResourceList() { - return resourceList; - } - - public void setResourceList(List resourceList) { - this.resourceList = resourceList; - } - - @Override - public boolean checkParameters() { - return rawScript != null && !rawScript.isEmpty(); - } - - @Override - public List getResourceFilesList() { - return this.resourceList; - } + /** + * origin python script + */ + private String rawScript; + + /** + * resource list + */ + private List resourceList; + + public String getRawScript() { + return rawScript; + } + + public void setRawScript(String rawScript) { + this.rawScript = rawScript; + } + + public List getResourceList() { + return resourceList; + } + + public void setResourceList(List resourceList) { + this.resourceList = resourceList; + } + + @Override + public boolean checkParameters() { + return rawScript != null && !rawScript.isEmpty(); + } + + @Override + public List getResourceFilesList() { + return this.resourceList; + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlBinds.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlBinds.java index 1096185f45c21d18c89bdb957eb4c36973645c58..2d68af891eb15f14528d37367e8a9cddc7a95530 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlBinds.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlBinds.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.sql; import org.apache.dolphinscheduler.common.process.Property; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlType.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlType.java index 871900a7429a5f203a64a5f9afe046d53c076d74..c506ca3e8886fb19cc42772fe38502e408d78c95 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlType.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sql/SqlType.java @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.dolphinscheduler.common.task.sql; +package org.apache.dolphinscheduler.common.task.sql; public enum SqlType { /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/SqoopParameters.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/SqoopParameters.java index 40ec6c277b9017b7de7daed689fecac0a07f93f9..feea0fb3893a0dcabaa38db25c4061263d6e7abc 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/SqoopParameters.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/SqoopParameters.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.sqoop; import org.apache.dolphinscheduler.common.enums.SqoopJobType; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceHdfsParameter.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceHdfsParameter.java index 07f1157be0d0cc9581785590e9cc351b7a18ddb7..5346ca60735936d9cc4710eb10a0f900fed5f5a2 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceHdfsParameter.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceHdfsParameter.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.sqoop.sources; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceHiveParameter.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceHiveParameter.java index a37840f9ead99e02ae467caf87a68de8b613dc1e..b7bc97ae2f83a1d83558a765d1a4ebe9834bf22e 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceHiveParameter.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceHiveParameter.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.sqoop.sources; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceMysqlParameter.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceMysqlParameter.java index f80d681b59362469a734583e4670f7c186cc331d..9e5e81b3115ea545fbbfe06d8c9d857502e9450e 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceMysqlParameter.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/sources/SourceMysqlParameter.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.sqoop.sources; import org.apache.dolphinscheduler.common.process.Property; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetHdfsParameter.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetHdfsParameter.java index 524921dcee7973b9ee1de0b53eaa076300298ee4..e60a123f005267e7a778f02e782509167cc17f90 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetHdfsParameter.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetHdfsParameter.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.sqoop.targets; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetHiveParameter.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetHiveParameter.java index f9bfde33747afa2e81316f328ac06aa53058aeb1..eba17ee10775bda2c9256a5cc06c6a4332149cc3 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetHiveParameter.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetHiveParameter.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.sqoop.targets; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetMysqlParameter.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetMysqlParameter.java index 86931cbe46dca890d190985f61dc41f41cd7a389..b16c77cb1c64b6548c7980d73150ed0dcd1515a3 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetMysqlParameter.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/sqoop/targets/TargetMysqlParameter.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.sqoop.targets; /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/subprocess/SubProcessParameters.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/subprocess/SubProcessParameters.java index 21a4f3e52a261b3b3098dd4a7de859adec350a1f..6a783c34c325740a4435ddac769c8e1757d58502 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/subprocess/SubProcessParameters.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/subprocess/SubProcessParameters.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.task.subprocess; import org.apache.dolphinscheduler.common.process.ResourceInfo; @@ -22,7 +23,6 @@ import org.apache.dolphinscheduler.common.task.AbstractParameters; import java.util.ArrayList; import java.util.List; - public class SubProcessParameters extends AbstractParameters { /** diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/thread/Stopper.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/thread/Stopper.java index 57e8af4221bac25e6d1d65d7ecf0a8bda6aaa3ef..67abde7e7ab1495163bef0a21b3f409c7e7970ce 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/thread/Stopper.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/thread/Stopper.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.thread; import java.util.concurrent.atomic.AtomicBoolean; @@ -23,17 +24,17 @@ import java.util.concurrent.atomic.AtomicBoolean; */ public class Stopper { - private static AtomicBoolean signal = new AtomicBoolean(false); - - public static final boolean isStopped(){ - return signal.get(); - } - - public static final boolean isRunning(){ - return !signal.get(); - } - - public static final void stop(){ - signal.set(true); - } + private static AtomicBoolean signal = new AtomicBoolean(false); + + public static final boolean isStopped() { + return signal.get(); + } + + public static final boolean isRunning() { + return !signal.get(); + } + + public static final void stop() { + signal.set(true); + } } diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/thread/ThreadUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/thread/ThreadUtils.java index 5a1d3f44d0dd962f28d124b9e06c51828e3b0b57..75f624d15deb95129a66fba780e8f56fbc385f80 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/thread/ThreadUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/thread/ThreadUtils.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.thread; import java.util.concurrent.ExecutorService; @@ -32,7 +33,7 @@ public class ThreadUtils { * @param threadsNum threadsNum * @return ExecutorService */ - public static ExecutorService newDaemonFixedThreadExecutor(String threadName,int threadsNum){ + public static ExecutorService newDaemonFixedThreadExecutor(String threadName,int threadsNum) { ThreadFactory threadFactory = new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat(threadName) diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DependentUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DependentUtils.java index b8b6c1d13e1724ddd32acc0e2f261757d8bc726d..d6cea28780be0ec591f53b817f19ad4637308c12 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DependentUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/DependentUtils.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.utils; import org.apache.dolphinscheduler.common.enums.DependResult; @@ -60,7 +61,6 @@ public class DependentUtils { return dependResult; } - /** * get date interval list by business date and date value. * diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java index 4d8e3fcf5ed8e5d244a4454ece34fafc1fb3b531..a7c880db1c670c56e705c7a5c9a76601b76344a3 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java @@ -22,8 +22,8 @@ import static org.apache.dolphinscheduler.common.Constants.RESOURCE_UPLOAD_PATH; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.ResUploadType; -import org.apache.dolphinscheduler.spi.enums.ResourceType; import org.apache.dolphinscheduler.common.exception.BaseException; +import org.apache.dolphinscheduler.spi.enums.ResourceType; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java index ae4c72ce07a86b19910ea865038951de31402625..e0b32ad54b8cdc96a32ca1dbe8cffd03cd0182ef 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OSUtils.java @@ -35,7 +35,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import java.util.Optional; import java.util.StringTokenizer; import java.util.regex.Pattern; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ScriptRunner.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ScriptRunner.java index 31a362c993a373833b5d1a69af4717b7d11c57ca..33c632b8d6c49a57f61c61dbd2f9735735c896cb 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ScriptRunner.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ScriptRunner.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.utils; import java.io.IOException; diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/TriFunction.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/TriFunction.java index fe873b3475ddeb571d4c493e4a572e03ceb6910d..fae03af6b179821ea8cd96530c216e90a6fb6d96 100644 --- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/TriFunction.java +++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/TriFunction.java @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.dolphinscheduler.common.utils; /**