@Override
  public boolean setFlags(final int recordId,
                          final @PersistentFS.Attributes int newFlags) throws IOException {
    final long recordOffsetInFile = recordOffsetInFile(recordId);
    final int recordOffsetOnPage = storage.toOffsetInPage(recordOffsetInFile);
    try (final PageUnsafe page = (PageUnsafe)storage.pageByOffset(recordOffsetInFile, /*forWrite: */ true)) {
      page.lockPageForWrite();
      try {
        final ByteBuffer pageBuffer = page.rawPageBuffer();
        final int storedFlags = pageBuffer.getInt(recordOffsetOnPage + FLAGS_OFFSET);
        final boolean reallyChanged = storedFlags != newFlags;
        if (reallyChanged) {
          pageBuffer.putInt(recordOffsetOnPage + FLAGS_OFFSET, newFlags);
          incrementRecordVersion(pageBuffer, recordOffsetOnPage);

          page.regionModified(recordOffsetOnPage, RECORD_SIZE_IN_BYTES);
        }
        return reallyChanged;
      }
      finally {
        page.unlockPageForWrite();
      }
    }
  }
@Override
  public boolean setFlags(final int recordId,
                          final @PersistentFS.Attributes int newFlags)