Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

After we remove the alias field from ParamInfo, we can just replace Params with Map<ParamInfo<?>, Object>, which effectively contains the mapping from parameter definitions to parameter values.

6) The Param<?> class should implements the Serializable interface so that the Transformer/Estimator stages, whose instance could contain Param<?> instances, could be serialized and transferred between JobManager and TaskManagers.


Here are the usability issues with the existing APIs:

...

Code Block
languagejava
/**
 * Definition of a parameter, including name, class, description, default value and the validator.
 *
 * @param <T> The type of the parameter value
 */
public class Param<T> implements Serializable {
    public final String name;
    public final Class<?> clazz;
    public final String description;
    public final Object defaultValue;
    public final ParamValidator validator;

    public Param(String name, Class<?> clazz, String description, Object defaultValue, ParamValidator validator) {...}

    // Encodes the given object into a json-formatted string
    public String jsonEncode(Object value) throws IOException {...}

    // Decodes the json-formatted string into an object of the given type.
    public T jsonDecode(String json) throws IOException {...}
}


...