Skip to content

Commit dd9916b

Browse files
remote environment with custom configuration
1 parent 1982fbc commit dd9916b

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

modules/scala-api/src/main/scala/org/apache/flinkx/api/StreamExecutionEnvironment.scala

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,32 @@ object StreamExecutionEnvironment {
886886
parallelism: Int,
887887
jarFiles: String*
888888
): StreamExecutionEnvironment = {
889-
890889
val javaEnv = JavaEnv.createRemoteEnvironment(host, port, jarFiles: _*)
891890
javaEnv.setParallelism(parallelism)
892891
new StreamExecutionEnvironment(javaEnv)
893892
}
893+
894+
/** Creates a remote execution environment. The remote environment sends (parts of) the program to a cluster for
895+
* execution. Note that all file paths used in the program must be accessible from the cluster. The execution will
896+
* use the specified parallelism.
897+
*
898+
* @param host
899+
* The host name or address of the master (JobManager), where the program should be executed.
900+
* @param port
901+
* The port of the master (JobManager), where the program should be executed.
902+
* @param configuration
903+
* Pass a custom configuration into the cluster.
904+
* @param jarFiles
905+
* The JAR files with code that needs to be shipped to the cluster. If the program uses user-defined functions,
906+
* user-defined input formats, or any libraries, those must be provided in the JAR files.
907+
*/
908+
def createRemoteEnvironment(
909+
host: String,
910+
port: Int,
911+
config: Configuration,
912+
jarFiles: String*
913+
): StreamExecutionEnvironment = {
914+
val javaEnv = JavaEnv.createRemoteEnvironment(host, port, config, jarFiles: _*)
915+
new StreamExecutionEnvironment(javaEnv)
916+
}
894917
}

0 commit comments

Comments
 (0)