MeanReducer extends Reducer<Text, IntWritable, Text, Text> { private BigDecimal mean(BigInteger sum, BigInteger count) { BigDecimal mean = BigDecimal.ZERO; if (!sum.equals(ZERO) && !count.equals(ZERO)) { mean = new BigDecimal(sum).divide(new BigDecimal(count), ROUND_FLOOR); } return mean; }  void reduce(Text key, Iterable<IntWritable> values, Context context); static Logger log; static final String INSERT_INTO_CAPSTONE_MEAN_ARR_DELAY_ORIGIN_DEST_MEAN_VALUES; }
@Test public void testMean() { BigInteger sum = new BigInteger("100"); BigInteger count = new BigInteger("10"); reducer.persist("NYC-POR", sum, count); }