code: public static long packPointer(long recordPointer, int partitionId) {
      assert (partitionId <= MAXIMUM_PARTITION_ID);
      // Note that without word alignment we can address 2^27 bytes = 128 megabytes per page.
      // Also note that this relies on some internals of how TaskMemoryManager encodes its addresses.
      final long pageNumber = (recordPointer & MASK_LONG_UPPER_13_BITS) >>> 24;
      final long compressedAddress = pageNumber | (recordPointer & MASK_LONG_LOWER_27_BITS);
      return (((long) partitionId) << 40) | compressedAddress;
    }
docs: Pack a record address and partition id into a single word.
  
  @param recordPointer a record pointer encoded by TaskMemoryManager.
  @param partitionId a shuffle partition id (maximum value of 2^24).
  @return a packed pointer that can be decoded using the {@link PackedRecordPointer} class.