private void recycleMemorySegments(List<MemorySegment> segments, int size) throws IOException { synchronized (factoryLock) { numTotalRequiredBuffers -= size; availableMemorySegments.addAll(segments); // note: if this fails, we're fine for the buffer pool since we already recycled the segments redistributeBuffers(); } }
@Override public void destroyBufferPool(BufferPool bufferPool) throws IOException { if (!(bufferPool instanceof LocalBufferPool)) { throw new IllegalArgumentException("bufferPool is no LocalBufferPool"); } synchronized (factoryLock) { if (allBufferPools.remove(bufferPool)) { numTotalRequiredBuffers -= bufferPool.getNumberOfRequiredMemorySegments(); redistributeBuffers(); } } }
public void destroyBufferPool(BufferPool bufferPool) throws IOException { if (!(bufferPool instanceof LocalBufferPool)) { throw new IllegalArgumentException("bufferPool is no LocalBufferPool"); } synchronized (factoryLock) { if(bufferPoolsToDestroy.remove(bufferPool)) { numTotalRequiredBuffers -= bufferPool.getNumberOfRequiredMemorySegments(); redistributeBuffers(); } } }
private void recycleMemorySegments(List<MemorySegment> segments, int size) throws IOException { synchronized (factoryLock) { numTotalRequiredBuffers -= size; availableMemorySegments.addAll(segments); // note: if this fails, we're fine for the buffer pool since we already recycled the segments redistributeBuffers(); } }
@Override public void destroyBufferPool(BufferPool bufferPool) throws IOException { if (!(bufferPool instanceof LocalBufferPool)) { throw new IllegalArgumentException("bufferPool is no LocalBufferPool"); } synchronized (factoryLock) { if (allBufferPools.remove(bufferPool)) { numTotalRequiredBuffers -= bufferPool.getNumberOfRequiredMemorySegments(); redistributeBuffers(); } } }
private void recycleMemorySegments(List<MemorySegment> segments, int size) throws IOException { synchronized (factoryLock) { numTotalRequiredBuffers -= size; availableMemorySegments.addAll(segments); // note: if this fails, we're fine for the buffer pool since we already recycled the segments redistributeBuffers(); } }
@Override public void destroyBufferPool(BufferPool bufferPool) { if (!(bufferPool instanceof LocalBufferPool)) { throw new IllegalArgumentException("bufferPool is no LocalBufferPool"); } synchronized (factoryLock) { if (allBufferPools.remove(bufferPool)) { numTotalRequiredBuffers -= bufferPool.getNumberOfRequiredMemorySegments(); try { redistributeBuffers(); } catch (IOException e) { throw new RuntimeException(e); } } } }
@Override public void tryDestroyBufferPool(BufferPool bufferPool, boolean lazyDestroy) throws IOException { if (!(bufferPool instanceof LocalBufferPool)) { throw new IllegalArgumentException("bufferPool is no LocalBufferPool"); } synchronized (factoryLock) { if (allBufferPools.remove(bufferPool)) { if (lazyDestroy) { bufferPoolsToDestroy.add((LocalBufferPool) bufferPool); } else { numTotalRequiredBuffers -= bufferPool.getNumberOfRequiredMemorySegments(); redistributeBuffers(); } } } }
redistributeBuffers(); } catch (Throwable t) { this.numTotalRequiredBuffers -= numRequiredBuffers; redistributeBuffers(); } catch (IOException inner) { t.addSuppressed(inner);
redistributeBuffers(); } catch (Throwable t) { this.numTotalRequiredBuffers -= numRequiredBuffers; redistributeBuffers(); } catch (IOException inner) { t.addSuppressed(inner);
redistributeBuffers(); } catch (Throwable t) { this.numTotalRequiredBuffers -= numRequiredBuffers; redistributeBuffers(); } catch (IOException inner) { t.addSuppressed(inner);
redistributeBuffers(); } catch (IOException e) { try {
redistributeBuffers(); } catch (IOException e) { try {
redistributeBuffers(); } catch (IOException e) { try {