core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/paginated/atomicoperations/OAtomicOperation.java
private static boolean checkChangesFilledUpTo(final FileChanges changesContainer, final long pageIndex) {
    if (changesContainer == null) {
      return true;
    } else if (changesContainer.isNew || changesContainer.maxNewPageIndex > -2) {
      return pageIndex < changesContainer.maxNewPageIndex + 1;
    } else
      return !changesContainer.truncate;
  }
private static boolean checkChangesFilledUpTo(final FileChanges changesContainer, final long pageIndex) {
    if (changesContainer == null) {
      return true;
    } else if (changesContainer.isNew || changesContainer.maxNewPageIndex > -2) {
      return pageIndex < changesContainer.maxNewPageIndex + 1;
    } else
      return !changesContainer.truncate;
  }
This check if a file was trimmed or trunked in the current atomic operation.

@param changesContainer changes container to check
@param pageIndex        limit to check against the changes

@return true if there are no changes or pageIndex still fit, false if the pageIndex do not fit anymore