void truncate(long pageIndex) throws IOException {
    synchronized (lockObject) {
      lastAccessTime = System.nanoTime();

      flushBuffer();

      lastWrittenPageIndex = -1;
      lastWrittenPage = null;

      segChannel.truncate(pageIndex * OWALPage.PAGE_SIZE);
    }
  }
void truncate ( long pageIndex ) throws IOException { synchronized ( lockObject ) { lastAccessTime = System . nanoTime ( ) ; flushBuffer ( ) ; lastWrittenPageIndex = - 1 ; lastWrittenPage = null ; segChannel . truncate ( pageIndex * OWALPage . PAGE_SIZE ) ; } }
Flushes all buffered pages and truncates file till passed in page index