_lastCurState = lastCurState;
}
@Override
public ZNRecord update(ZNRecord currentData) {
CurrentState curState = null;
if (currentData == null) {
curState = new CurrentState(_lastCurState.getId());
// copy all simple fields settings and overwrite session-id to current session
curState.getRecord().setSimpleFields(_lastCurState.getRecord().getSimpleFields());
curState.setSessionId(SessionId.from(_curSessionId));
} else {
curState = new CurrentState(currentData);
}
for (PartitionId partitionId : _lastCurState.getTypedPartitionStateMap().keySet()) {
// carry-over only when current-state not exist
if (curState.getState(partitionId) == null) {
curState.setState(partitionId, State.from(_initState));
}
}
return curState.getRecord();
}