@SuppressWarnings("unchecked") public void remove() { if (lastPage == null) { throw new IllegalStateException(); } try { free(lastPage); lastPage = null; } catch (IOException e) { throw new RuntimeException(e); } } };
/** * Frees up a previously allocated page so that it can be re-allocated again. * * @param pageId the page to free up * @throws IOException * If an disk error occurred. * @throws IllegalStateException * if the PageFile is not loaded */ public void free(long pageId) throws IOException { free(load(pageId, null)); }
/** * Frees up a previously allocated sequence of pages so that it can be re-allocated again. * * @param pageId the initial page of the sequence that will be getting freed * @param count the number of pages in the sequence * * @throws IOException * If an disk error occurred. * @throws IllegalStateException * if the PageFile is not loaded */ public void free(long pageId, int count) throws IOException { free(load(pageId, null), count); }
public void clear(Transaction tx) throws IOException { entries.clear(); tx.free(this.getPageId()); }
void remove(Transaction tx) throws IOException { defaultPriorityIndex.clear(tx); defaultPriorityIndex.unload(tx); tx.free(defaultPriorityIndex.getPageId()); if (lowPriorityIndex != null) { lowPriorityIndex.clear(tx); lowPriorityIndex.unload(tx); tx.free(lowPriorityIndex.getPageId()); } if (highPriorityIndex != null) { highPriorityIndex.clear(tx); highPriorityIndex.unload(tx); tx.free(highPriorityIndex.getPageId()); } }
/** * Frees up a previously allocated sequence of pages so that it can be re-allocated again. * * @param page the initial page of the sequence that will be getting freed * @param count the number of pages in the sequence * * @throws IOException * If an disk error occurred. * @throws IllegalStateException * if the PageFile is not loaded */ public <T> void free(Page<T> page, int count) throws IOException { pageFile.assertLoaded(); long offsetPage = page.getPageId(); while (count-- > 0) { if (page == null) { page = load(offsetPage, null); } free(page); page = null; // Increment the offsetPage value since using it depends on the current count. offsetPage++; } }
private void updateIndex(Transaction tx, KahaRemoveDestinationCommand command) throws IOException { StoredDestination sd = getStoredDestination(command.getDestination(), tx); sd.orderIndex.clear(tx); sd.orderIndex.unload(tx); tx.free(sd.orderIndex.getPageId()); sd.messageIdIndex.clear(tx); sd.messageIdIndex.unload(tx); tx.free(sd.messageIdIndex.getPageId()); if (sd.subscriptions != null) { sd.subscriptions.clear(tx); sd.subscriptions.unload(tx); tx.free(sd.subscriptions.getPageId()); sd.subscriptionAcks.clear(tx); sd.subscriptionAcks.unload(tx); tx.free(sd.subscriptionAcks.getPageId()); } String key = key(command.getDestination()); storedDestinations.remove(key); destinations.remove(tx, key); }
tx.free(sd.locationIndex.getPageId()); tx.free(sd.messageIdIndex.getPageId()); tx.free(sd.messageStoreStatistics.getPageId()); sd.messageStoreStatistics = null; sd.subscriptions.clear(tx); sd.subscriptions.unload(tx); tx.free(sd.subscriptions.getPageId()); tx.free(sd.subscriptionAcks.getPageId()); tx.free(sd.ackPositions.getHeadPageId()); tx.free(sd.subLocations.getHeadPageId());
tx.free(metadata.binPageId, metadata.binCapacity);
@Override public void close() throws IOException { super.close(); // We need to free up the rest of the page chain.. if (current.getType() == Page.PAGE_PART_TYPE) { free(current.getNext()); } current.makePageEnd(pos, getWriteTransactionId()); // make visible as end page pageFile.addToCache(current); // Write the header.. pos = 0; current.write(this); Transaction.this.write(current, buf); } };
public void clear(Transaction tx) throws IOException { if( isBranch() ) { for (int i = 0; i < children.length; i++) { BTreeNode<Key, Value> node = index.loadNode(tx, children[i], this); node.clear(tx); tx.free(node.getPage()); } } // Reset the root node to be a leaf. if( parent == null ) { setLeafData(createKeyArray(0), createValueArray(0)); next=-1; index.storeNode(tx, this, true); } }
@SuppressWarnings("unchecked") public void remove() { if (lastPage == null) { throw new IllegalStateException(); } try { free(lastPage); lastPage = null; } catch (IOException e) { throw new RuntimeException(e); } } };
@SuppressWarnings("unchecked") public void remove() { if (lastPage == null) { throw new IllegalStateException(); } try { free(lastPage); lastPage = null; } catch (IOException e) { throw new RuntimeException(e); } } };
@SuppressWarnings("unchecked") public void remove() { if (lastPage == null) { throw new IllegalStateException(); } try { free(lastPage); lastPage = null; } catch (IOException e) { throw new RuntimeException(e); } } };
/** * Frees up a previously allocated page so that it can be re-allocated again. * * @param pageId the page to free up * @throws IOException * If an disk error occurred. * @throws IllegalStateException * if the PageFile is not loaded */ public void free(long pageId) throws IOException { free(load(pageId, null)); }
/** * Frees up a previously allocated page so that it can be re-allocated again. * * @param pageId the page to free up * @throws IOException * If an disk error occurred. * @throws IllegalStateException * if the PageFile is not loaded */ public void free(long pageId) throws IOException { free(load(pageId, null)); }
/** * Frees up a previously allocated page so that it can be re-allocated again. * * @param pageId the page to free up * @throws IOException * If an disk error occurred. * @throws IllegalStateException * if the PageFile is not loaded */ public void free(long pageId) throws IOException { free(load(pageId, null)); }
public void clear(Transaction tx) throws IOException { entries.clear(); tx.free(this.getPageId()); }
public void clear(Transaction tx) throws IOException { entries.clear(); tx.free(this.getPageId()); }