public HeapFileIterator(TransactionId tid, HeapFile file) { _transactionId = tid; _file = file; _currentPageId = 0; _numPages = _file.numPages(); // System.out.println("numpages "+_numPages); }
private Page readPage(int pageNumber) throws DbException, TransactionAbortedException, IOException { // File == table because we do one file per table // System.out.println("readpage:"+_file.id()+" page:"+pageNumber); int tableId = _file.id(); int pageId = pageNumber; // System.out.println("Page is now "+pageNumber); HeapPageId pid = new HeapPageId(tableId, pageId); return Database.getBufferPool().getPage(_transactionId, pid, Permissions.READ_ONLY); }