_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(_curSessionId);
} else
{
curState = new CurrentState(currentData);
}
for (String partitionName : _lastCurState.getPartitionStateMap().keySet()) {
// carry-over only when current-state not exist
if (curState.getState(partitionName) == null) {
curState.setState(partitionName, _initState);
}
}
return curState.getRecord();
}