protected boolean processEntry(ByteBuffer entryBuffer)
throws DatabaseException {
final LogEntryType lastEntryType =
LogEntryType.findType(currentEntryHeader.getType());
final LogEntry entry = lastEntryType.getNewLogEntry();
entry.readEntry(envImpl, currentEntryHeader, entryBuffer);
ExtendedFileSummary summary =
(ExtendedFileSummary) summaries.get(window.currentFileNum());
if (summary == null) {
summary = new ExtendedFileSummary();
summaries.put(window.currentFileNum(), summary);
}
final int size = getLastEntrySize();
summary.totalCount += 1;
summary.totalSize += size;
if (entry instanceof LNLogEntry) {
final LNLogEntry lnEntry = (LNLogEntry) entry;
if (DEBUG) {
final int otherSize = lnEntry.getLastLoggedSize();
if (size != otherSize) {
System.out.println
("LogReader.getLastEntrySize=" + size +
" LNEntry.getLastLoggedSize=" + otherSize +
" " + lnEntry.getLogType());
}
}
/* Save transactional entry, apply non-transactional entry. */
if (lastEntryType.isTransactional()) {
final Long txnId = Long.valueOf(lnEntry.getTransactionId());
List<Object> txnEntries = txns.get(txnId);
if (txnEntries == null) {
txnEntries = new ArrayList<Object>();
txns.put(txnId, txnEntries);
}
txnEntries.add(summary);
txnEntries.add(lnEntry);
} else {
twoEntryList.set(0, summary);
twoEntryList.set(1, lnEntry);
applyTxn(twoEntryList, true);
}
} else if (entry instanceof INLogEntry) {
/* Count IN. */
final INLogEntry inEntry = (INLogEntry) entry;
final Long nodeId = Long.valueOf(inEntry.getNodeId());
summary.totalINCount += 1;
summary.totalINSize += size;
countObsoleteIN(nodeId);
putActiveIN(nodeId, size, summary, inEntry.getDbId().getId());
} else if (entry instanceof BINDeltaLogEntry) {
/* Count Delta as IN. */
summary.totalINCount += 1;
summary.totalINSize += size;
} else if (entry instanceof SingleItemEntry) {
/* Count deleted IN. */
final Object item = ((SingleItemEntry) entry).getMainItem();
final long deletedNodeId;
if (item instanceof INDeleteInfo) {
deletedNodeId = ((INDeleteInfo) item).getDeletedNodeId();
} else if (item instanceof INDupDeleteInfo) {
deletedNodeId = ((INDupDeleteInfo) item).getDeletedNodeId();
} else {
deletedNodeId = Node.NULL_NODE_ID;
}
if (deletedNodeId != Node.NULL_NODE_ID) {
final Long nodeId = deletedNodeId;
countObsoleteIN(nodeId);
activeINs.remove(nodeId);
}
/* Apply transaction on commit or abort. */
if (item instanceof TxnEnd) {
final Long txnId = Long.valueOf(entry.getTransactionId());
final List<Object> txnEntries = txns.remove(txnId);
if (txnEntries != null) {
applyTxn(txnEntries, item instanceof TxnCommit);
}
}