Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-8165

ParameterTools not serializable properly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.4.0, 1.5.0
    • Fix Version/s: 1.4.0
    • Labels:
      None

      Description

      Trying to get with default value after deserialization fails as the EmptyMap doesn't support put operations for new default values.

      The problem is here:

      https://github.com/apache/flink/blob/release-1.4.0-rc2/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java#L621

      Reproduce:

      	@Test
      	public void tes() throws IOException, ClassNotFoundException {
      		ParameterTool params = ParameterTool.fromMap(new HashMap<>());
                      // works
      		params.get("asd", "default");
      		byte[] b = InstantiationUtil.serializeObject(params);
      		ParameterTool dparams = InstantiationUtil.deserializeObject(b, getClass().getClassLoader());
                       // fails
      		dparams.get("asd", "default");
      	}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gyfora Gyula Fora
                Reporter:
                gyfora Gyula Fora
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: