Source:
private synchronized void releaseExportBytes(long releaseSeqNo) throws IOException { if (releaseSeqNo < m_lastReleasedSeqNo) { return; } AckingContainer pend = m_pendingContainer.get(); if (pend != null) { if (releaseSeqNo > pend.m_lastSeqNo) { if (exportLog.isDebugEnabled()) { exportLog.debug("Discarding via ack a pending " + pend); } m_pendingContainer.set(null); pend.internalDiscard(); } } while (!m_committedBuffers.isEmpty() && releaseSeqNo >= m_committedBuffers.peek().startSequenceNumber()) { StreamBlock sb = m_committedBuffers.peek(); if (releaseSeqNo >= sb.lastSequenceNumber()) { try { m_committedBuffers.pop(); m_lastAckedTimestamp = Math.max(m_lastAckedTimestamp, sb.getTimestamp()); } finally { sb.discard(); } } else if (releaseSeqNo >= sb.startSequenceNumber()) { sb.releaseTo(releaseSeqNo); m_lastAckedTimestamp = Math.max(m_lastAckedTimestamp, sb.getTimestamp()); break; } } if (m_status == StreamStatus.BLOCKED && m_gapTracker.getFirstGap() != null && releaseSeqNo >= m_gapTracker.getFirstGap().getSecond()) { exportLog.info("Export queue gap resolved. releaseExportBytes. Resuming export for " + ExportDataSource.this.toString()); clearGap(true); } m_lastReleasedSeqNo = releaseSeqNo; int tuplesDeleted = m_gapTracker.truncate(releaseSeqNo); m_tuplesPending.addAndGet(-tuplesDeleted); m_firstUnpolledSeqNo = Math.max(m_firstUnpolledSeqNo, releaseSeqNo + 1); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncating tracker via ack to " + releaseSeqNo + ", next seqNo to poll is " + m_firstUnpolledSeqNo + ", tracker map is " + m_gapTracker.toString() + ", m_committedBuffers.isEmpty() " + m_committedBuffers.isEmpty()); } return; }

Target:
private synchronized void releaseExportBytes(long releaseSeqNo) throws IOException { if (releaseSeqNo < m_lastReleasedSeqNo) { return; } AckingContainer pend = m_pendingContainer.get(); if (pend != null) { if (releaseSeqNo > pend.m_lastSeqNo) { if (exportLog.isDebugEnabled()) { exportLog.debug("Discarding via ack a pending " + pend); } m_pendingContainer.set(null); pend.internalDiscard(); } } while (!m_committedBuffers.isEmpty() && releaseSeqNo >= m_committedBuffers.peek().startSequenceNumber()) { StreamBlock sb = m_committedBuffers.peek(); if (releaseSeqNo >= sb.lastSequenceNumber()) { try { m_committedBuffers.pop(); m_lastAckedTimestamp = Math.max(m_lastAckedTimestamp, sb.getTimestamp()); } finally { sb.discard(); } } else if (releaseSeqNo >= sb.startSequenceNumber()) { sb.releaseTo(releaseSeqNo); m_lastAckedTimestamp = Math.max(m_lastAckedTimestamp, sb.getTimestamp()); break; } } if (m_status == StreamStatus.BLOCKED && m_gapTracker.getFirstGap() != null && releaseSeqNo >= m_gapTracker.getFirstGap().getSecond()) { assert (!m_mastershipAccepted.get()); exportLog.info("Received an ACK for the sequence number after export queue gap. " + "Set stream status to ACTIVE: " + ExportDataSource.this.toString()); clearGap(true); } m_lastReleasedSeqNo = releaseSeqNo; int tuplesDeleted = m_gapTracker.truncate(releaseSeqNo); m_tuplesPending.addAndGet(-tuplesDeleted); m_firstUnpolledSeqNo = Math.max(m_firstUnpolledSeqNo, releaseSeqNo + 1); if (exportLog.isDebugEnabled()) { exportLog.debug("Truncating tracker via ack to " + releaseSeqNo + ", next seqNo to poll is " + m_firstUnpolledSeqNo + ", tracker map is " + m_gapTracker.toString() + ", m_committedBuffers.isEmpty() " + m_committedBuffers.isEmpty()); } return; }