public void logRanges(Object fileKey, long baseOffset, DiskRangeList range, RangesSrc src) {
    if (log == null) return;
    int offset = this.offset;
    if (offset + 3 > log.length) return; // At least the header should fit.
    log[offset + 1] = (fileKey instanceof Long) ? (long)fileKey : fileKey.hashCode();
    log[offset + 2] = baseOffset;
    int elementCount = 0;
    int currentOffset = offset + 3;
    while (range != null && elementCount < MAX_ELEMENTS) {
      if (currentOffset + 3 > log.length) break;
      logRange(range, currentOffset);
      currentOffset += 3;
      ++elementCount;
      range = range.next;
    }
    log[offset] = makeIntPair(RANGES, (src.ordinal() << MAX_ELEMENT_BITS) | elementCount);
    this.offset = currentOffset;
  }
Single threaded IO trace.
Note: this can be made MTT merely by using an AtomicInteger, and storing a thread ID.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/encoded/IoTrace.java