freeBuffer[nextIndex] = null; try { fillBuffer = b.init(nextFillBSN, lfm); } catch (LogFileOverflowException e) {
/** * decrements count of threads waiting on this buffer. * <p>If count goes to zero, buffer is returned to * the freeBuffer list, and any threads waiting for * a free buffer are notified. * @param buffer LogBuffer to be released * @see #buffersWaitingForce */ private void releaseBuffer(LogBuffer buffer) { if (buffer.release() == 0) { synchronized(bufferManagerLock) { freeBuffer[buffer.index] = buffer; bufferManagerLock.notifyAll(); --buffersWaitingForce; assert buffersWaitingForce >= 0 : "buffersWaitingForce (" + buffersWaitingForce + ") < 0"; } } }
/** * Waits for logBuffer to be forced to disk. * * <p>No monitors are owned when routine is entered. * <p>Prior to calling sync(), the thread called put() * with <i> sync </i> param set true to register * the fact that the thread would wait for the force. */ private void sync(LogBuffer logBuffer) throws IOException, InterruptedException { try { logBuffer.sync(); } finally { releaseBuffer(logBuffer); } }
assert logBuffer.tod > prevWriteTOD : "TOD error at BSN: " + logBuffer.bsn; long startWrite = System.currentTimeMillis(); logBuffer.write(); long writeTime = elapsedTime(startWrite); totalWriteTime += writeTime; threadsWaitingForce += logBuffer.getWaitingThreads();
lb.read(lf, position); // BUG 300969 return (lb.bsn < bsn) ? -1 : lb.bsn; // BUG 300969
stats.append(freeBuffer[i].getStats());
if (buffer != null && buffer.shouldForce())
assert logBuffer.tod > prevWriteTOD : "TOD error at BSN: " + logBuffer.bsn; long startWrite = System.currentTimeMillis(); logBuffer.write(); long writeTime = elapsedTime(startWrite); totalWriteTime += writeTime; threadsWaitingForce += logBuffer.getWaitingThreads();
lb.read(lf, position); // BUG 300969 return (lb.bsn < bsn) ? -1 : lb.bsn; // BUG 300969
stats.append(freeBuffer[i].getStats());
if (buffer != null && buffer.shouldForce())
assert logBuffer.tod > prevWriteTOD : "TOD error at BSN: " + logBuffer.bsn; long startWrite = System.currentTimeMillis(); logBuffer.write(); long writeTime = elapsedTime(startWrite); totalWriteTime += writeTime; threadsWaitingForce += logBuffer.getWaitingThreads();
lb.read(lf, position); // BUG 300969 return (lb.bsn < bsn) ? -1 : lb.bsn; // BUG 300969
/** * decrements count of threads waiting on this buffer. * <p>If count goes to zero, buffer is returned to * the freeBuffer list, and any threads waiting for * a free buffer are notified. * @param buffer LogBuffer to be released * @see #buffersWaitingForce */ private void releaseBuffer(LogBuffer buffer) { if (buffer.release() == 0) { synchronized(bufferManagerLock) { freeBuffer[buffer.index] = buffer; bufferManagerLock.notifyAll(); --buffersWaitingForce; assert buffersWaitingForce >= 0 : "buffersWaitingForce (" + buffersWaitingForce + ") < 0"; } } }
/** * Waits for logBuffer to be forced to disk. * * <p>No monitors are owned when routine is entered. * <p>Prior to calling sync(), the thread called put() * with <i> sync </i> param set true to register * the fact that the thread would wait for the force. */ private void sync(LogBuffer logBuffer) throws IOException, InterruptedException { try { logBuffer.sync(); } finally { releaseBuffer(logBuffer); } }
freeBuffer[nextIndex] = null; try { fillBuffer = b.init(nextFillBSN, lfm); } catch (LogFileOverflowException e) {
stats.append(freeBuffer[i].getStats());