JobConf extends Configuration { @Private @VisibleForTesting public static int parseMaximumHeapSizeMB(String javaOpts) { Matcher m = JAVA_OPTS_XMX_PATTERN.matcher(javaOpts); if (m.matches()) { long size = Long.parseLong(m.group(1)); if (size <= 0) { return -1; } if (m.group(2).isEmpty()) { return (int) (size / (1024 * 1024)); } char unit = m.group(2).charAt(0); switch (unit) { case 'g': case 'G': return (int) (size * 1024); case 'm': case 'M': return (int) size; case 'k': case 'K': return (int) (size / 1024); } } return -1; } JobConf();  JobConf(Class exampleClass);  JobConf(Configuration conf);  JobConf(Configuration conf, Class exampleClass);  JobConf(String config);  JobConf(Path config);  JobConf(boolean loadDefaults); Credentials getCredentials(); @Private void setCredentials(Credentials credentials); String getJar(); void setJar(String jar); Pattern getJarUnpackPattern(); void setJarByClass(Class cls); String[] getLocalDirs(); @Deprecated void deleteLocalFiles(); void deleteLocalFiles(String subdir); Path getLocalPath(String pathString); String getUser(); void setUser(String user); void setKeepFailedTaskFiles(boolean keep); boolean getKeepFailedTaskFiles(); void setKeepTaskFilesPattern(String pattern); String getKeepTaskFilesPattern(); void setWorkingDirectory(Path dir); Path getWorkingDirectory(); void setNumTasksToExecutePerJvm(int numTasks); int getNumTasksToExecutePerJvm(); InputFormat getInputFormat(); void setInputFormat(Class<? extends InputFormat> theClass); OutputFormat getOutputFormat(); OutputCommitter getOutputCommitter(); void setOutputCommitter(Class<? extends OutputCommitter> theClass); void setOutputFormat(Class<? extends OutputFormat> theClass); void setCompressMapOutput(boolean compress); boolean getCompressMapOutput(); void setMapOutputCompressorClass(Class<? extends CompressionCodec> codecClass); Class<? extends CompressionCodec> getMapOutputCompressorClass(Class<? extends CompressionCodec> defaultValue); Class<?> getMapOutputKeyClass(); void setMapOutputKeyClass(Class<?> theClass); Class<?> getMapOutputValueClass(); void setMapOutputValueClass(Class<?> theClass); Class<?> getOutputKeyClass(); void setOutputKeyClass(Class<?> theClass); RawComparator getOutputKeyComparator(); void setOutputKeyComparatorClass(Class<? extends RawComparator> theClass); void setKeyFieldComparatorOptions(String keySpec); String getKeyFieldComparatorOption(); void setKeyFieldPartitionerOptions(String keySpec); String getKeyFieldPartitionerOption(); RawComparator getCombinerKeyGroupingComparator(); RawComparator getOutputValueGroupingComparator(); void setCombinerKeyGroupingComparator(
      Class<? extends RawComparator> theClass); void setOutputValueGroupingComparator(
      Class<? extends RawComparator> theClass); boolean getUseNewMapper(); void setUseNewMapper(boolean flag); boolean getUseNewReducer(); void setUseNewReducer(boolean flag); Class<?> getOutputValueClass(); void setOutputValueClass(Class<?> theClass); Class<? extends Mapper> getMapperClass(); void setMapperClass(Class<? extends Mapper> theClass); Class<? extends MapRunnable> getMapRunnerClass(); void setMapRunnerClass(Class<? extends MapRunnable> theClass); Class<? extends Partitioner> getPartitionerClass(); void setPartitionerClass(Class<? extends Partitioner> theClass); Class<? extends Reducer> getReducerClass(); void setReducerClass(Class<? extends Reducer> theClass); Class<? extends Reducer> getCombinerClass(); void setCombinerClass(Class<? extends Reducer> theClass); boolean getSpeculativeExecution(); void setSpeculativeExecution(boolean speculativeExecution); boolean getMapSpeculativeExecution(); void setMapSpeculativeExecution(boolean speculativeExecution); boolean getReduceSpeculativeExecution(); void setReduceSpeculativeExecution(boolean speculativeExecution); int getNumMapTasks(); void setNumMapTasks(int n); int getNumReduceTasks(); void setNumReduceTasks(int n); int getMaxMapAttempts(); void setMaxMapAttempts(int n); int getMaxReduceAttempts(); void setMaxReduceAttempts(int n); String getJobName(); void setJobName(String name); @Deprecated String getSessionId(); @Deprecated void setSessionId(String sessionId); void setMaxTaskFailuresPerTracker(int noFailures); int getMaxTaskFailuresPerTracker(); int getMaxMapTaskFailuresPercent(); void setMaxMapTaskFailuresPercent(int percent); int getMaxReduceTaskFailuresPercent(); void setMaxReduceTaskFailuresPercent(int percent); void setJobPriority(JobPriority prio); void setJobPriorityAsInteger(int prio); JobPriority getJobPriority(); int getJobPriorityAsInteger(); boolean getProfileEnabled(); void setProfileEnabled(boolean newValue); String getProfileParams(); void setProfileParams(String value); IntegerRanges getProfileTaskRange(boolean isMap); void setProfileTaskRange(boolean isMap, String newValue); void setMapDebugScript(String mDbgScript); String getMapDebugScript(); void setReduceDebugScript(String rDbgScript); String getReduceDebugScript(); String getJobEndNotificationURI(); void setJobEndNotificationURI(String uri); String getJobLocalDir(); long getMemoryForMapTask(); void setMemoryForMapTask(long mem); long getMemoryForReduceTask(); void setMemoryForReduceTask(long mem); String getQueueName(); void setQueueName(String queueName); static long normalizeMemoryConfigValue(long val); static String findContainingJar(Class my_class); @Deprecated long getMaxVirtualMemoryForTask(); @Deprecated void setMaxVirtualMemoryForTask(long vmem); @Deprecated long getMaxPhysicalMemoryForTask(); @Deprecated void setMaxPhysicalMemoryForTask(long mem); @Private String getTaskJavaOpts(TaskType taskType); @Private @VisibleForTesting static int parseMaximumHeapSizeMB(String javaOpts); @Private int getMemoryRequired(TaskType taskType); static void main(String[] args); @Deprecated
  static final String MAPRED_TASK_MAXVMEM_PROPERTY; @Deprecated
  static final String UPPER_LIMIT_ON_TASK_VMEM_PROPERTY; @Deprecated
  static final String MAPRED_TASK_DEFAULT_MAXVMEM_PROPERTY; @Deprecated
  static final String MAPRED_TASK_MAXPMEM_PROPERTY; @Deprecated
  static final long DISABLED_MEMORY_LIMIT; static final String MAPRED_LOCAL_DIR_PROPERTY; static final String DEFAULT_QUEUE_NAME; @Deprecated
  static final String MAPRED_JOB_MAP_MEMORY_MB_PROPERTY; @Deprecated
  static final String MAPRED_JOB_REDUCE_MEMORY_MB_PROPERTY; static final Pattern UNPACK_JAR_PATTERN_DEFAULT; @Deprecated
  static final String MAPRED_TASK_JAVA_OPTS; static final String MAPRED_MAP_TASK_JAVA_OPTS; static final String MAPRED_REDUCE_TASK_JAVA_OPTS; static final String DEFAULT_MAPRED_TASK_JAVA_OPTS; @Deprecated
  static final String MAPRED_TASK_ULIMIT; @Deprecated
  static final String MAPRED_MAP_TASK_ULIMIT; @Deprecated
  static final String MAPRED_REDUCE_TASK_ULIMIT; @Deprecated
  static final String MAPRED_TASK_ENV; static final String MAPRED_MAP_TASK_ENV; static final String MAPRED_REDUCE_TASK_ENV; static final String MAPRED_MAP_TASK_LOG_LEVEL; static final String MAPRED_REDUCE_TASK_LOG_LEVEL; static final Level DEFAULT_LOG_LEVEL; @Deprecated
  static final String WORKFLOW_ID; @Deprecated
  static final String WORKFLOW_NAME; @Deprecated
  static final String WORKFLOW_NODE_NAME; @Deprecated
  static final String WORKFLOW_ADJACENCY_PREFIX_STRING; @Deprecated
  static final String WORKFLOW_ADJACENCY_PREFIX_PATTERN; @Deprecated
  static final String WORKFLOW_TAGS; @Deprecated
  static final String MAPREDUCE_RECOVER_JOB; @Deprecated
  static final boolean DEFAULT_MAPREDUCE_RECOVER_JOB; }
@Test public void testParseMaximumHeapSizeMB() { Assert.assertEquals(4096, JobConf.parseMaximumHeapSizeMB("-Xmx4294967296")); Assert.assertEquals(4096, JobConf.parseMaximumHeapSizeMB("-Xmx4194304k")); Assert.assertEquals(4096, JobConf.parseMaximumHeapSizeMB("-Xmx4096m")); Assert.assertEquals(4096, JobConf.parseMaximumHeapSizeMB("-Xmx4g")); Assert.assertEquals(-1, JobConf.parseMaximumHeapSizeMB("-Xmx4?")); Assert.assertEquals(-1, JobConf.parseMaximumHeapSizeMB("")); }