Skip to content

Commit 7cff919

Browse files
author
Marcelo Vanzin
committed
Javadoc updates.
1 parent eae4d8e commit 7cff919

File tree

2 files changed

+83
-14
lines changed

2 files changed

+83
-14
lines changed

launcher/src/main/java/org/apache/spark/launcher/AbstractLauncher.java

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,49 @@ protected AbstractLauncher(Map<String, String> env) {
6262
@SuppressWarnings("unchecked")
6363
private final T THIS = (T) this;
6464

65-
/** Set a custom JAVA_HOME for launching the Spark application. */
65+
/**
66+
* Set a custom JAVA_HOME for launching the Spark application.
67+
*
68+
* @param javaHome Path to the JAVA_HOME to use.
69+
* @return This launcher.
70+
*/
6671
public T setJavaHome(String javaHome) {
6772
checkNotNull(javaHome, "javaHome");
6873
this.javaHome = javaHome;
6974
return THIS;
7075
}
7176

72-
/** Set a custom Spark installation location for the application. */
77+
/**
78+
* Set a custom Spark installation location for the application.
79+
*
80+
* @param sparkHome Path to the Spark installation to use.
81+
* @return This launcher.
82+
*/
7383
public T setSparkHome(String sparkHome) {
7484
checkNotNull(sparkHome, "sparkHome");
7585
launcherEnv.put(ENV_SPARK_HOME, sparkHome);
7686
return THIS;
7787
}
7888

79-
/** Set a custom properties file with Spark configuration for the application. */
89+
/**
90+
* Set a custom properties file with Spark configuration for the application.
91+
*
92+
* @param path Path to custom properties file to use.
93+
* @return This launcher.
94+
*/
8095
public T setPropertiesFile(String path) {
8196
checkNotNull(path, "path");
8297
this.propertiesFile = path;
8398
return THIS;
8499
}
85100

86-
/** Set a single configuration value for the application. */
101+
/**
102+
* Set a single configuration value for the application.
103+
*
104+
* @param key Configuration key.
105+
* @param value The value to use.
106+
* @return This launcher.
107+
*/
87108
public T setConf(String key, String value) {
88109
checkNotNull(key, "key");
89110
checkNotNull(value, "value");
@@ -117,7 +138,7 @@ List<String> buildShellCommand() throws IOException {
117138
}
118139

119140
/**
120-
* Loads the configuration file for the application, if it exists. This is either the
141+
* Loads the configuration file for the application, if it exists. This is either the
121142
* user-specified properties file, or the spark-defaults.conf file under the Spark configuration
122143
* directory.
123144
*/

launcher/src/main/java/org/apache/spark/launcher/SparkLauncher.java

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,36 @@ public SparkLauncher() {
5656
this.pyFiles = new ArrayList<String>();
5757
}
5858

59-
/** Set the application name. */
59+
/**
60+
* Set the application name.
61+
*
62+
* @param appName Application name.
63+
* @return This launcher.
64+
*/
6065
public SparkLauncher setAppName(String appName) {
6166
checkNotNull(appName, "appName");
6267
this.appName = appName;
6368
return this;
6469
}
6570

66-
/** Set the Spark master for the application. */
71+
/**
72+
* Set the Spark master for the application.
73+
*
74+
* @param master Spark master.
75+
* @return This launcher.
76+
*/
6777
public SparkLauncher setMaster(String master) {
6878
checkNotNull(master, "master");
6979
this.master = master;
7080
return this;
7181
}
7282

73-
/** Set the deploy mode for the application. */
83+
/**
84+
* Set the deploy mode for the application.
85+
*
86+
* @param mode Deploy mode.
87+
* @return This launcher.
88+
*/
7489
public SparkLauncher setDeployMode(String mode) {
7590
checkNotNull(mode, "mode");
7691
this.deployMode = mode;
@@ -80,21 +95,34 @@ public SparkLauncher setDeployMode(String mode) {
8095
/**
8196
* Set the main application resource. This should be the location of a jar file for Scala/Java
8297
* applications, or a python script for PySpark applications.
98+
*
99+
* @param resource Path to the main application resource.
100+
* @return This launcher.
83101
*/
84102
public SparkLauncher setAppResource(String resource) {
85103
checkNotNull(resource, "resource");
86104
this.appResource = resource;
87105
return this;
88106
}
89107

90-
/** Sets the application class name for Java/Scala applications. */
108+
/**
109+
* Sets the application class name for Java/Scala applications.
110+
*
111+
* @param mainClass Application's main class.
112+
* @return This launcher.
113+
*/
91114
public SparkLauncher setMainClass(String mainClass) {
92115
checkNotNull(mainClass, "mainClass");
93116
this.mainClass = mainClass;
94117
return this;
95118
}
96119

97-
/** Adds command line arguments for the application. */
120+
/**
121+
* Adds command line arguments for the application.
122+
*
123+
* @param args Arguments to pass to the application's main class.
124+
* @return This launcher.
125+
*/
98126
public SparkLauncher addAppArgs(String... args) {
99127
for (String arg : args) {
100128
checkNotNull(arg, "arg");
@@ -103,28 +131,48 @@ public SparkLauncher addAppArgs(String... args) {
103131
return this;
104132
}
105133

106-
/** Adds a jar file to be submitted with the application. */
134+
/**
135+
* Adds a jar file to be submitted with the application.
136+
*
137+
* @param jar Path to the jar file.
138+
* @return This launcher.
139+
*/
107140
public SparkLauncher addJar(String jar) {
108141
checkNotNull(jar, "jar");
109142
jars.add(jar);
110143
return this;
111144
}
112145

113-
/** Adds a file to be submitted with the application. */
146+
/**
147+
* Adds a file to be submitted with the application.
148+
*
149+
* @param file Path to the file.
150+
* @return This launcher.
151+
*/
114152
public SparkLauncher addFile(String file) {
115153
checkNotNull(file, "file");
116154
files.add(file);
117155
return this;
118156
}
119157

120-
/** Adds a python file / zip / egg to be submitted with the application. */
158+
/**
159+
* Adds a python file / zip / egg to be submitted with the application.
160+
*
161+
* @param file Path to the file.
162+
* @return This launcher.
163+
*/
121164
public SparkLauncher addPyFile(String file) {
122165
checkNotNull(file, "file");
123166
pyFiles.add(file);
124167
return this;
125168
}
126169

127-
/** Enables verbose reporting for SparkSubmit. */
170+
/**
171+
* Enables verbose reporting for SparkSubmit.
172+
*
173+
* @param verbose Whether to enable verbose output.
174+
* @return This launcher.
175+
*/
128176
public SparkLauncher setVerbose(boolean verbose) {
129177
this.verbose = verbose;
130178
return this;

0 commit comments

Comments
 (0)