-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-2084] [core] Add an option to start Flink in streaming mode #718
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
Conversation
…e and release memory as needed. This is an alternative mode to the current mode that pre-allocates all memory. The default remains to pre-allocate all memory.
- Streaming mode sets the memory manager to lazy memory allocation to ensure heap is not blocked by batch memory manager
1df1f12 to
64e9b36
Compare
| @@ -80,7 +81,7 @@ case $STARTSTOP in | |||
| rotateLogFile $out | |||
|
|
|||
| echo "Starting Job Manager" | |||
| $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_setting[@]}" -classpath "`manglePathList "$FLINK_JM_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`" org.apache.flink.runtime.jobmanager.JobManager --executionMode $EXECUTIONMODE --configDir "$FLINK_CONF_DIR" > "$out" 2>&1 < /dev/null & | |||
| $JAVA_RUN $JVM_ARGS ${FLINK_ENV_JAVA_OPTS} "${log_setting[@]}" -classpath "`manglePathList "$FLINK_JM_CLASSPATH:$INTERNAL_HADOOP_CLASSPATHS"`" org.apache.flink.runtime.jobmanager.JobManager --configDir "$FLINK_CONF_DIR" --executionMode $EXECUTIONMODE --streamingMode "$STREAMINGMODE" > "$out" 2>&1 < /dev/null & | |||
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.
With this change, the script now expects three arguments, right?
If you, you need to update this line as well
echo "Please specify 'start (cluster|local)' or stop"
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.
Actually, the streaming mode parameter is optional and defaults to "batch".
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.
Okay, sorry. I didn't see this.
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'll add it anyways. It is a good hint.
|
+1 to merge. |
|
|
||
| Assert.assertTrue("The previously allocated segments were not valid any more.", | ||
| allMemorySegmentsValid(segs)); | ||
|
|
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.
Formatting
|
+1 looks solid. |
|
Thank you for the comments. I'll address them and merge this... |
The streaming mode subsumes the batch mode, as it allows to run both kinds of programs. Batch programs will most likely run slightly less efficient than in pure batch mode, due to lazy memory allocation (see below)
Adds new startup options to the JobManager and TaskManager.
Adds additional scripts
bin/start-cluster-streaming.shandstart-local-streaming.sh.Currently, streaming mode only sets the memory manager to lazy memory allocation to ensure heap is not blocked by batch memory manager
Includes [FLINK-2085] To support on-demand memory allocation in the memory manager.