- public void appendRecoveredLogEntry(Payload payload) {
- try {
- if(payload instanceof ModificationPayload) {
- currentLogRecoveryBatch.add((ModificationPayload) payload);
- } else if (payload instanceof CompositeModificationPayload) {
- currentLogRecoveryBatch.add(new ModificationPayload(MutableCompositeModification.fromSerializable(
- ((CompositeModificationPayload) payload).getModification())));
- } else if (payload instanceof CompositeModificationByteStringPayload) {
- currentLogRecoveryBatch.add(new ModificationPayload(MutableCompositeModification.fromSerializable(
- ((CompositeModificationByteStringPayload) payload).getModification())));
- } else {
- log.error("{}: Unknown payload {} received during recovery", shardName, payload);
- }
- } catch (IOException e) {
- log.error("{}: Error extracting ModificationPayload", shardName, e);
- }
-
- }
+ @SuppressWarnings("checkstyle:IllegalCatch")
+ public void appendRecoveredLogEntry(final Payload payload) {
+ Preconditions.checkState(open, "call startLogRecovery before calling appendRecoveredLogEntry");