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

[Feature][Zeta] Add a jvm.properties file to define the SeaTunnel Zeta JVM Options #3771

Merged
merged 33 commits into from
Feb 10, 2023

Conversation

MonsterChenzhuo
Copy link
Contributor

@MonsterChenzhuo MonsterChenzhuo commented Dec 19, 2022

Purpose of this pull request

close:#3710

Check list

@MonsterChenzhuo
Copy link
Contributor Author

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: 8-13:-XX:+UseConcMarkSweepGC on behalf of the current machine jdk running version between 8-13 this parameter will take effect, so I did not use . properties file format for implementation.

@Hisoka-X Hisoka-X added feature New feature Zeta labels Dec 28, 2022
@Hisoka-X
Copy link
Member

Hi, can you add some test case for this? Thanks.

@MonsterChenzhuo
Copy link
Contributor Author

@Hisoka-X Thanks for your review,I have made the changes.

@Hisoka-X Hisoka-X requested a review from EricJoy2048 December 29, 2022 10:06
@Hisoka-X
Copy link
Member

Hisoka-X commented Jan 6, 2023

Hi, e2e same like have some problem.
image

@EricJoy2048
Copy link
Member

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);
Copy link
Member

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() {
Copy link
Member

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() {
Copy link
Member

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.

@MonsterChenzhuo
Copy link
Contributor Author

@EricJoy2048 Thanks for your review,I have made the changes.

EricJoy2048
EricJoy2048 previously approved these changes Feb 9, 2023
@ashulin ashulin changed the title [Feature][SeaTunnel Engine] Add a jvm file to define the SeaTunnel En… [Feature][Zeta] Add a jvm.properties file to define the SeaTunnel Zeta JVM Options Feb 9, 2023
final int javaMajorVersion,
final BufferedReader br,
final JvmOptionConsumer jvmOptionConsumer,
final InvalidLineConsumer invalidLineConsumer){
Copy link
Member

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`
Copy link
Member

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

Copy link
Member

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?

Copy link
Contributor Author

@MonsterChenzhuo MonsterChenzhuo Feb 10, 2023

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

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MonsterChenzhuo
Copy link
Contributor Author

@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-");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path = Files.createTempDirectory("seatunnel-");
path = Files.createTempDirectory("seatunnel");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of - is to make it more aesthetically pleasing, followed by a string of random numbers to distinguish between multiple task instance directories
图片

Copy link
Member

@TyrantLucifer TyrantLucifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hisoka-X Hisoka-X merged commit f165b18 into apache:dev Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants