@Test public void testOnDeleteEntries() { ReplicatedLog replicatedLog = context.getReplicatedLog(); replicatedLog.append(new SimpleReplicatedLogEntry(0, 1, new MockRaftActorContext.MockPayload("0"))); replicatedLog.append(new SimpleReplicatedLogEntry(1, 1, new MockRaftActorContext.MockPayload("1"))); replicatedLog.append(new SimpleReplicatedLogEntry(2, 1, new MockRaftActorContext.MockPayload("2"))); sendMessageToSupport(new DeleteEntries(1)); assertEquals("Journal log size", 1, context.getReplicatedLog().size()); assertEquals("Last index", 0, context.getReplicatedLog().lastIndex()); }
private void onDeleteEntries(final DeleteEntries deleteEntries) { if (context.getPersistenceProvider().isRecoveryApplicable()) { replicatedLog().removeFrom(deleteEntries.getFromIndex()); } else { dataRecoveredWithPersistenceDisabled = true; } }
RaftActorRecoverySupport { private void onDeleteEntries(final DeleteEntries deleteEntries) { if (context.getPersistenceProvider().isRecoveryApplicable()) { replicatedLog().removeFrom(deleteEntries.getFromIndex()); } else { dataRecoveredWithPersistenceDisabled = true; } } }
RaftActorRecoverySupport { private void onDeleteEntries(final DeleteEntries deleteEntries) { if (context.getPersistenceProvider().isRecoveryApplicable()) { replicatedLog().removeFrom(deleteEntries.getFromIndex()); } else { dataRecoveredWithPersistenceDisabled = true; } } RaftActorRecoverySupport(final RaftActorContext context, final RaftActorRecoveryCohort cohort); }
RaftActorRecoverySupport { private void onDeleteEntries(final DeleteEntries deleteEntries) { if (context.getPersistenceProvider().isRecoveryApplicable()) { replicatedLog().removeFrom(deleteEntries.getFromIndex()); } else { dataRecoveredWithPersistenceDisabled = true; } } RaftActorRecoverySupport(final RaftActorContext context, final RaftActorRecoveryCohort cohort);  }
RaftActorRecoverySupport { private void onDeleteEntries(final DeleteEntries deleteEntries) { if (context.getPersistenceProvider().isRecoveryApplicable()) { replicatedLog().removeFrom(deleteEntries.getFromIndex()); } else { dataRecoveredWithPersistenceDisabled = true; } } RaftActorRecoverySupport(final RaftActorContext context, final RaftActorRecoveryCohort cohort);   }