int (int hashId) { if (hashId == NULL_ID) { return NULL_ID; } int recordNo = hashId - 1; int logHeaderSize = AppendOnlyLogOverMMappedFile.HeaderLayout.HEADER_SIZE; int recordsOnPage = pageSize / HASH_RECORD_LENGTH; int recordsOnFirstPage = (pageSize - logHeaderSize) / HASH_RECORD_LENGTH; if (recordNo < recordsOnFirstPage) { return recordNo * HASH_RECORD_LENGTH + 1; } else { int pageNo = (recordNo - recordsOnFirstPage) / recordsOnPage + 1; int recordOnPage = (recordNo - recordsOnFirstPage) % recordsOnPage; return (pageNo * pageSize - logHeaderSize) + recordOnPage * HASH_RECORD_LENGTH + 1; } }