Skip to content

Commit becfbbb

Browse files
authored
[Improvement-18056] Clean up unused methods and classes in the dolphinschudler-common module (#18147)
1 parent 7467cb2 commit becfbbb

16 files changed

Lines changed: 5 additions & 343 deletions

File tree

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/CommandKeyConstants.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,8 @@ public class CommandKeyConstants {
3131

3232
public static final String CMD_PARAM_START_NODES = "StartNodeList";
3333

34-
public static final String CMD_PARAM_START_PARAMS = "StartParams";
35-
36-
public static final String CMD_PARAM_FATHER_PARAMS = "fatherParams";
37-
3834
public static final String CMD_DYNAMIC_START_PARAMS = "dynamicParams";
3935

40-
/**
41-
* complement data start date
42-
*/
43-
public static final String CMD_PARAM_COMPLEMENT_DATA_START_DATE = "complementStartDate";
44-
45-
/**
46-
* complement data end date
47-
*/
48-
public static final String CMD_PARAM_COMPLEMENT_DATA_END_DATE = "complementEndDate";
49-
5036
/**
5137
* complement data Schedule date
5238
*/

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/Constants.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ public final class Constants {
120120
*/
121121
public static final String SEMICOLON = ";";
122122

123-
public static final String ADDRESS = "address";
124-
public static final String DATABASE = "database";
125-
126123
public static final String IMPORT_SUFFIX = "_import_";
127124

128125
public static final String COPY_SUFFIX = "_copy_";
@@ -209,8 +206,6 @@ public final class Constants {
209206
public static final String THREAD_NAME_WORKER_SERVER = "Worker-Server";
210207
public static final String THREAD_NAME_ALERT_SERVER = "Alert-Server";
211208

212-
// suffix of crc file
213-
214209
/**
215210
* complement date default cron string
216211
*/
@@ -466,8 +461,6 @@ public final class Constants {
466461

467462
public static final String REMOTE_LOGGING_BASE_DIR = "remote.logging.base.dir";
468463

469-
public static final String REMOTE_LOGGING_THREAD_POOL_SIZE = "remote.logging.thread.pool.size";
470-
471464
/**
472465
* remote logging for OSS
473466
*/

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/DbConnectType.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ProfileType.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717

1818
package org.apache.dolphinscheduler.common.enums;
1919

20-
import java.util.List;
21-
22-
import com.google.common.collect.Lists;
23-
2420
public enum ProfileType {
2521
;
2622

@@ -30,5 +26,4 @@ public enum ProfileType {
3026

3127
public static final String POSTGRESQL = "postgresql";
3228

33-
public static final List<String> DATASOURCE_PROFILE = Lists.newArrayList(H2, MYSQL, POSTGRESQL);
3429
}

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/graph/DAG.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,6 @@ private Map.Entry<Boolean, List<Node>> topologicalSortImpl() {
496496
return new AbstractMap.SimpleEntry<>(notZeroIndegreeNodeMap.size() == 0, topoResultList);
497497
}
498498

499-
/**
500-
* Get all the nodes that are in the graph
501-
*
502-
* @return all nodes in the graph
503-
*/
504-
public Set<Node> getAllNodesList() {
505-
return nodesMap.keySet();
506-
}
507-
508499
@Override
509500
public String toString() {
510501
return "DAG{"

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/lifecycle/ServerLifeCycleException.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,4 @@ public ServerLifeCycleException(String message) {
2323
super(message);
2424
}
2525

26-
public ServerLifeCycleException(String message, Throwable throwable) {
27-
super(message, throwable);
28-
}
2926
}

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/lifecycle/ServerLifeCycleManager.java

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ public static void toRunning() {
3636
serverStatus = ServerStatus.RUNNING;
3737
}
3838

39-
public static boolean isRunning() {
40-
return serverStatus == ServerStatus.RUNNING;
41-
}
42-
4339
public static boolean isStopped() {
4440
return serverStatus == ServerStatus.STOPPED;
4541
}
@@ -48,39 +44,6 @@ public static ServerStatus getServerStatus() {
4844
return serverStatus;
4945
}
5046

51-
/**
52-
* Change the current server state to {@link ServerStatus#WAITING}, only {@link ServerStatus#RUNNING} can change to {@link ServerStatus#WAITING}.
53-
*
54-
* @throws ServerLifeCycleException if change failed.
55-
*/
56-
public static synchronized void toWaiting() throws ServerLifeCycleException {
57-
if (isStopped()) {
58-
throw new ServerLifeCycleException("The current server is already stopped, cannot change to waiting");
59-
}
60-
61-
if (serverStatus == ServerStatus.WAITING) {
62-
log.warn("The current server is already at waiting status, cannot change to waiting");
63-
return;
64-
}
65-
serverStatus = ServerStatus.WAITING;
66-
}
67-
68-
/**
69-
* Recover from {@link ServerStatus#WAITING} to {@link ServerStatus#RUNNING}.
70-
*/
71-
public static synchronized void recoverFromWaiting() throws ServerLifeCycleException {
72-
if (isStopped()) {
73-
throw new ServerLifeCycleException("The current server is already stopped, cannot recovery");
74-
}
75-
76-
if (serverStatus == ServerStatus.RUNNING) {
77-
log.warn("The current server status is already running, cannot recover form waiting");
78-
return;
79-
}
80-
serverStartupTime = System.currentTimeMillis();
81-
serverStatus = ServerStatus.RUNNING;
82-
}
83-
8447
public static synchronized boolean toStopped() {
8548
if (serverStatus == ServerStatus.STOPPED) {
8649
return false;

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/lifecycle/ServerStatus.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
public enum ServerStatus {
2424

2525
RUNNING(0, "The current server is running"),
26-
WAITING(1, "The current server is waiting, this means it cannot work"),
2726
STOPPED(2, "The current server is stopped"),
2827
;
2928

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/log/remote/RemoteLogUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class RemoteLogUtils {
4040

4141
@Autowired
4242
private RemoteLogService autowiredRemoteLogService;
43+
4344
@PostConstruct
4445
private void init() {
4546
remoteLogService = autowiredRemoteLogService;

dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/shell/AbstractShell.java

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.io.IOException;
2323
import java.io.InputStreamReader;
2424
import java.util.Map;
25-
import java.util.Set;
2625
import java.util.Timer;
2726
import java.util.TimerTask;
2827
import java.util.concurrent.ConcurrentHashMap;
@@ -44,6 +43,7 @@ public abstract class AbstractShell {
4443
* Time after which the executing script would be timedout
4544
*/
4645
protected long timeOutInterval = 0L;
46+
4747
/**
4848
* If or not script timed out
4949
*/
@@ -63,12 +63,14 @@ public abstract class AbstractShell {
6363
* env for the command execution
6464
*/
6565
private Map<String, String> environment;
66+
6667
private File dir;
6768

6869
/**
6970
* sub process used to execute the command
7071
*/
7172
private Process process;
73+
7274
private int exitCode;
7375

7476
/**
@@ -251,13 +253,6 @@ public Process getProcess() {
251253
return process;
252254
}
253255

254-
/** get the exit code
255-
* @return the exit code of the process
256-
*/
257-
public int getExitCode() {
258-
return exitCode;
259-
}
260-
261256
/**
262257
* Set if the command has timed out.
263258
*
@@ -306,9 +301,6 @@ public ExitCodeException(int exitCode, String message) {
306301
this.exitCode = exitCode;
307302
}
308303

309-
public int getExitCode() {
310-
return exitCode;
311-
}
312304
}
313305

314306
/**
@@ -331,25 +323,9 @@ public static void putProcess(Process process) {
331323
getInstance().put(process.hashCode(), process);
332324
}
333325

334-
public static int processSize() {
335-
return getInstance().size();
336-
}
337-
338326
public static void removeProcess(Process process) {
339327
getInstance().remove(process.hashCode());
340328
}
341329

342-
public static void destroyAllProcess() {
343-
Set<Entry<Integer, Process>> set = getInstance().entrySet();
344-
for (Entry<Integer, Process> entry : set) {
345-
try {
346-
entry.getValue().destroy();
347-
} catch (Exception e) {
348-
log.error("Destroy All Processes error", e);
349-
}
350-
}
351-
352-
log.info("close " + set.size() + " executing process tasks");
353-
}
354330
}
355331
}

0 commit comments

Comments
 (0)