return DbLsn.NULL_LSN;
}
boolean marshallOutsideLatch = item.marshallOutsideWriteLatch();
ByteBuffer marshalledBuffer = null;
UtilizationTracker tracker = envImpl.getUtilizationTracker();
LogResult logResult = null;
try {
/*
* If possible, marshall this item outside the log write
* latch to allow greater concurrency by shortening the
* write critical section.
*/
if (marshallOutsideLatch) {
int itemSize = item.getLogSize();
int entrySize = itemSize + HEADER_BYTES;
marshalledBuffer = marshallIntoBuffer(item,
itemSize,
isProvisional,
entrySize);
}
logResult = logItem(item, isProvisional, flushRequired,
forceNewLogFile, oldNodeLsn,
marshallOutsideLatch, marshalledBuffer,
tracker);
} catch (BufferOverflowException e) {
/*
* A BufferOverflowException may be seen when a thread is
* interrupted in the middle of the log and the nio direct buffer
* is mangled is some way by the NIO libraries. JE applications
* should refrain from using thread interrupt as a thread
* communications mechanism because nio behavior in the face of
* interrupts is uncertain. See SR [#10463].
*
* One way or another, this type of io exception leaves us in an
* unworkable state, so throw a run recovery exception.
*/
throw new RunRecoveryException(envImpl, e);
} catch (IOException e) {
/*
* Other IOExceptions, such as out of disk conditions, should
* notify the application but leave the environment in workable
* condition.
*/
throw new DatabaseException(Tracer.getStackTrace(e), e);
}
/*
* Finish up business outside of the log write latch critical section.
*/
/*
* If this logged object needs to be fsynced, do so now using the group
* commit mechanism.
*/
if (fsyncRequired) {
fileManager.groupSync();
}
/*
* Periodically, as a function of how much data is written, ask the
* checkpointer or the cleaner to wake up.
*/
if (logResult.wakeupCheckpointer) {
checkpointMonitor.activate();
}
if (logResult.wakeupCleaner) {
tracker.activateCleaner();
}
return logResult.currentLsn;
}