private void applyLN(final ReplayTxn repTxn,
final InputWireRecord wireRecord)
throws DatabaseException {
final LNLogEntry lnEntry = (LNLogEntry) wireRecord.getLogEntry();
final DatabaseId dbId = lnEntry.getDbId();
/*
* If this is a change to the rep group db, remember at commit time,
* and refresh this node's group metadata.
*/
if (dbId.getId() == RepGroupDB.DB_ID) {
repTxn.noteRepGroupDbChange();
}
/*
* Note that we don't have to worry about serializable isolation when
* applying a replicated txn; serializable isolation in only an issue
* for txns that take read locks, and a replicated txn consists only of
* write operations.
*/
final DatabaseImpl dbImpl =
repImpl.getRepNode().getReplica().getDbCache().get(dbId, repTxn);
lnEntry.postFetchInit(dbImpl);
final ReplicationContext repContext =
new ReplicationContext(wireRecord.getVLSN());
final Cursor cursor = DbInternal.makeCursor(dbImpl, repTxn,
null /*cursorConfig*/);
try {
OperationStatus status;
final LN ln = lnEntry.getLN();
if (ln.isDeleted()) {
/*
* Perform an exact search by key. Use read-uncommitted and
* partial data entry to avoid reading old data.
*/
final DatabaseEntry key = new DatabaseEntry(lnEntry.getKey());
final DatabaseEntry data = new DatabaseEntry();
data.setPartial(0, 0, true);
status = DbInternal.searchForReplay(cursor, key, data,
LockMode.READ_UNCOMMITTED,
SearchMode.SET);
if (status == OperationStatus.SUCCESS) {
status = DbInternal.deleteInternal(cursor, repContext);
}
} else {
status = DbInternal.putForReplay(cursor, lnEntry.getKey(), ln,
PutMode.OVERWRITE,
repContext);
}
if (status != OperationStatus.SUCCESS) {