org.apache.hadoop.tools.rumen.datatypes.util.MapReduceJobPropertiesParser
A default parser for MapReduce job configuration properties. MapReduce job configuration properties are represented as key-value pairs. Each key represents a configuration knob which controls or affects the behavior of a MapReduce job or a job's task. The value associated with the configuration key represents its value. Some of the keys are deprecated. As a result of deprecation some keys change or are preferred over other keys, across versions. {@link MapReduceJobPropertiesParser} is a utility class thatparses MapReduce job configuration properties and converts the value into a well defined {@link DataType}. Users can use the {@link MapReduceJobPropertiesParser#parseJobProperty()} API to process job configuration parameters. This API will parse a job property represented as a key-value pair and return the value wrapped inside a {@link DataType}. Callers can then use the returned {@link DataType} for further processing.{@link MapReduceJobPropertiesParser} thrives on the key name to decide which{@link DataType} to wrap the value with. Values for keys representing job-name, queue-name, user-name etc are wrapped inside {@link JobName}, {@link QueueName}, {@link UserName} etc respectively. Keys ending with *dir* are considered as a directory and hence gets be wrapped inside {@link FileName}. Similarly key ending with *codec*, *log*, *class* etc are also handled accordingly. Values representing basic java data-types like integer, float, double, boolean etc are wrapped inside {@link DefaultDataType}. If the key represents some jvm-level settings then only standard settings are extracted and gets wrapped inside {@link DefaultDataType}. Currently only '-Xmx' and '-Xms' settings are considered while the rest are ignored. Note that the {@link MapReduceJobPropertiesParser#parseJobProperty()} API maps the keys to a configuration parameter listed in {@link MRJobConfig}. This not only filters non-framework specific keys thus ignoring user-specific and hard-to-parse keys but also provides a consistent view for all possible inputs. So if users invoke the {@link MapReduceJobPropertiesParser#parseJobProperty()} API with either<"mapreduce.job.user.name", "bob"> or <"user.name", "bob">, then the result would be a {@link UserName} {@link DataType} wrapping the user-name "bob".