Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4921#discussion_r148247266
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java ---
    @@ -210,15 +212,44 @@ public static ParameterTool fromSystemProperties() {
                return fromMap((Map) System.getProperties());
        }
     
    +   private static final Object placeholder = new Object();
    +
        // ------------------ ParameterUtil  ------------------------
        protected final Map<String, String> data;
    -   protected final Map<String, String> defaultData;
    -   protected final Set<String> unrequestedParameters;
    +
    +   // data which is only used on the client and does not need to be 
transmitted
    +   protected transient Map<String, String> defaultData;
    +   protected transient Map<String, Object> unrequestedParameters;
     
        private ParameterTool(Map<String, String> data) {
    -           this.data = new HashMap<>(data);
    -           this.defaultData = new HashMap<>();
    -           this.unrequestedParameters = new HashSet<>(data.keySet());
    +           this.data = Collections.unmodifiableMap(new HashMap<>(data));
    +
    +           this.defaultData = new ConcurrentHashMap<>(data.size());
    +
    +           this.unrequestedParameters = new 
ConcurrentHashMap<>(data.size());
    --- End diff --
    
    Good idea. Didn't know that this existed.


---

Reply via email to