@Test public void testReduceJavaOptions() { Configuration conf = createConfForJavaOptsTest(); String opts = MRHelpers.getReduceJavaOpts(conf); Assert.assertFalse(opts.contains("fooMapAdminOpts")); Assert.assertFalse(opts.contains(" fooMapJavaOpts ")); Assert.assertTrue(opts.contains("fooReduceAdminOpts")); Assert.assertTrue(opts.contains(" fooReduceJavaOpts ")); Assert.assertTrue(opts.indexOf("fooReduceAdminOpts") < opts.indexOf("fooReduceJavaOpts")); Assert.assertFalse(opts.contains(" -D" + TezConfiguration.TEZ_ROOT_LOGGER_NAME + "=FATAL")); Assert.assertTrue(opts.contains(" -D" + TezConfiguration.TEZ_ROOT_LOGGER_NAME + "=TRACE")); }
@SuppressWarnings("deprecation") public static String getReduceJavaOpts(Configuration conf) { String adminOpts = conf.get( MRJobConfig.MAPRED_REDUCE_ADMIN_JAVA_OPTS, MRJobConfig.DEFAULT_MAPRED_ADMIN_JAVA_OPTS); String userOpts = conf.get( MRJobConfig.REDUCE_JAVA_OPTS, conf.get( JobConf.MAPRED_TASK_JAVA_OPTS, JobConf.DEFAULT_MAPRED_TASK_JAVA_OPTS)); return adminOpts.trim() + " " + userOpts.trim() + " " + getLog4jCmdLineProperties(conf, false); }
MRHelpers { @SuppressWarnings("deprecation") public static String getReduceJavaOpts(Configuration conf) { String adminOpts = conf.get( MRJobConfig.MAPRED_REDUCE_ADMIN_JAVA_OPTS, MRJobConfig.DEFAULT_MAPRED_ADMIN_JAVA_OPTS); String userOpts = conf.get( MRJobConfig.REDUCE_JAVA_OPTS, conf.get( JobConf.MAPRED_TASK_JAVA_OPTS, JobConf.DEFAULT_MAPRED_TASK_JAVA_OPTS)); return adminOpts.trim() + " " + userOpts.trim() + " " + getLog4jCmdLineProperties(conf, false); } }
MRHelpers { @SuppressWarnings("deprecation") public static String getReduceJavaOpts(Configuration conf) { String adminOpts = conf.get( MRJobConfig.MAPRED_REDUCE_ADMIN_JAVA_OPTS, MRJobConfig.DEFAULT_MAPRED_ADMIN_JAVA_OPTS); String userOpts = conf.get( MRJobConfig.REDUCE_JAVA_OPTS, conf.get( JobConf.MAPRED_TASK_JAVA_OPTS, JobConf.DEFAULT_MAPRED_TASK_JAVA_OPTS)); return adminOpts.trim() + " " + userOpts.trim() + " " + getLog4jCmdLineProperties(conf, false); }  }
MRHelpers { @SuppressWarnings("deprecation") public static String getReduceJavaOpts(Configuration conf) { String adminOpts = conf.get( MRJobConfig.MAPRED_REDUCE_ADMIN_JAVA_OPTS, MRJobConfig.DEFAULT_MAPRED_ADMIN_JAVA_OPTS); String userOpts = conf.get( MRJobConfig.REDUCE_JAVA_OPTS, conf.get( JobConf.MAPRED_TASK_JAVA_OPTS, JobConf.DEFAULT_MAPRED_TASK_JAVA_OPTS)); return adminOpts.trim() + " " + userOpts.trim() + " " + getLog4jCmdLineProperties(conf, false); }  @LimitedPrivate("Hive, Pig") @Unstable static void translateVertexConfToTez(Configuration conf); @SuppressWarnings({ "rawtypes", "unchecked" }) @Private static org.apache.hadoop.mapreduce.InputSplit[] generateNewSplits(
      JobContext jobContext, String inputFormatName, int numTasks); @SuppressWarnings({ "rawtypes", "unchecked" }) @Private static org.apache.hadoop.mapred.InputSplit[] generateOldSplits(
      JobConf jobConf, String inputFormatName, int numTasks); static InputSplitInfoDisk generateInputSplits(Configuration conf,
      Path inputSplitsDir); static InputSplitInfoMem generateInputSplitsToMem(Configuration conf); @Private static MRSplitProto createSplitProto(
      T newSplit, SerializationFactory serializationFactory); @Private static MRSplitProto createSplitProto(
      org.apache.hadoop.mapred.InputSplit oldSplit); static void addLog4jSystemProperties(String logLevel,
      List<String> vargs); @SuppressWarnings("deprecation") static String getMapJavaOpts(Configuration conf); @SuppressWarnings("deprecation") static String getReduceJavaOpts(Configuration conf); static void doJobClientMagic(Configuration conf); @LimitedPrivate("Hive, Pig") @Unstable static byte[] createUserPayloadFromConf(Configuration conf); @LimitedPrivate("Hive, Pig") static ByteString createByteStringFromConf(Configuration conf); @LimitedPrivate("Hive, Pig") @Unstable static Configuration createConfFromUserPayload(byte[] bb); @LimitedPrivate("Hive, Pig") static Configuration createConfFromByteString(ByteString bs); static byte[] createMRInputPayload(byte[] configurationBytes,
      MRSplitsProto mrSplitsProto); static byte[] createMRInputPayload(Configuration conf,
      MRSplitsProto mrSplitsProto); static byte[] createMRInputPayloadWithGrouping(byte[] configurationBytes,
      String inputFormatName); static byte[] createMRInputPayloadWithGrouping(Configuration conf,
      String inputFormatName); static MRInputUserPayloadProto parseMRInputPayload(byte[] bytes); static void updateLocalResourcesForInputSplits(
      FileSystem fs,
      InputSplitInfo inputSplitInfo,
      Map<String, LocalResource> localResources); static Resource getMapResource(Configuration conf); static Resource getReduceResource(Configuration conf); static void updateEnvironmentForMRTasks(Configuration conf,
      Map<String, String> environment, boolean isMap); static Configuration getBaseMRConfiguration(Configuration conf); static Configuration getBaseMRConfiguration(); static void updateEnvironmentForMRAM(Configuration conf, Map<String, String> environment); static String getMRAMJavaOpts(Configuration conf); static void addMRInput(Vertex vertex, byte[] userPayload,
      Class<? extends TezRootInputInitializer> initClazz); static void addMROutput(Vertex vertex, byte[] userPayload); @Private static void addMROutputLegacy(Vertex vertex, byte[] userPayload); @SuppressWarnings("unchecked") static InputSplit createOldFormatSplitFromUserPayload(
      MRSplitProto splitProto, SerializationFactory serializationFactory); @SuppressWarnings("unchecked") static org.apache.hadoop.mapreduce.InputSplit createNewFormatSplitFromUserPayload(
      MRSplitProto splitProto, SerializationFactory serializationFactory); static void mergeMRBinaryTokens(Credentials creds,
      Configuration conf); }
MRHelpers { @SuppressWarnings("deprecation") public static String getReduceJavaOpts(Configuration conf) { String adminOpts = conf.get( MRJobConfig.MAPRED_REDUCE_ADMIN_JAVA_OPTS, MRJobConfig.DEFAULT_MAPRED_ADMIN_JAVA_OPTS); String userOpts = conf.get( MRJobConfig.REDUCE_JAVA_OPTS, conf.get( JobConf.MAPRED_TASK_JAVA_OPTS, JobConf.DEFAULT_MAPRED_TASK_JAVA_OPTS)); return adminOpts.trim() + " " + userOpts.trim() + " " + getLog4jCmdLineProperties(conf, false); }  @LimitedPrivate("Hive, Pig") @Unstable static void translateVertexConfToTez(Configuration conf); @SuppressWarnings({ "rawtypes", "unchecked" }) @Private static org.apache.hadoop.mapreduce.InputSplit[] generateNewSplits(
      JobContext jobContext, String inputFormatName, int numTasks); @SuppressWarnings({ "rawtypes", "unchecked" }) @Private static org.apache.hadoop.mapred.InputSplit[] generateOldSplits(
      JobConf jobConf, String inputFormatName, int numTasks); static InputSplitInfoDisk generateInputSplits(Configuration conf,
      Path inputSplitsDir); static InputSplitInfoMem generateInputSplitsToMem(Configuration conf); @Private static MRSplitProto createSplitProto(
      T newSplit, SerializationFactory serializationFactory); @Private static MRSplitProto createSplitProto(
      org.apache.hadoop.mapred.InputSplit oldSplit); static void addLog4jSystemProperties(String logLevel,
      List<String> vargs); @SuppressWarnings("deprecation") static String getMapJavaOpts(Configuration conf); @SuppressWarnings("deprecation") static String getReduceJavaOpts(Configuration conf); static void doJobClientMagic(Configuration conf); @LimitedPrivate("Hive, Pig") @Unstable static byte[] createUserPayloadFromConf(Configuration conf); @LimitedPrivate("Hive, Pig") static ByteString createByteStringFromConf(Configuration conf); @LimitedPrivate("Hive, Pig") @Unstable static Configuration createConfFromUserPayload(byte[] bb); @LimitedPrivate("Hive, Pig") static Configuration createConfFromByteString(ByteString bs); static byte[] createMRInputPayload(byte[] configurationBytes,
      MRSplitsProto mrSplitsProto); static byte[] createMRInputPayload(Configuration conf,
      MRSplitsProto mrSplitsProto); static byte[] createMRInputPayloadWithGrouping(byte[] configurationBytes,
      String inputFormatName); static byte[] createMRInputPayloadWithGrouping(Configuration conf,
      String inputFormatName); static MRInputUserPayloadProto parseMRInputPayload(byte[] bytes); static void updateLocalResourcesForInputSplits(
      FileSystem fs,
      InputSplitInfo inputSplitInfo,
      Map<String, LocalResource> localResources); static Resource getMapResource(Configuration conf); static Resource getReduceResource(Configuration conf); static void updateEnvironmentForMRTasks(Configuration conf,
      Map<String, String> environment, boolean isMap); static Configuration getBaseMRConfiguration(Configuration conf); static Configuration getBaseMRConfiguration(); static void updateEnvironmentForMRAM(Configuration conf, Map<String, String> environment); static String getMRAMJavaOpts(Configuration conf); static void addMRInput(Vertex vertex, byte[] userPayload,
      Class<? extends TezRootInputInitializer> initClazz); static void addMROutput(Vertex vertex, byte[] userPayload); @Private static void addMROutputLegacy(Vertex vertex, byte[] userPayload); @SuppressWarnings("unchecked") static InputSplit createOldFormatSplitFromUserPayload(
      MRSplitProto splitProto, SerializationFactory serializationFactory); @SuppressWarnings("unchecked") static org.apache.hadoop.mapreduce.InputSplit createNewFormatSplitFromUserPayload(
      MRSplitProto splitProto, SerializationFactory serializationFactory); static void mergeMRBinaryTokens(Credentials creds,
      Configuration conf);  }