@Override public String toString() { return "Asynchronous flush of Page[" + System.identityHashCode(page) + "] (size=" + page.size() + ")"; } });
@Override public String toString() { return "Asynchronous flush of Page[" + System.identityHashCode(page) + "] (size=" + page.size() + ")"; } });
@Override public String toString() { StringBuilder sb = new StringBuilder("OffHeapStorageArea\n"); for (int i = 0; i < pages.size(); ) { Page p = pages.get(i++); if (p == null) { break; } else { int size = p.size(); int count = 1; while (i < pages.size()) { Page q = pages.get(i); if (q != null && q.size() == size) { count++; i++; } else { break; } } sb.append("\t").append(count).append(" ").append(toBase2SuffixedString(size)).append("B page").append(count == 1 ? "\n" : "s\n"); } } sb.append("Allocator: ").append(allocator).append('\n'); sb.append("Page Source: ").append(pageSource); return sb.toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder("OffHeapStorageArea\n"); for (int i = 0; i < pages.size(); ) { Page p = pages.get(i++); if (p == null) { break; } else { int size = p.size(); int count = 1; while (i < pages.size()) { Page q = pages.get(i); if (q != null && q.size() == size) { count++; i++; } else { break; } } sb.append("\t").append(count).append(" ").append(toBase2SuffixedString(size)).append("B page").append(count == 1 ? "\n" : "s\n"); } } sb.append("Allocator: ").append(allocator).append('\n'); sb.append("Page Source: ").append(pageSource); return sb.toString(); }
@Override public void persist(ObjectOutput output) throws IOException { Lock l = writeLock(); l.lock(); try { output.writeInt(MAGIC); output.writeLong(((MappedPageSource) tableSource).getAddress(hashTablePage)); output.writeInt(hashTablePage.size()); output.writeInt(reprobeLimit); ((Persistent) storageEngine).persist(output); } finally { l.unlock(); } }
@Override public void persist(ObjectOutput output) throws IOException { Lock l = writeLock(); l.lock(); try { output.writeInt(MAGIC); output.writeLong(((MappedPageSource) tableSource).getAddress(hashTablePage)); output.writeInt(hashTablePage.size()); output.writeInt(reprobeLimit); ((Persistent) storageEngine).persist(output); } finally { l.unlock(); } }
@Override public void persist(ObjectOutput output) throws IOException { Lock l = writeLock(); l.lock(); try { output.writeInt(MAGIC); output.writeLong(((MappedPageSource) tableSource).getAddress(hashTablePage)); output.writeInt(hashTablePage.size()); output.writeInt(reprobeLimit); ((Persistent) storageEngine).persist(output); } finally { l.unlock(); } }
@Override public void persist(ObjectOutput output) throws IOException { Lock l = writeLock(); l.lock(); try { output.writeInt(MAGIC); output.writeLong(((MappedPageSource) tableSource).getAddress(hashTablePage)); output.writeInt(hashTablePage.size()); output.writeInt(reprobeLimit); ((Persistent) storageEngine).persist(output); } finally { l.unlock(); } }
public void release(long address) { int lastPage = pageIndexFor(address); for (int i = pages.size() - 1; i > lastPage; i--) { Page p = pages.remove(i); allocator.expand(-p.size()); freePage(p); } validatePages(); }
public void release(long address) { int lastPage = pageIndexFor(address); for (int i = pages.size() - 1; i > lastPage; i--) { Page p = pages.remove(i); allocator.expand(-p.size()); freePage(p); } validatePages(); }
/** * Frees the supplied buffer. * <p> * If the given buffer was not allocated by this source or has already been * freed then an {@code AssertionError} is thrown. */ @Override public synchronized void free(Page page) { if (page.isFreeable()) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Freeing a {}B buffer from chunk {} &{}", DebuggingUtils.toBase2SuffixedString(page.size()), page.index(), page.address()); } markAllAvailable(); sliceAllocators.get(page.index()).free(page.address(), page.size()); victims.get(page.index()).remove(page); victimAllocators.get(page.index()).tryFree(page.address(), page.size()); if (!fallingThresholds.isEmpty()) { long allocated = getAllocatedSize(); fireThresholds(allocated + page.size(), allocated); } } }
/** * Frees the supplied buffer. * <p> * If the given buffer was not allocated by this source or has already been * freed then an {@code AssertionError} is thrown. */ @Override public synchronized void free(Page page) { if (page.isFreeable()) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Freeing a {}B buffer from chunk {} &{}", DebuggingUtils.toBase2SuffixedString(page.size()), page.index(), page.address()); } markAllAvailable(); sliceAllocators.get(page.index()).free(page.address(), page.size()); victims.get(page.index()).remove(page); victimAllocators.get(page.index()).tryFree(page.address(), page.size()); if (!fallingThresholds.isEmpty()) { long allocated = getAllocatedSize(); fireThresholds(allocated + page.size(), allocated); } } }
for (int i = pages.size() - 1; i >= 0; i--) { Page free = pages.get(i); allocator.expand(-free.size()); pages.remove(i); if (targets.remove(free)) { Page f = freePageSource.next(); validate(!VALIDATING || f != t); validate(!VALIDATING || f.size() == t.size()); ((ByteBuffer) f.asByteBuffer().clear()).put((ByteBuffer) t.asByteBuffer().clear()); pages.put(index, f);
for (int i = pages.size() - 1; i >= 0; i--) { Page free = pages.get(i); allocator.expand(-free.size()); pages.remove(i); if (targets.remove(free)) { Page f = freePageSource.next(); validate(!VALIDATING || f != t); validate(!VALIDATING || f.size() == t.size()); ((ByteBuffer) f.asByteBuffer().clear()).put((ByteBuffer) t.asByteBuffer().clear()); pages.put(index, f);
victimAllocator.claim(p.address(), p.size()); int claimSize = p.address() - claimAddress; if (claimSize > 0) { victimAllocator.claim(claimAddress, claimSize); claimAddress = p.address() + p.size(); victimAllocator.free(p.address(), p.size()); free(p); for (Page p : targets) { if (results.contains(p)) { victimAllocator.free(p.address(), p.size()); free(p); } else { victimAllocator.free(p.address(), p.size());
victimAllocator.claim(p.address(), p.size()); int claimSize = p.address() - claimAddress; if (claimSize > 0) { victimAllocator.claim(claimAddress, claimSize); claimAddress = p.address() + p.size(); victimAllocator.free(p.address(), p.size()); free(p); for (Page p : targets) { if (results.contains(p)) { victimAllocator.free(p.address(), p.size()); free(p); } else { victimAllocator.free(p.address(), p.size());