Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-3061][Improve] Improve streampark-common module base on [4 Exception Processing] #3266

Merged
merged 1 commit into from
Oct 22, 2023
Merged
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 @@ -50,7 +50,7 @@ case class ConfigOption[T](
case null =>
if (required) {
prop.get(fullKey) match {
case null => throw error("is require")
case null => throw error("Is require")
case v => v.toString.cast[T](classType)
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ object InternalConfigHolder extends Logger {
SystemPropertyUtils.get(key) match {
case v if v != null => v.cast[T](config.classType)
case _ =>
throw new IllegalArgumentException(s"config key has not been registered: $key")
throw new IllegalArgumentException(s"Config key has not been registered: $key")
}
case conf: InternalOption => conf.defaultValue.asInstanceOf[T]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package org.apache.streampark.common.util

import java.io.{File, IOException}
import java.net.{URL, URLClassLoader}
import java.util.function.{Consumer, Supplier}
import java.util.function.Supplier

import scala.collection.mutable.ArrayBuffer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ object HadoopUtils extends Logger {
val tmpDir = FileUtils.createTempDir()
val fs = FileSystem.get(new Configuration)
val sourcePath = fs.makeQualified(new Path(jarOnHdfs))
if (!fs.exists(sourcePath)) throw new IOException(s"jar file: $jarOnHdfs doesn't exist.")
if (!fs.exists(sourcePath)) throw new IOException(s"Jar file: $jarOnHdfs doesn't exist.")
val destPath = new Path(tmpDir.getAbsolutePath + "/" + sourcePath.getName)
fs.copyToLocalFile(sourcePath, destPath)
new File(destPath.toString).getAbsolutePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private[this] object LoggerFactory extends LoggerFactoryBinder {
override def getLoggerFactory: ILoggerFactory = {
if (contextSelectorBinder.getContextSelector == null) {
throw new IllegalStateException(
"contextSelector cannot be null. See also " + CoreConstants.CODES_URL + "#null_CS")
"'contextSelector' cannot be null. See also " + CoreConstants.CODES_URL + "#null_CS")
}
contextSelectorBinder.getContextSelector.getLoggerContext
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object SystemPropertyUtils extends Logger {
def get(key: String, default: String): String = {
require(key != null, "[StreamPark] key must not be null.")
key match {
case empty if empty.isEmpty => throw new IllegalArgumentException("key must not be empty.")
case empty if empty.isEmpty => throw new IllegalArgumentException("Key must not be empty.")
case other =>
Try {
System.getSecurityManager match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object Utils extends Logger {

def required(expression: Boolean, errorMessage: Any): Unit = {
if (!expression) {
throw new IllegalArgumentException(s"requirement failed: ${errorMessage.toString}")
throw new IllegalArgumentException(s"Requirement failed: ${errorMessage.toString}")
}
}

Expand Down