private int getAndSetIntField(int recordId,
                                @FieldOffset int fieldRelativeOffset,
                                int fieldValue) throws IOException {
    long recordOffsetInFile = recordOffsetInFile(recordId);
    int recordOffsetOnPage = storage.toOffsetInPage(recordOffsetInFile);
    Page page = storage.pageByOffset(recordOffsetInFile);
    ByteBuffer pageBuffer = page.rawPageBuffer();
    int previousValue = getAndSetIntVolatile(pageBuffer, recordOffsetOnPage + fieldRelativeOffset, fieldValue);
    incrementRecordVersion(pageBuffer, recordOffsetOnPage);
    return previousValue;
  }
private int getAndSetIntField(int recordId,
                                @FieldOffset int fieldRelativeOffset,
                                int fieldValue)