Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ecfa67d
[Build] Drop Scala build toolchain from Flink and Console modules
shangeyao Aug 3, 2026
4da35ea
[Test][Common][Flink] Add migration regression tests and small cleanups
shangeyao Aug 3, 2026
9a0921c
[Common][Flink] Sonar-oriented fixes and expand migration regression …
shangeyao Aug 3, 2026
86d7cf0
[Test] Keep unit-test-only coverage; revert production Sonar edits
shangeyao Aug 3, 2026
48a1390
[Common][Flink] Re-apply Sonar Java quality fixes with unit test sync
shangeyao Aug 3, 2026
49c5af3
[Flink] Fix shims Sonar issues in code and remove migration Sonar con…
shangeyao Aug 3, 2026
6bfee9f
[Flink] Remove unused imports after TableContext refactor
shangeyao Aug 3, 2026
460d04c
[Flink] Drop invalid @Override on FlinkStreamTableTrait.execute
shangeyao Aug 3, 2026
eb252c1
[Flink] Address Sonar new-code findings in shims-base
shangeyao Aug 3, 2026
74f4f94
[Flink] Continue Sonar cleanup for shims, client, and SQL splitter
shangeyao Aug 3, 2026
065463b
[Flink] Hoist shared Table API to traits and slim version shims contexts
shangeyao Aug 3, 2026
c7f7cdb
[Flink] Hoist stream-table bridge APIs and collapse version contexts
shangeyao Aug 3, 2026
c9e8794
[Flink] Remove unchecked proxy casts and tighten error handling
shangeyao Aug 3, 2026
db634ae
[Flink] Clean up packer and kubernetes Sonar findings
shangeyao Aug 3, 2026
5e0291d
[Flink] Replace RuntimeException in Yarn client deploy paths
shangeyao Aug 3, 2026
fcf3d21
[Console] Replace Flink RuntimeException usages with typed failures
shangeyao Aug 3, 2026
e56b2e0
[Common] Replace RuntimeException with typed failures in shared utili…
shangeyao Aug 3, 2026
02d861c
[Flink] Fix Sonar duplication and code smell findings for PR #4471
shangeyao Aug 3, 2026
74410a3
[Flink] Extract shared Yarn/K8s build pipeline steps to fix Sonar dup…
shangeyao Aug 3, 2026
b064d66
[Console] Extract shared application and build pipeline helpers to fi…
shangeyao Aug 3, 2026
bcbc485
[Console] Further deduplicate entities, build pipelines, and watchers…
shangeyao Aug 3, 2026
031cdf4
[Common] Fix StringCastUtils generic cast and restore Flink build log…
shangeyao Aug 3, 2026
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
39 changes: 0 additions & 39 deletions .sonarcloud.properties

This file was deleted.

38 changes: 0 additions & 38 deletions sonar-project.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@

import java.io.File;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import scala.collection.JavaConverters;

/** @param flinkHome actual flink home that must be a readable local path */
public class FlinkVersion implements Serializable {

Expand Down Expand Up @@ -85,11 +84,6 @@ public String version() {
return getVersion();
}

/** Scala API alias for {@link #getFlinkLibs()}. */
public scala.collection.immutable.List<URL> flinkLibs() throws Exception {
return JavaConverters.asScalaIteratorConverter(getFlinkLibs().iterator()).asScala().toList();
}

public String getScalaVersion() {
if (scalaVersion == null) {
Matcher matcher = FLINK_SCALA_VERSION_PATTERN.matcher(getFlinkDistJar().getName());
Expand Down Expand Up @@ -123,13 +117,13 @@ public File getFlinkLib() {
public List<URL> getFlinkLibs() throws Exception {
File[] files = getFlinkLib().listFiles();
if (files == null) {
return Arrays.asList();
return Collections.emptyList();
}
return Arrays.stream(files).map(f -> {
try {
return f.toURI().toURL();
} catch (Exception e) {
throw new RuntimeException(e);
} catch (MalformedURLException e) {
throw new IllegalArgumentException("Invalid Flink lib URL: " + f, e);
}
}).collect(Collectors.toList());
}
Expand All @@ -147,22 +141,18 @@ public String getVersion() {
CommandUtils.execute(
getFlinkLib().getAbsolutePath(),
cmd,
new Consumer<String>() {

@Override
public void accept(String out) {
buffer.append(out).append("\n");
Matcher matcher = FLINK_VERSION_PATTERN.matcher(out);
if (matcher.find()) {
String ver = matcher.group(1);
Matcher m1 = APACHE_FLINK_VERSION_PATTERN.matcher(ver);
if (m1.find()) {
out -> {
buffer.append(out).append("\n");
Matcher matcher = FLINK_VERSION_PATTERN.matcher(out);
if (matcher.find()) {
String ver = matcher.group(1);
Matcher m1 = APACHE_FLINK_VERSION_PATTERN.matcher(ver);
if (m1.find()) {
flinkVersion[0] = ver;
} else {
Matcher m2 = OTHER_FLINK_VERSION_PATTERN.matcher(ver);
if (m2.find()) {
flinkVersion[0] = ver;
} else {
Matcher m2 = OTHER_FLINK_VERSION_PATTERN.matcher(ver);
if (m2.find()) {
flinkVersion[0] = ver;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static String[] parseVersion(String sparkHome) {
sparkVersion[1] = m1.group(1);
});
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to parse Spark version from " + sparkHome, e);
}
LOG.info("[StreamPark] {}", buffer);
if (sparkVersion[0] == null || sparkVersion[1] == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static <T extends AutoCloseable, R> R using(
if (e instanceof Error) {
throw (Error) e;
}
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void loadJar(String jarFilePath) {
try {
loadPath(f.getAbsolutePath());
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to load jar: " + jarFilePath, e);
}
}

Expand All @@ -91,7 +91,7 @@ public static void loadJars(String path) {
try {
loadPath(x.getAbsolutePath());
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to load jar: " + x.getAbsolutePath(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public static CommandResult execute(String command) {
return new CommandResult(code, buffer.toString());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
throw new IllegalStateException(e);
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand Down Expand Up @@ -96,9 +96,9 @@ public static int execute(String directory, Iterable<String> commands, Consumer<
return waitFor(process);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
throw new IllegalStateException(e);
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public static <I, O> O wrapRuntimeException(I input, WrapperRuntimeExceptionHand
return handler.handle(input);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
throw new IllegalStateException(e);
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static String bytesToHexString(byte[] src) {

public static boolean isJarFileType(InputStream input) {
if (input == null) {
throw new RuntimeException("The inputStream can not be null");
throw new IllegalArgumentException("The inputStream can not be null");
}
return AutoCloseUtils.using(
input,
Expand All @@ -94,7 +94,7 @@ public static boolean isJarFileType(InputStream input) {
try {
in.read(b, 0, b.length);
} catch (IOException e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to read jar file header", e);
}
return bytesToHexString(b);
})
Expand All @@ -103,7 +103,7 @@ public static boolean isJarFileType(InputStream input) {

public static boolean isJarFileType(File file) throws IOException {
if (!file.exists() || !file.isFile()) {
throw new RuntimeException("The file does not exist or the path is a directory");
throw new IllegalArgumentException("The file does not exist or the path is a directory");
}
return isJarFileType(new FileInputStream(file));
}
Expand Down Expand Up @@ -174,7 +174,7 @@ public static List<URL> listFileAsURL(String dirPath) {
try {
urls.add(f.toURI().toURL());
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to convert file to URL: " + f, e);
}
}
return urls;
Expand Down Expand Up @@ -206,7 +206,7 @@ public static boolean equals(File file1, File file2) {
try {
return equalsInternal(file1, file2);
} catch (IOException e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to compare files", e);
}
}

Expand Down Expand Up @@ -310,7 +310,7 @@ public static String tailOf(String path, int offset, int limit) {
}
return null;
} catch (IOException e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to read tail of file: " + path, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static Map<String, String> loadFlinkConf(File file) {
return loadFlinkConf(
org.apache.commons.io.FileUtils.readFileToString(file, StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to read Flink configuration file: " + file, e);
}
}

Expand All @@ -79,7 +79,7 @@ public static Map<String, String> loadLegacyFlinkConf(File file) {
return loadLegacyFlinkConf(
org.apache.commons.io.FileUtils.readFileToString(file, StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to read legacy Flink configuration file: " + file, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static HBaseClient apply(Properties prop) {
}));
return connection;
} catch (Exception e) {
throw new RuntimeException(e);
throw new IllegalStateException("Failed to create HBase connection", e);
}
});
}
Expand Down
Loading
Loading