}
protected void recover() {
byte[] serializedState = null;
try {
serializedState = getApp().getCheckpointingFramework().fetchSerializedState(new CheckpointId(this));
} catch (RuntimeException e) {
logger.error("Cannot fetch serialized stated for [{}/{}]: {}", new String[] {
getPrototype().getClass().getName(), getId(), e.getMessage() });
}
if (serializedState == null) {
return;
}
try {
ProcessingElement peInOldState = deserializeState(serializedState);
restoreState(peInOldState);
} catch (RuntimeException e) {
logger.error("Cannot restore state for key [" + new CheckpointId(this) + "]: " + e.getMessage(), e);
}
}