Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@ public TaskExecutorRuntimeException(String message) {
super(message);
}

public TaskExecutorRuntimeException(String message, Throwable cause) {
super(message, cause);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

public class AliyunServerlessSparkTaskException extends RuntimeException {

public AliyunServerlessSparkTaskException() {
super();
}

public AliyunServerlessSparkTaskException(String message) {
super(message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import org.apache.dolphinscheduler.common.constants.DateConstants;

import java.time.Duration;
import java.util.Set;
import java.util.regex.Pattern;

Expand All @@ -42,31 +41,17 @@ private TaskConstants() {
public static final int EXIT_CODE_HARD_KILL = 143;
public static final String PID = "pid";

public static final String QUESTION = "?";

public static final String COMMA = ",";

public static final String HYPHEN = "-";

public static final String SLASH = "/";

public static final String COLON = ":";

public static final String SPACE = " ";

public static final String SINGLE_SLASH = "/";

public static final String DOUBLE_SLASH = "//";

public static final String SINGLE_QUOTES = "'";
public static final String DOUBLE_QUOTES = "\"";

public static final String SEMICOLON = ";";

public static final String EQUAL_SIGN = "=";

public static final String UNDERLINE = "_";

/**
* sleep time
*/
Expand All @@ -77,13 +62,6 @@ private TaskConstants() {
public static final int EXIT_CODE_SUCCESS = 0;
public static final int RUNNING_CODE = 1;

public static final String SH = "sh";

/**
* log flush interval?output when reach the interval
*/
public static final int DEFAULT_LOG_FLUSH_INTERVAL = 1000;

/**
* pstree, get pud and sub pid
*/
Expand All @@ -107,16 +85,6 @@ private TaskConstants() {
*/
public static final String PARAMETER_DATETIME = DateConstants.PARAMETER_DATETIME;

/**
* system date(yyyymmdd) today
*/
public static final String PARAMETER_CURRENT_DATE = DateConstants.PARAMETER_CURRENT_DATE;

/**
* system date(yyyymmdd) yesterday
*/
public static final String PARAMETER_BUSINESS_DATE = DateConstants.PARAMETER_BUSINESS_DATE;

/**
* the absolute path of current executing task
*/
Expand Down Expand Up @@ -194,7 +162,6 @@ private TaskConstants() {
public static final String SUBTRACT_STRING = "-";
public static final String LOCAL_PARAMS_LIST = "localParamsList";
public static final String TASK_TYPE = "taskType";
public static final String QUEUE = "queue";
public static final int DEFAULT_DISPLAY_ROWS = 10;

public static final String JAR = "jar";
Expand All @@ -216,8 +183,6 @@ private TaskConstants() {
public static final String HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE =
"hadoop.security.authentication.startup.state";

public static final String TASK_TYPE_DATA_QUALITY = "DATA_QUALITY";

public static final Set<String> TASK_TYPE_SET_K8S = Sets.newHashSet("K8S", "KUBEFLOW");

/**
Expand All @@ -242,7 +207,6 @@ private TaskConstants() {
public static final String TASK_INSTANCE_ID = "taskInstanceId";
public static final String MI = "Mi";
public static final int JOB_TTL_SECONDS = 300;
public static final int LOG_LINES = 500;
public static final String NAMESPACE_NAME = "name";
public static final String CLUSTER = "cluster";

Expand All @@ -256,9 +220,6 @@ private TaskConstants() {
*/
public static final String CONDA_PATH = "conda.path";

// Loop task constants
public static final Duration DEFAULT_LOOP_STATUS_INTERVAL = Duration.ofSeconds(5L);

/**
* sql params regex
*/
Expand All @@ -281,6 +242,6 @@ private TaskConstants() {
public static final String WORKFLOW_INSTANCE_ID_MDC_KEY = "workflowInstanceId";
public static final String TASK_INSTANCE_ID_MDC_KEY = "taskInstanceId";

public static final String STAR = "*";
public static final String SENSITIVE_DATA_MASK = "******";

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
public class KubernetesApplicationManager implements ApplicationManager<KubernetesApplicationManagerContext> {

private static final String PENDING = "Pending";
private static final String RUNNING = "Running";
private static final String FINISH = "Succeeded";
private static final String FAILED = "Failed";
private static final String UNKNOWN = "Unknown";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ public static TaskExecutionStatus of(int code) {
return taskExecutionStatus;
}

public boolean isRunning() {
return this == RUNNING_EXECUTION;
}

public boolean isSuccess() {
return this == TaskExecutionStatus.SUCCESS;
}
Expand All @@ -86,17 +82,6 @@ public boolean isFinished() {
return isSuccess() || isKill() || isFailure() || isPause() || isForceSuccess();
}

public boolean isNeedFaultTolerance() {
return this == NEED_FAULT_TOLERANCE;
}

public boolean shouldFailover() {
return SUBMITTED_SUCCESS == this
|| DISPATCH == this
|| RUNNING_EXECUTION == this
|| DELAY_EXECUTION == this;
}

@EnumValue
private final int code;
private final String desc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ public void setInterval(int interval) {
this.interval = interval;
}

public TaskTimeoutParameter() {
}

public TaskTimeoutParameter(boolean enable) {
this.enable = enable;
}

public TaskTimeoutParameter(boolean enable, TaskTimeoutStrategy strategy, int interval) {
this.enable = enable;
this.strategy = strategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,6 @@ public class PropertyPlaceholderHelper {

private final boolean ignoreUnresolvablePlaceholders;

/**
* Creates a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
* Unresolvable placeholders are ignored.
* @param placeholderPrefix the prefix that denotes the start of a placeholder
* @param placeholderSuffix the suffix that denotes the end of a placeholder
*/
public PropertyPlaceholderHelper(String placeholderPrefix, String placeholderSuffix) {
this(placeholderPrefix, placeholderSuffix, null, true);
}

/**
* Creates a new {@code PropertyPlaceholderHelper} that uses the supplied prefix and suffix.
* @param placeholderPrefix the prefix that denotes the start of a placeholder
Expand All @@ -92,24 +82,6 @@ public PropertyPlaceholderHelper(String placeholderPrefix, String placeholderSuf
this.ignoreUnresolvablePlaceholders = ignoreUnresolvablePlaceholders;
}

/**
* Replaces all placeholders of format {@code ${name}} with the corresponding
* property from the supplied {@link Properties}.
* @param value the value containing the placeholders to be replaced
* @param properties the {@code Properties} to use for replacement
* @return the supplied value with placeholders replaced inline
*/
public String replacePlaceholders(String value, final Properties properties) {
notNull(properties, "'properties' must not be null");
return replacePlaceholders(value, new PlaceholderResolver() {

@Override
public String resolvePlaceholder(String placeholderName) {
return properties.getProperty(placeholderName);
}
});
}

/**
* Replaces all placeholders of format {@code ${name}} with the value returned
* from the supplied {@link PlaceholderResolver}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.apache.dolphinscheduler.plugin.task.api.utils;

import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.SINGLE_QUOTES;

public class ArgsUtils {

private ArgsUtils() throws IllegalStateException {
Expand All @@ -29,8 +27,4 @@ public static String escape(String arg) {
return arg.replace(" ", "\\ ").replace("\"", "\\\"").replace("'", "\\'");
}

public static String wrapperSingleQuotes(String value) {
return SINGLE_QUOTES + value + SINGLE_QUOTES;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@

package org.apache.dolphinscheduler.plugin.task.api.utils;

import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.LOG_LINES;

import org.apache.dolphinscheduler.plugin.task.api.TaskException;

import java.util.List;

import lombok.extern.slf4j.Slf4j;
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.api.model.batch.v1.Job;
import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.KubernetesClient;
Expand Down Expand Up @@ -83,27 +78,6 @@ public Watch createBatchJobWatcher(String jobName, Watcher<Job> watcher) {
}
}

public String getPodLog(String jobName, String namespace) {
try {
List<Pod> podList = client.pods().inNamespace(namespace).list().getItems();
String podName = null;
for (Pod pod : podList) {
podName = pod.getMetadata().getName();
if (podName.contains("-") && jobName.equals(podName.substring(0, podName.lastIndexOf("-")))) {
break;
}
}
return client.pods().inNamespace(namespace)
.withName(podName)
.tailingLines(LOG_LINES)
.getLog(Boolean.TRUE);
} catch (Exception e) {
log.error("fail to getPodLog", e);
log.error("response bodies : {}", e.getMessage());
}
return null;
}

public void buildClient(String configYaml) {
try {
Config config = Config.fromKubeconfig(configYaml);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,6 @@ public List<Property> mergeVarPool(List<List<Property>> varPools) {
return new ArrayList<>(result.values());
}

public String subtractVarPoolJson(String varPool, List<String> subtractVarPool) {
List<Property> varPoolList = deserializeVarPool(varPool);
List<List<Property>> subtractVarPoolList = subtractVarPool.stream()
.map(VarPoolUtils::deserializeVarPool)
.collect(Collectors.toList());
List<Property> finalVarPool = subtractVarPool(varPoolList, subtractVarPoolList);
return JSONUtils.toJsonString(finalVarPool);
}

/**
* Return the subtracted varpool, which key is in varPool but not in subtractVarPool.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,8 @@
*/
public class DinkyTaskException extends RuntimeException {

public DinkyTaskException() {
super();
}

public DinkyTaskException(String message) {
super(message);
}

public DinkyTaskException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ private FlinkConstants() {
public static final String FLINK_TASK_MANAGE_MEM = "-ytm";
public static final String FLINK_MAIN_CLASS = "-c";
public static final String FLINK_PARALLELISM = "-p";
public static final String FLINK_SHUTDOWN_ON_ATTACHED_EXIT = "-sae";
public static final String FLINK_PYTHON = "-py";
public static final String FLINK_SAVEPOINT = "savepoint";
public static final String FLINK_METRICS = "metrics";
public static final String FLINK_OVERVIEW = "overview";
public static final String FLINK_JOBS = "jobs";
public static final String FLINK_CANCEL = "cancel";
// For Flink SQL
public static final String FLINK_FORMAT_EXECUTION_TARGET = "set execution.target=%s";
Expand Down
Loading
Loading