docs: private long addLogRecord(LogRecord logRecord,
                                long reservedDelta,
                                boolean setMark,
                                boolean checkSpace,
                                boolean flush)
                      throws ObjectManagerException
      {
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.entry(this,
                          cclass,
                          "addLogRecord",
                          new Object[] { logRecord,
                                        new Long(reservedDelta),
                                        new Boolean(setMark),
                                        new Boolean(checkSpace),
                                        new Boolean(flush) });
  
          // Find the number of bytes we want to write.
          int totalBytes = logRecord.getBytesLeft();
  
          // Make sure the whole logRecord will fit in the log file, along with any extra space it
          // has reserved. This does not account for any space that will be wasted by writing 
          // PaddingLogRecords. This check ensures that this buffer will not take us past the 
          // start point of the log written in the logHeader overwriting log records that we 
          // need for restart. The transactions reserve space assuming a worst case of a 
          // PaddingLogRecord for each commit. If we discover part way through a transaction 
          // the the log is full we can always successfully release our reserved space and commit the
          // transaction. 
          // Note that we don't have to account for sector bytes because they are already incoporated 
          // into the reserved space.
          long newSpaceAllocatedInLogFile = 0;
          // Include any reserved space, the logData and completely filled parts.
          newSpaceAllocatedInLogFile = reservedDelta + totalBytes + partHeaderLength * (totalBytes / maximumLogRecordPart);
          // Add an extra part if one is partially filled.
          if (totalBytes % maximumLogRecordPart > 0)
              newSpaceAllocatedInLogFile = newSpaceAllocatedInLogFile + partHeaderLength;
  
          // Make sure the logRecord will fit in the log file if we are requesting new space.
          // If we are returning space then this is done after writing the log record so that 
          // the record will be written and if required, flushed within its already reserved space.
          if (checkSpace && newSpaceAllocatedInLogFile > 0) {
              long unavailable = reserveLogFileSpace(newSpaceAllocatedInLogFile);
              if (unavailable != 0) {
                  if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                      trace.exit(this,
                                 cclass,
                                 "addLogRecord",
                                 new Object[] { "via LogFileFullException",
                                               new Long(unavailable),
                                               new Long(newSpaceAllocatedInLogFile),
                                               new Long(reservedDelta) });
                  throw new LogFileFullException(this,
                                                 newSpaceAllocatedInLogFile,
                                                 reservedDelta,
                                                 newSpaceAllocatedInLogFile - unavailable);
              } // if (!reserve(newSpaceAllocatedInLogFile).
          } // if (checkSpace...
  
          // Decide if we need to split the log record into multiple parts. we do not allow long logRecords
          // to be written into the LogBuffer as a single piece because that would stop other log records 
          // from being written if they used up the whole of the log buffer. Additionally this would also mean that 
          // log records must be smaller than the log buffer in order to fit into it.
          if (totalBytes > maximumLogRecordPart) {
              idNotFound: while (logRecord.multiPartID == 0) {
                  synchronized (multiPartIDLock) {
                      for (int i = 1; i < multiPartIdentifersUsed.length; i++) {
                          if (!multiPartIdentifersUsed[i]) {
                              logRecord.multiPartID = (byte) i;
                              multiPartIdentifersUsed[i] = true;
                              break idNotFound;
                          } // if(!multiPartIdentifersUsed[i]).  
                      } // for multiPartIdentifersUsed...  
                  } // synchronized (multiPartIDLock).
  
                  // Wait and see if an identifier becomes available as other long 
                  // logRecords complete.
                  Object lock = new Object();
                  synchronized (lock) {
                      stalledForMultiPartID++;
                      try {
                          if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                              trace.debug(this,
                                          cclass,
                                          "addLogRecord",
                                          "About to wait for 10 milliseconds.");
  
                          lock.wait(10);
                      } catch (InterruptedException exception) {
                          // No FFDC Code Needed.
                          ObjectManager.ffdc.processException(this,
                                                              cclass,
                                                              "addLogRecord",
                                                              exception,
                                                              "1:1324:1.52");
  
                          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                              trace.exit(this,
                                         cclass,
                                         "addLogRecord",
                                         exception);
                          throw new UnexpectedExceptionException(this,
                                                                 exception);
                      } // catch (InterruptedException exception).
                  } // synchronized (lock).
  
              } // while (logRecord.multiPartID == 0).  
          } // if ( totalBytes > maximumLogRecordPart ).
  
          // Repeat attempts to add to the logBuffer until we find one that has space
          // for the LogRecord or we have added all of the parts.
          long logSequenceNumber = 0;
          for (;;) {
              logSequenceNumber = addBuffers(logRecord,
                                             setMark,
                                             checkSpace,
                                             flush);
              if (logSequenceNumber == -1)
                  flush();
              else if (logSequenceNumber > 0)
                  break;
          } // for (;;).   
  
          // Return any reserved space.
          if (checkSpace && newSpaceAllocatedInLogFile < 0) {
              paddingReserveLogSpace(newSpaceAllocatedInLogFile);
          } // if (checkSpace...
  
          // Did the logRecord get split?
          if (logRecord.multiPartID != 0) {
              multiPartIdentifersUsed[logRecord.multiPartID] = false;
          } // if (logRecord.multiPartID != 0). 
  
          if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
              trace.exit(this,
                         cclass,
                         "addLogRecord",
                         new Object[] { new Long(logSequenceNumber) });
          return logSequenceNumber;
      }