/** * Allows you to iterate through all active Pages in this object. Pages with type Page.FREE_TYPE are * not included in this iteration. * * Pages removed with Iterator.remove() will not actually get removed until the transaction commits. * * @throws IllegalStateException * if the PageFile is not loaded */ public Iterator<Page> iterator() { return (Iterator<Page>)iterator(false); }
private void recoverFreePages(final long lastRecoveryPage) throws Exception { LOG.info(toString() + ". Recovering pageFile free list due to prior unclean shutdown.."); SequenceSet newFreePages = new SequenceSet(); // need new pageFile instance to get unshared readFile PageFile recoveryPageFile = new PageFile(directory, name); recoveryPageFile.loadForRecovery(nextFreePageId.get()); try { for (Iterator<Page> i = new Transaction(recoveryPageFile).iterator(true); i.hasNext(); ) { Page page = i.next(); if (page.getPageId() >= lastRecoveryPage) { break; } if (page.getType() == Page.PAGE_FREE_TYPE) { newFreePages.add(page.getPageId()); } } } finally { recoveryPageFile.readFile.close(); } LOG.info(toString() + ". Recovered pageFile free list of size: " + newFreePages.rangeSize()); if (!newFreePages.isEmpty()) { // allow flush (with index lock held) to merge eventually recoveredFreeList.lazySet(newFreePages); } }
/** * Allows you to iterate through all active Pages in this object. Pages with type Page.FREE_TYPE are * not included in this iteration. * * Pages removed with Iterator.remove() will not actually get removed until the transaction commits. * * @throws IllegalStateException * if the PageFile is not loaded */ public Iterator<Page> iterator() { return (Iterator<Page>)iterator(false); }
/** * Allows you to iterate through all active Pages in this object. Pages with type Page.FREE_TYPE are * not included in this iteration. * * Pages removed with Iterator.remove() will not actually get removed until the transaction commits. * * @throws IllegalStateException * if the PageFile is not loaded */ public Iterator<Page> iterator() { return (Iterator<Page>)iterator(false); }
/** * Allows you to iterate through all active Pages in this object. Pages with type Page.FREE_TYPE are * not included in this iteration. * * Pages removed with Iterator.remove() will not actually get removed until the transaction commits. * * @throws IllegalStateException * if the PageFile is not loaded */ public Iterator<Page> iterator() { return (Iterator<Page>)iterator(false); }
private void recoverFreePages(final long lastRecoveryPage) throws Exception { LOG.info(toString() + ". Recovering pageFile free list due to prior unclean shutdown.."); SequenceSet newFreePages = new SequenceSet(); // need new pageFile instance to get unshared readFile PageFile recoveryPageFile = new PageFile(directory, name); recoveryPageFile.loadForRecovery(nextFreePageId.get()); try { for (Iterator<Page> i = new Transaction(recoveryPageFile).iterator(true); i.hasNext(); ) { Page page = i.next(); if (page.getPageId() >= lastRecoveryPage) { break; } if (page.getType() == Page.PAGE_FREE_TYPE) { newFreePages.add(page.getPageId()); } } } finally { recoveryPageFile.readFile.close(); } LOG.info(toString() + ". Recovered pageFile free list of size: " + newFreePages.rangeSize()); if (!newFreePages.isEmpty()) { // allow flush (with index lock held) to merge eventually recoveredFreeList.lazySet(newFreePages); } }
private void recoverFreePages(final long lastRecoveryPage) throws Exception { LOG.info(toString() + ". Recovering pageFile free list due to prior unclean shutdown.."); SequenceSet newFreePages = new SequenceSet(); // need new pageFile instance to get unshared readFile PageFile recoveryPageFile = new PageFile(directory, name); recoveryPageFile.loadForRecovery(nextFreePageId.get()); try { for (Iterator<Page> i = new Transaction(recoveryPageFile).iterator(true); i.hasNext(); ) { Page page = i.next(); if (page.getPageId() >= lastRecoveryPage) { break; } if (page.getType() == Page.PAGE_FREE_TYPE) { newFreePages.add(page.getPageId()); } } } finally { recoveryPageFile.readFile.close(); } LOG.info(toString() + ". Recovered pageFile free list of size: " + newFreePages.rangeSize()); if (!newFreePages.isEmpty()) { // allow flush (with index lock held) to merge eventually recoveredFreeList.lazySet(newFreePages); } }
private void recoverFreePages(final long lastRecoveryPage) throws Exception { LOG.info(toString() + ". Recovering pageFile free list due to prior unclean shutdown.."); SequenceSet newFreePages = new SequenceSet(); // need new pageFile instance to get unshared readFile PageFile recoveryPageFile = new PageFile(directory, name); recoveryPageFile.loadForRecovery(nextFreePageId.get()); try { for (Iterator<Page> i = new Transaction(recoveryPageFile).iterator(true); i.hasNext(); ) { Page page = i.next(); if (page.getPageId() >= lastRecoveryPage) { break; } if (page.getType() == Page.PAGE_FREE_TYPE) { newFreePages.add(page.getPageId()); } } } finally { recoveryPageFile.readFile.close(); } LOG.info(toString() + ". Recovered pageFile free list of size: " + newFreePages.rangeSize()); if (!newFreePages.isEmpty()) { // allow flush (with index lock held) to merge eventually recoveredFreeList.lazySet(newFreePages); } }