code: public void insertRecord(
        Object recordBase, long recordOffset, int length, long prefix, boolean prefixIsNull)
      throws IOException {
  
      assert(inMemSorter != null);
      if (inMemSorter.numRecords() >= numElementsForSpillThreshold) {
        logger.info("Spilling data because number of spilledRecords crossed the threshold " +
          numElementsForSpillThreshold);
        spill();
      }
  
      growPointerArrayIfNecessary();
      int uaoSize = UnsafeAlignedOffset.getUaoSize();
      // Need 4 or 8 bytes to store the record length.
      final int required = length + uaoSize;
      acquireNewPageIfNecessary(required);
  
      final Object base = currentPage.getBaseObject();
      final long recordAddress = taskMemoryManager.encodePageNumberAndOffset(currentPage, pageCursor);
      UnsafeAlignedOffset.putSize(base, pageCursor, length);
      pageCursor += uaoSize;
      Platform.copyMemory(recordBase, recordOffset, base, pageCursor, length);
      pageCursor += length;
      inMemSorter.insertRecord(recordAddress, prefix, prefixIsNull);
    }
docs: Write a record to the sorter.