@Test public void testAdvanceCommitIndexGenerateSnapshot() { MemoryLog log = new MemoryLog(); log.appendEntry(1); log.advanceCommitIndex(1, 1); log.generateSnapshot(1, Collections.emptySet()); log.appendEntry(2); }
@Override protected Snapshot generateSnapshot(EntryMeta lastAppliedEntryMeta, Set<NodeEndpoint> groupConfig) { ByteArrayOutputStream output = new ByteArrayOutputStream(); try { stateMachine.generateSnapshot(output); } catch (IOException e) { throw new LogException("failed to generate snapshot", e); } return new MemorySnapshot(lastAppliedEntryMeta.getIndex(), lastAppliedEntryMeta.getTerm(), output.toByteArray(), groupConfig); }
MemoryLog extends AbstractLog { @Override protected Snapshot generateSnapshot(EntryMeta lastAppliedEntryMeta, Set<NodeEndpoint> groupConfig) { ByteArrayOutputStream output = new ByteArrayOutputStream(); try { stateMachine.generateSnapshot(output); } catch (IOException e) { throw new LogException("failed to generate snapshot", e); } return new MemorySnapshot(lastAppliedEntryMeta.getIndex(), lastAppliedEntryMeta.getTerm(), output.toByteArray(), groupConfig); } }
MemoryLog extends AbstractLog { @Override protected Snapshot generateSnapshot(EntryMeta lastAppliedEntryMeta, Set<NodeEndpoint> groupConfig) { ByteArrayOutputStream output = new ByteArrayOutputStream(); try { stateMachine.generateSnapshot(output); } catch (IOException e) { throw new LogException("failed to generate snapshot", e); } return new MemorySnapshot(lastAppliedEntryMeta.getIndex(), lastAppliedEntryMeta.getTerm(), output.toByteArray(), groupConfig); } MemoryLog();  MemoryLog(EventBus eventBus);  MemoryLog(Snapshot snapshot, EntrySequence entrySequence, EventBus eventBus); }
MemoryLog extends AbstractLog { @Override protected Snapshot generateSnapshot(EntryMeta lastAppliedEntryMeta, Set<NodeEndpoint> groupConfig) { ByteArrayOutputStream output = new ByteArrayOutputStream(); try { stateMachine.generateSnapshot(output); } catch (IOException e) { throw new LogException("failed to generate snapshot", e); } return new MemorySnapshot(lastAppliedEntryMeta.getIndex(), lastAppliedEntryMeta.getTerm(), output.toByteArray(), groupConfig); } MemoryLog();  MemoryLog(EventBus eventBus);  MemoryLog(Snapshot snapshot, EntrySequence entrySequence, EventBus eventBus);  }
MemoryLog extends AbstractLog { @Override protected Snapshot generateSnapshot(EntryMeta lastAppliedEntryMeta, Set<NodeEndpoint> groupConfig) { ByteArrayOutputStream output = new ByteArrayOutputStream(); try { stateMachine.generateSnapshot(output); } catch (IOException e) { throw new LogException("failed to generate snapshot", e); } return new MemorySnapshot(lastAppliedEntryMeta.getIndex(), lastAppliedEntryMeta.getTerm(), output.toByteArray(), groupConfig); } MemoryLog();  MemoryLog(EventBus eventBus);  MemoryLog(Snapshot snapshot, EntrySequence entrySequence, EventBus eventBus);   }