/** @see LN#writeToLog */ public void writeToLog(ByteBuffer logBuffer) { /* * Add the tracked (live) summary to the base summary before writing it * to the log, and reset the tracked summary. Do this even when * deleting the LN, so that the tracked summary is cleared. */ if (trackedSummary != null) { baseSummary.add(trackedSummary); if (!isDeleted()) { getOffsets(); } /* Reset the totals to zero and clear the tracked offsets. */ trackedSummary.reset(); } super.writeToLog(logBuffer); if (!isDeleted()) { baseSummary.writeToLog(logBuffer); obsoleteOffsets.writeToLog(logBuffer); } }
/** * Dump additional fields. Done this way so the additional info can be within the XML tags * defining the dumped log entry. */ protected void dumpLogAdditional(StringBuffer sb, boolean verbose) { if (!isDeleted()) { baseSummary.dumpLog(sb, true); if (verbose) { obsoleteOffsets.dumpLog(sb, true); } } }
/** * This log entry type is configured to perform marshaling (getLogSize and writeToLog) under the * write log mutex. Otherwise, the size could change in between calls to these two methods as the * result of utilizaton tracking. * * @see LN#getLogSize */ public int getLogSize() { int size = super.getLogSize(); if (!isDeleted()) { size += baseSummary.getLogSize(); getOffsets(); size += obsoleteOffsets.getLogSize(); } return size; }
public String dumpString(int nSpaces, boolean dumpTags) { StringBuffer sb = new StringBuffer(); sb.append(super.dumpString(nSpaces, dumpTags)); sb.append('\n'); if (!isDeleted()) { sb.append(baseSummary.toString()); sb.append(obsoleteOffsets.toString()); } return sb.toString(); }
/** @see LN#readFromLog */ public void readFromLog(ByteBuffer itemBuffer, byte entryVersion) throws LogException { this.entryVersion = entryVersion; super.readFromLog(itemBuffer, entryVersion); if (!isDeleted()) { baseSummary.readFromLog(itemBuffer, entryVersion); if (entryVersion > 0) { obsoleteOffsets.readFromLog(itemBuffer, entryVersion); } } }