flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aljos...@apache.org
Subject [10/20] flink git commit: [FLINK-4048] Remove Hadoop GenericOptionsParser from ParameterTool
Date Wed, 27 Sep 2017 11:09:15 GMT
[FLINK-4048] Remove Hadoop GenericOptionsParser from ParameterTool

There are methods for this in flink-hadoop-compatibility.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/21e6d523
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/21e6d523
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/21e6d523

Branch: refs/heads/master
Commit: 21e6d523dc01c0bce27bcc686e4ea81e732e1393
Parents: 4beff13
Author: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Authored: Tue Aug 22 16:47:36 2017 +0200
Committer: Aljoscha Krettek <aljoscha.krettek@gmail.com>
Committed: Wed Sep 27 10:05:11 2017 +0200

----------------------------------------------------------------------
 .../flink/api/java/utils/ParameterTool.java     | 24 --------------------
 .../flink/api/java/utils/ParameterToolTest.java |  6 -----
 2 files changed, 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/21e6d523/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java b/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
index ef5c36e..894b66d 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
@@ -24,9 +24,7 @@ import org.apache.flink.api.common.ExecutionConfig;
 import org.apache.flink.configuration.Configuration;
 import org.apache.flink.util.Preconditions;
 
-import org.apache.commons.cli.Option;
 import org.apache.commons.lang3.math.NumberUtils;
-import org.apache.hadoop.util.GenericOptionsParser;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -212,28 +210,6 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters
implement
 		return fromMap((Map) System.getProperties());
 	}
 
-	/**
-	 * Returns {@link ParameterTool} for the arguments parsed by {@link GenericOptionsParser}.
-	 *
-	 * @param args Input array arguments. It should be parsable by {@link GenericOptionsParser}
-	 * @return A {@link ParameterTool}
-	 * @throws IOException If arguments cannot be parsed by {@link GenericOptionsParser}
-	 * @see GenericOptionsParser
-	 * @deprecated Please use {@link org.apache.flink.hadoopcompatibility.HadoopUtils#paramsFromGenericOptionsParser(String[])}
-	 * from project flink-hadoop-compatibility
-	 */
-	@Deprecated
-	@PublicEvolving
-	public static ParameterTool fromGenericOptionsParser(String[] args) throws IOException {
-		Option[] options = new GenericOptionsParser(args).getCommandLine().getOptions();
-		Map<String, String> map = new HashMap<String, String>();
-		for (Option option : options) {
-			String[] split = option.getValue().split("=");
-			map.put(split[0], split[1]);
-		}
-		return fromMap(map);
-	}
-
 	// ------------------ ParameterUtil  ------------------------
 	protected final Map<String, String> data;
 	protected final Map<String, String> defaultData;

http://git-wip-us.apache.org/repos/asf/flink/blob/21e6d523/flink-java/src/test/java/org/apache/flink/api/java/utils/ParameterToolTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/utils/ParameterToolTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/utils/ParameterToolTest.java
index d5d5c0d..6ad2022 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/utils/ParameterToolTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/utils/ParameterToolTest.java
@@ -164,12 +164,6 @@ public class ParameterToolTest extends AbstractParameterToolTest {
 		validate(parameter);
 	}
 
-	@Test
-	public void testFromGenericOptionsParser() throws IOException {
-		ParameterTool parameter = ParameterTool.fromGenericOptionsParser(new String[]{"-D", "input=myInput",
"-DexpectedCount=15"});
-		validate(parameter);
-	}
-
 	// Boolean
 
 	@Test


Mime
View raw message