public void flushAll() throws IOException {
    //RC: it is hard to define semantics of .flush() implementation in a concurrent environment.
    //    I.e. new pages could be created and inserted in parallel, and those pages will or will
    //    not be flushed, depending on there in .pages array they are inserted, and there the
    //    iteration index is at the moment of insertion. And pages just flushed could become
    //    dirty again even before the loop is finished.
    //    But I see no simple way to fix it, apart from returning to global lock protecting all
    //    writes -- which is exactly what we're escaping from by moving to concurrent implementation.
    AtomicReferenceArray<PageImpl> pagesLocal = pages;
    for (int i = 0; i < pagesLocal.length(); i++) {
      final PageImpl page = pagesLocal.get(i);
      if (page != null && page.isDirty()) {
        page.flush();
      }
    }
  }
public void flushAll()