You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ma...@apache.org on 2022/05/11 12:24:56 UTC
[flink] branch master updated: [hotfix][docs] fix "parameters"
This is an automated email from the ASF dual-hosted git repository.
martijnvisser pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 9ff536e0ef3 [hotfix][docs] fix "parameters"
9ff536e0ef3 is described below
commit 9ff536e0ef3f0d3fd2975db8877d389070bc1414
Author: Hongbo Miao <Ho...@outlook.com>
AuthorDate: Thu Apr 21 12:08:07 2022 -0700
[hotfix][docs] fix "parameters"
---
.../docs/dev/datastream/application_parameters.md | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/docs/content/docs/dev/datastream/application_parameters.md b/docs/content/docs/dev/datastream/application_parameters.md
index 3cdf2f3e081..43d3e31bf09 100644
--- a/docs/content/docs/dev/datastream/application_parameters.md
+++ b/docs/content/docs/dev/datastream/application_parameters.md
@@ -48,13 +48,13 @@ The `ParameterTool` provides a set of predefined static methods for reading the
The following method will read a [Properties](https://docs.oracle.com/javase/tutorial/essential/environment/properties.html) file and provide the key/value pairs:
```java
String propertiesFilePath = "/home/sam/flink/myjob.properties";
-ParameterTool parameter = ParameterTool.fromPropertiesFile(propertiesFilePath);
+ParameterTool parameters = ParameterTool.fromPropertiesFile(propertiesFilePath);
File propertiesFile = new File(propertiesFilePath);
-ParameterTool parameter = ParameterTool.fromPropertiesFile(propertiesFile);
+ParameterTool parameters = ParameterTool.fromPropertiesFile(propertiesFile);
InputStream propertiesFileInputStream = new FileInputStream(file);
-ParameterTool parameter = ParameterTool.fromPropertiesFile(propertiesFileInputStream);
+ParameterTool parameters = ParameterTool.fromPropertiesFile(propertiesFileInputStream);
```
@@ -63,7 +63,7 @@ ParameterTool parameter = ParameterTool.fromPropertiesFile(propertiesFileInputSt
This allows getting arguments like `--input hdfs:///mydata --elements 42` from the command line.
```java
public static void main(String[] args) {
- ParameterTool parameter = ParameterTool.fromArgs(args);
+ ParameterTool parameters = ParameterTool.fromArgs(args);
// .. regular code ..
```
@@ -73,7 +73,7 @@ public static void main(String[] args) {
When starting a JVM, you can pass system properties to it: `-Dinput=hdfs:///mydata`. You can also initialize the `ParameterTool` from these system properties:
```java
-ParameterTool parameter = ParameterTool.fromSystemProperties();
+ParameterTool parameters = ParameterTool.fromSystemProperties();
```
@@ -86,10 +86,10 @@ Now that we've got the parameters from somewhere (see above) we can use them in
The `ParameterTool` itself has methods for accessing the values.
```java
ParameterTool parameters = // ...
-parameter.getRequired("input");
-parameter.get("output", "myDefaultValue");
-parameter.getLong("expectedCount", -1L);
-parameter.getNumberOfParameters();
+parameters.getRequired("input");
+parameters.get("output", "myDefaultValue");
+parameters.getLong("expectedCount", -1L);
+parameters.getNumberOfParameters();
// .. there are more methods available.
```