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 ; }
Pack a record address and partition id into a single word .