private void flushInternal() throws IOException, HiveException {
    for (int index : indexes.indexes()) {
      if (index != evicted && values[index] != null) {
        collector.collect(keys[index], values[index], hashes[index]);
        usage -= values[index].length;
        values[index] = null;
        hashes[index] = -1;
      }
    }
    excluded = 0;
  }
returns index for key/value/hashcode if it's acceptable.
-1, -2, -3, -4 can be returned for other actions.
<p/>
-1 for FORWARD   : should be forwarded to output collector (for GBY)
-2 for EXCLUDED  : not in top-k. ignore it
ql/src/java/org/apache/hadoop/hive/ql/exec/TopNHash.java