Skip to content

Commit 291058a

Browse files
authored
[Improvement-18056] Remove unused code in storage module (#18114)
1 parent af6d8f1 commit 291058a

16 files changed

Lines changed: 23 additions & 282 deletions

File tree

.github/workflows/unit-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
name: SonarCloud Analysis
172172
runs-on: ubuntu-latest
173173
needs: [ paths-filter, unit-test ]
174-
if: ${{ always() && (needs.paths-filter.outputs.not-ignore == 'true' || github.event_name == 'push') }}
174+
if: ${{ needs.unit-test.result == 'success' }}
175175
timeout-minutes: 30
176176
steps:
177177
- uses: actions/checkout@v6
@@ -250,8 +250,8 @@ jobs:
250250
publish-test-results:
251251
name: Publish Test Results
252252
runs-on: ubuntu-latest
253-
needs: unit-test
254-
if: always()
253+
needs: [ paths-filter, unit-test ]
254+
if: ${{ needs.unit-test.result == 'success' }}
255255
steps:
256256
- name: Download all surefire reports
257257
uses: actions/download-artifact@v8

dolphinscheduler-storage-plugin/dolphinscheduler-storage-abs/src/main/java/org/apache/dolphinscheduler/plugin/storage/abs/AbsStorageOperator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public StorageEntity getStorageEntity(String resourceAbsolutePath) {
183183
return null;
184184
}
185185

186-
public void checkContainerNameExists(String containerName) {
186+
private void checkContainerNameExists(String containerName) {
187187
if (StringUtils.isBlank(containerName)) {
188188
throw new IllegalArgumentException(containerName + " is blank");
189189
}

dolphinscheduler-storage-plugin/dolphinscheduler-storage-abs/src/test/resources/logback.xml

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

dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/StorageType.java

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,20 @@
2121

2222
public enum StorageType {
2323

24-
LOCAL(0, "LOCAL"),
25-
HDFS(1, "HDFS"),
26-
OSS(2, "OSS"),
27-
S3(3, "S3"),
28-
GCS(4, "GCS"),
29-
30-
ABS(5, "ABS"),
31-
32-
OBS(6, "OBS"),
33-
34-
COS(7, "COS"),
35-
36-
;
37-
38-
private final int code;
39-
private final String name;
40-
41-
StorageType(int code, String name) {
42-
this.code = code;
43-
this.name = name;
44-
}
45-
46-
public int getCode() {
47-
return code;
48-
}
49-
50-
public String getName() {
51-
return name;
52-
}
24+
LOCAL,
25+
HDFS,
26+
OSS,
27+
S3,
28+
GCS,
29+
ABS,
30+
OBS,
31+
COS;
5332

5433
public static Optional<StorageType> getStorageType(String name) {
55-
for (StorageType storageType : StorageType.values()) {
56-
if (storageType.getName().equals(name)) {
57-
return Optional.of(storageType);
58-
}
34+
try {
35+
return Optional.of(StorageType.valueOf(name));
36+
} catch (IllegalArgumentException | NullPointerException ex) {
37+
return Optional.empty();
5938
}
60-
return Optional.empty();
6139
}
6240
}

dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/constants/DateConstants.java

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

dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/constants/StorageConstants.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
@UtilityClass
2323
public final class StorageConstants {
2424

25-
public static final String RESOURCE_TYPE_FILE = "resources";
26-
2725
/**
2826
* resource.hdfs.fs.defaultFS
2927
*/

dolphinscheduler-storage-plugin/dolphinscheduler-storage-cos/src/main/java/org/apache/dolphinscheduler/plugin/storage/cos/CosStorageOperator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public StorageEntity getStorageEntity(String resourceAbsolutePath) {
307307
return transformCOSObjectToStorageEntity(object);
308308
}
309309

310-
public void ensureBucketSuccessfullyCreated(String bucketName) {
310+
private void ensureBucketSuccessfullyCreated(String bucketName) {
311311
if (StringUtils.isBlank(bucketName)) {
312312
throw new IllegalArgumentException(CosStorageConstants.TENCENT_CLOUD_COS_BUCKET_NAME + " is empty");
313313
}

dolphinscheduler-storage-plugin/dolphinscheduler-storage-cos/src/test/resources/logback.xml

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

dolphinscheduler-storage-plugin/dolphinscheduler-storage-gcs/src/test/resources/logback.xml

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

dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/test/resources/storage/hello.sh

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

0 commit comments

Comments
 (0)