flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #4921: [FLINK-7943] Make ParameterTool thread safe
Date Wed, 01 Nov 2017 11:52:18 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4921#discussion_r148240608
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
---
    @@ -560,9 +591,13 @@ protected Object clone() throws CloneNotSupportedException {
     	 * @return The Merged {@link ParameterTool}
     	 */
     	public ParameterTool mergeWith(ParameterTool other) {
    -		ParameterTool ret = new ParameterTool(this.data);
    -		ret.data.putAll(other.data);
    -		ret.unrequestedParameters.addAll(other.unrequestedParameters);
    +		Map<String, String> resultData = new HashMap<>(data.size() + other.data.size());
    +		resultData.putAll(data);
    +		resultData.putAll(other.data);
    +
    +		ParameterTool ret = new ParameterTool(resultData);
    +
    +		ret.unrequestedParameters.putAll(other.unrequestedParameters);
    --- End diff --
    
    what about `this.unrequestedParameters`?


---

Mime
View raw message