-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Feature][Zeta] Add a jvm.properties file to define the SeaTunnel Zeta JVM Options #3771
Conversation
hi @EricJoy2048,Considering the future jdk upgrade 11 or higher, the current JVM configuration items to have the ability to backward compatibility, I referred to some relevant information, will be designed into this format: |
...-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/jvm/JvmOptionsParser.java
Outdated
Show resolved
Hide resolved
Hi, can you add some test case for this? Thanks. |
@Hisoka-X Thanks for your review,I have made the changes. |
Can you and some test for JDK, openjdk ? |
|
||
static List<Integer> parse(final String value) { | ||
if (!value.matches("^0*[0-9]+(\\.[0-9]+)*$")) { | ||
throw new IllegalArgumentException(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a custom Exception is better.
parse( | ||
JavaVersion.majorVersion(JavaVersion.CURRENT), | ||
br, | ||
new JvmOptionConsumer() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jvmOption -> jvmOptions.add(jvmOption)
is better.
jvmOptions.add(jvmOption); | ||
} | ||
}, | ||
new InvalidLineConsumer() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(lineNumber, line) -> invalidLines.put(lineNumber, line)
is bettter.
@EricJoy2048 Thanks for your review,I have made the changes. |
seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/CommonErrorCode.java
Show resolved
Hide resolved
final int javaMajorVersion, | ||
final BufferedReader br, | ||
final JvmOptionConsumer jvmOptionConsumer, | ||
final InvalidLineConsumer invalidLineConsumer){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a blank between ) and {
CLASS_PATH=${APP_DIR}/lib/*:${APP_JAR} | ||
|
||
ST_TMPDIR=`java -cp ${CLASS_PATH} org.apache.seatunnel.core.starter.seatunnel.jvm.TempDirectory` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do We need to write a class to generate a temporary directory? Why not using shell instead of this? cc @EricJoy2048 @Hisoka-X
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the temp dir use for? Can you give me some tips?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TyrantLucifer Is the latter engine considered for deployment in a windows environment?
If the future expectation is compatible with windows need this class, so that the logic of .sh and .bat files will be the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MonsterChenzhuo Can you provide JAVA_OPTS
after add ST_TMPDIR
? Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @EricJoy2048
@TyrantLucifer Thanks for your review,I have made the changes. |
path = Paths.get(System.getProperty("java.io.tmpdir"), "seatunnel"); | ||
Files.createDirectories(path); | ||
} else { | ||
path = Files.createTempDirectory("seatunnel-"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path = Files.createTempDirectory("seatunnel-"); | |
path = Files.createTempDirectory("seatunnel"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Purpose of this pull request
close:#3710
Check list
New License Guide