@Override public void notifyBufferPoolOwnerReleased() { checkState(owner != null, "The buffer owner should not be null."); try { networkBufferPool.destroyBufferPool(this); } catch (IOException e) { ExceptionUtils.rethrow(e); } }
/** * Destroy is called after the produce or consume phase of a task finishes. */ @Override public void lazyDestroy() { synchronized (availableMemorySegments) { if (!isDestroyed) { MemorySegment segment; while ((segment = availableMemorySegments.poll()) != null) { returnMemorySegment(segment); } EventListener<Buffer> listener; while ((listener = registeredListeners.poll()) != null) { listener.onEvent(null); } isDestroyed = true; } } networkBufferPool.destroyBufferPool(this); }
/** * Destroy is called after the produce or consume phase of a task finishes. */ @Override public void lazyDestroy() { // NOTE: if you change this logic, be sure to update recycle() as well! synchronized (availableMemorySegments) { if (!isDestroyed) { MemorySegment segment; while ((segment = availableMemorySegments.poll()) != null) { returnMemorySegment(segment); } BufferListener listener; while ((listener = registeredListeners.poll()) != null) { listener.notifyBufferDestroyed(); } isDestroyed = true; } } try { networkBufferPool.destroyBufferPool(this); } catch (IOException e) { ExceptionUtils.rethrow(e); } }
/** * Destroy is called after the produce or consume phase of a task finishes. */ @Override public void lazyDestroy() { // NOTE: if you change this logic, be sure to update recycle() as well! synchronized (availableMemorySegments) { if (!isDestroyed) { MemorySegment segment; while ((segment = availableMemorySegments.poll()) != null) { returnMemorySegment(segment); } BufferListener listener; while ((listener = registeredListeners.poll()) != null) { listener.notifyBufferDestroyed(); } isDestroyed = true; } } try { networkBufferPool.destroyBufferPool(this); } catch (IOException e) { ExceptionUtils.rethrow(e); } }
} catch (IOException e) { try { destroyBufferPool(localBufferPool); } catch (IOException inner) { e.addSuppressed(inner);
} catch (IOException e) { try { destroyBufferPool(localBufferPool); } catch (IOException inner) { e.addSuppressed(inner);