### Question:
DynamicInputFormat extends InputFormat<K, V> { private static int getSplitRatio(Configuration conf) { int splitRatio = conf .getInt(S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, S3MapReduceCpConstants.SPLIT_RATIO_DEFAULT); if (splitRatio <= 0) { LOG .warn("{} should be positive. Fall back to default value: {}", S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, S3MapReduceCpConstants.SPLIT_RATIO_DEFAULT); splitRatio = S3MapReduceCpConstants.SPLIT_RATIO_DEFAULT; } return splitRatio; }  @Override List<InputSplit> getSplits(JobContext jobContext); @Override RecordReader<K, V> createRecordReader(InputSplit inputSplit, TaskAttemptContext taskAttemptContext);  }### Answer:
@Test public void getSplitRatio() throws Exception { assertEquals(1, DynamicInputFormat.getSplitRatio(1, 1000000000)); assertEquals(2, DynamicInputFormat.getSplitRatio(11000000, 10)); assertEquals(4, DynamicInputFormat.getSplitRatio(30, 700)); assertEquals(2, DynamicInputFormat.getSplitRatio(30, 200)); Configuration conf = new Configuration(); conf.setInt(S3MapReduceCpConstants.CONF_LABEL_MAX_CHUNKS_TOLERABLE, -1); conf.setInt(S3MapReduceCpConstants.CONF_LABEL_MAX_CHUNKS_IDEAL, -1); conf.setInt(S3MapReduceCpConstants.CONF_LABEL_MIN_RECORDS_PER_CHUNK, -1); conf.setInt(S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, -1); assertEquals(1, DynamicInputFormat.getSplitRatio(1, 1000000000, conf)); assertEquals(2, DynamicInputFormat.getSplitRatio(11000000, 10, conf)); assertEquals(4, DynamicInputFormat.getSplitRatio(30, 700, conf)); assertEquals(2, DynamicInputFormat.getSplitRatio(30, 200, conf)); conf.setInt(S3MapReduceCpConstants.CONF_LABEL_MAX_CHUNKS_TOLERABLE, 100); conf.setInt(S3MapReduceCpConstants.CONF_LABEL_MAX_CHUNKS_IDEAL, 30); conf.setInt(S3MapReduceCpConstants.CONF_LABEL_MIN_RECORDS_PER_CHUNK, 10); conf.setInt(S3MapReduceCpConstants.CONF_LABEL_SPLIT_RATIO, 53); assertEquals(53, DynamicInputFormat.getSplitRatio(3, 200, conf)); }