private static void increment(State s, LongWritable o, long i) {
    if (s.counts == null) {
      s.counts = new HashMap<LongWritable, LongWritable>();
    }
    LongWritable count = s.counts.get(o);
    if (count == null) {
      // We have to create a new object, because the object o belongs
      // to the code that creates it and may get its value changed.
      LongWritable key = new LongWritable();
      key.set(o.get());
      s.counts.put(key, new LongWritable(i));
    } else {
      count.set(count.get() + i);
    }
  }
Increment the State object with o as the key, and i as the count.
ql/src/java/org/apache/hadoop/hive/ql/udf/UDAFPercentile.java