/* Read targeted entry. */
if (targetLogEntry != null) {
targetLogEntry.readEntry(envImpl, currentEntryHeader, entryBuffer);
/* Apply the mapDbOnly setting. */
DatabaseId dbId = getDatabaseId();
boolean isMapDb = dbId.equals(DbTree.ID_DB_ID);
useEntry = (!mapDbOnly || isMapDb);
}
/* If we're not tracking IDs, we're done. */
if (!trackIds) {
return useEntry;
}
/*
* TODO: For now we track the VLSN for all replicated entries here.
* Move this into isTargetEntry when FileReader supports a correct
* getLastLsn when called from isTargetEntry.
*/
/* Track VLSNs in the log entry header of all replicated entries. */
if (currentEntryHeader.getReplicated()) {
vlsnProxy.trackMapping(getLastLsn(),
currentEntryHeader,
null /*targetLogEntry*/);
}
/* TODO Also remove this block. */
if (targetLogEntry == null && !idTrackingSet.contains(fromLogType)) {
int endPosition = threadSafeBufferPosition(entryBuffer) +
currentEntryHeader.getItemSize();
threadSafeBufferPosition(entryBuffer, endPosition);
return useEntry;
}
/* Read non-target entry. */
if (targetLogEntry == null) {
assert idTrackingSet.contains(fromLogType);
targetLogEntry = idTrackingMap.get(fromLogType);
if (targetLogEntry == null) {
targetLogEntry = fromLogType.getNewLogEntry();
idTrackingMap.put(fromLogType, targetLogEntry);
}
targetLogEntry.readEntry(envImpl, currentEntryHeader, entryBuffer);
}
/*
* Count node and delta entries as new. Non-node/delta entries are
* counted in isTargetEntry.
*/
if (fromLogType.isNodeType() ||
fromLogType.equals(LogEntryType.LOG_BIN_DELTA)) {
tracker.countNewLogEntry(getLastLsn(), fromLogType,
currentEntryHeader.getSize() +
currentEntryHeader.getItemSize(),
targetLogEntry.getDbId());
}
/* Track VLSNs in RollbackStart. */
if (fromLogType.equals(LogEntryType.LOG_ROLLBACK_START)) {
vlsnProxy.trackMapping(getLastLsn(),
currentEntryHeader,
targetLogEntry);
}
DatabaseId dbIdToReset = null;
long fileNumToReset = -1;
/* Process LN types. */
if (fromLogType.isLNType()) {
LNLogEntry lnEntry = (LNLogEntry) targetLogEntry;
if (fromLogType.equals(LogEntryType.LOG_MAPLN) ||
fromLogType.equals(LogEntryType.LOG_MAPLN_TRANSACTIONAL)) {
MapLN mapLN = (MapLN) lnEntry.getMainItem();
DatabaseId dbId = mapLN.getDatabase().getId();
/* Track latest DB ID. */
long dbIdVal = dbId.getId();
maxDbId = (dbIdVal > maxDbId) ? dbIdVal : maxDbId;
minReplicatedDbId = (dbIdVal < minReplicatedDbId) ?
dbIdVal : minReplicatedDbId;
/*