X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2FSnapshotManagerTest.java;h=3f96485351c7bca8a11ee3b4664f5d921370ae3f;hb=283929615619b09a664fd46bd13e19cdb163ec4d;hp=efaae7b3bb83fbc7d48d116bcd38cb052b19e61e;hpb=e1eca73a5ae2ffae8dd78c6fe5281cd2f45d5ef3;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java index efaae7b3bb..3f96485351 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java @@ -14,6 +14,8 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyLong; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; @@ -25,7 +27,10 @@ import static org.mockito.Mockito.verify; import akka.actor.ActorRef; import akka.persistence.SnapshotSelectionCriteria; import akka.testkit.TestActorRef; +import java.io.OutputStream; import java.util.Arrays; +import java.util.Optional; +import java.util.function.Consumer; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -33,11 +38,15 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.opendaylight.controller.cluster.DataPersistenceProvider; +import org.opendaylight.controller.cluster.io.FileBackedOutputStream; import org.opendaylight.controller.cluster.raft.SnapshotManager.LastAppliedTermInformationReader; import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshot; import org.opendaylight.controller.cluster.raft.base.messages.SendInstallSnapshot; import org.opendaylight.controller.cluster.raft.base.messages.SnapshotComplete; import org.opendaylight.controller.cluster.raft.behaviors.RaftActorBehavior; +import org.opendaylight.controller.cluster.raft.persisted.ByteState; +import org.opendaylight.controller.cluster.raft.persisted.SimpleReplicatedLogEntry; +import org.opendaylight.controller.cluster.raft.persisted.Snapshot; import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor; import org.slf4j.LoggerFactory; @@ -59,7 +68,7 @@ public class SnapshotManagerTest extends AbstractActorTest { private RaftActorBehavior mockRaftActorBehavior; @Mock - private Runnable mockProcedure; + private Consumer> mockProcedure; @Mock private ElectionTerm mockElectionTerm; @@ -88,13 +97,15 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(5L).when(mockElectionTerm).getCurrentTerm(); doReturn("member5").when(mockElectionTerm).getVotedFor(); + doReturn(new FileBackedOutputStream(10000000, "target")).when(mockRaftActorContext).newFileBackedOutputStream(); + snapshotManager = new SnapshotManager(mockRaftActorContext, LoggerFactory.getLogger(this.getClass())); factory = new TestActorFactory(getSystem()); actorRef = factory.createTestActor(MessageCollectorActor.props(), factory.generateActorId("test-")); doReturn(actorRef).when(mockRaftActorContext).getActor(); - snapshotManager.setCreateSnapshotRunnable(mockProcedure); + snapshotManager.setCreateSnapshotConsumer(mockProcedure); } @After @@ -107,16 +118,19 @@ public class SnapshotManagerTest extends AbstractActorTest { assertEquals(false, snapshotManager.isCapturing()); } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testCaptureToInstall() throws Exception { // Force capturing toInstall = true - snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(1, 0, + snapshotManager.captureToInstall(new SimpleReplicatedLogEntry(0, 1, new MockRaftActorContext.MockPayload()), 0, "follower-1"); assertEquals(true, snapshotManager.isCapturing()); - verify(mockProcedure).run(); + ArgumentCaptor outputStream = ArgumentCaptor.forClass(Optional.class); + verify(mockProcedure).accept(outputStream.capture()); + assertEquals("isPresent", true, outputStream.getValue().isPresent()); CaptureSnapshot captureSnapshot = snapshotManager.getCaptureSnapshot(); @@ -134,16 +148,19 @@ public class SnapshotManagerTest extends AbstractActorTest { actorRef.underlyingActor().clear(); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Test public void testCapture() throws Exception { - boolean capture = snapshotManager.capture(new MockRaftActorContext.MockReplicatedLogEntry(1,9, + boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, new MockRaftActorContext.MockPayload()), 9); assertTrue(capture); assertEquals(true, snapshotManager.isCapturing()); - verify(mockProcedure).run(); + ArgumentCaptor outputStream = ArgumentCaptor.forClass(Optional.class); + verify(mockProcedure).accept(outputStream.capture()); + assertEquals("isPresent", false, outputStream.getValue().isPresent()); CaptureSnapshot captureSnapshot = snapshotManager.getCaptureSnapshot(); @@ -163,6 +180,7 @@ public class SnapshotManagerTest extends AbstractActorTest { } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testCaptureWithNullLastLogEntry() throws Exception { boolean capture = snapshotManager.capture(null, 1); @@ -171,7 +189,9 @@ public class SnapshotManagerTest extends AbstractActorTest { assertEquals(true, snapshotManager.isCapturing()); - verify(mockProcedure).run(); + ArgumentCaptor outputStream = ArgumentCaptor.forClass(Optional.class); + verify(mockProcedure).accept(outputStream.capture()); + assertEquals("isPresent", false, outputStream.getValue().isPresent()); CaptureSnapshot captureSnapshot = snapshotManager.getCaptureSnapshot(); @@ -192,40 +212,41 @@ public class SnapshotManagerTest extends AbstractActorTest { @Test public void testCaptureWithCreateProcedureError() throws Exception { - doThrow(new RuntimeException("mock")).when(mockProcedure).run(); + doThrow(new RuntimeException("mock")).when(mockProcedure).accept(anyObject()); - boolean capture = snapshotManager.capture(new MockRaftActorContext.MockReplicatedLogEntry(1,9, + boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, new MockRaftActorContext.MockPayload()), 9); assertFalse(capture); assertEquals(false, snapshotManager.isCapturing()); - verify(mockProcedure).run(); + verify(mockProcedure).accept(anyObject()); } + @SuppressWarnings("unchecked") @Test public void testIllegalCapture() throws Exception { - boolean capture = snapshotManager.capture(new MockRaftActorContext.MockReplicatedLogEntry(1,9, + boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, new MockRaftActorContext.MockPayload()), 9); assertTrue(capture); - verify(mockProcedure).run(); + verify(mockProcedure).accept(anyObject()); reset(mockProcedure); // This will not cause snapshot capture to start again - capture = snapshotManager.capture(new MockRaftActorContext.MockReplicatedLogEntry(1,9, + capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, new MockRaftActorContext.MockPayload()), 9); assertFalse(capture); - verify(mockProcedure, never()).run(); + verify(mockProcedure, never()).accept(anyObject()); } @Test - public void testPersistWhenReplicatedToAllIndexMinusOne() { + public void testPersistWhenReplicatedToAllIndexMinusOne() throws Exception { doReturn(7L).when(mockReplicatedLog).getSnapshotIndex(); doReturn(1L).when(mockReplicatedLog).getSnapshotTerm(); @@ -233,11 +254,10 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(8L).when(mockRaftActorContext).getLastApplied(); - MockRaftActorContext.MockReplicatedLogEntry lastLogEntry = new MockRaftActorContext.MockReplicatedLogEntry( - 3L, 9L, new MockRaftActorContext.MockPayload()); + ReplicatedLogEntry lastLogEntry = new SimpleReplicatedLogEntry(9L, 3L, new MockRaftActorContext.MockPayload()); - MockRaftActorContext.MockReplicatedLogEntry lastAppliedEntry = new MockRaftActorContext.MockReplicatedLogEntry( - 2L, 8L, new MockRaftActorContext.MockPayload()); + ReplicatedLogEntry lastAppliedEntry = new SimpleReplicatedLogEntry( + 8L, 2L, new MockRaftActorContext.MockPayload()); doReturn(lastAppliedEntry).when(mockReplicatedLog).get(8L); doReturn(Arrays.asList(lastLogEntry)).when(mockReplicatedLog).getFrom(9L); @@ -245,8 +265,8 @@ public class SnapshotManagerTest extends AbstractActorTest { // when replicatedToAllIndex = -1 snapshotManager.capture(lastLogEntry, -1); - byte[] bytes = new byte[] {1,2,3,4,5,6,7,8,9,10}; - snapshotManager.persist(bytes, Runtime.getRuntime().totalMemory()); + ByteState snapshotState = ByteState.of(new byte[] {1,2,3,4,5,6,7,8,9,10}); + snapshotManager.persist(snapshotState, Optional.empty(), Runtime.getRuntime().totalMemory()); ArgumentCaptor snapshotArgumentCaptor = ArgumentCaptor.forClass(Snapshot.class); verify(mockDataPersistenceProvider).saveSnapshot(snapshotArgumentCaptor.capture()); @@ -257,7 +277,7 @@ public class SnapshotManagerTest extends AbstractActorTest { assertEquals("getLastIndex", 9L, snapshot.getLastIndex()); assertEquals("getLastAppliedTerm", 2L, snapshot.getLastAppliedTerm()); assertEquals("getLastAppliedIndex", 8L, snapshot.getLastAppliedIndex()); - assertArrayEquals("getState", bytes, snapshot.getState()); + assertEquals("getState", snapshotState, snapshot.getState()); assertEquals("getUnAppliedEntries", Arrays.asList(lastLogEntry), snapshot.getUnAppliedEntries()); assertEquals("electionTerm", mockElectionTerm.getCurrentTerm(), snapshot.getElectionTerm()); assertEquals("electionVotedFor", mockElectionTerm.getVotedFor(), snapshot.getElectionVotedFor()); @@ -266,7 +286,7 @@ public class SnapshotManagerTest extends AbstractActorTest { } @Test - public void testPersistWhenReplicatedToAllIndexNotMinus() { + public void testPersistWhenReplicatedToAllIndexNotMinus() throws Exception { doReturn(45L).when(mockReplicatedLog).getSnapshotIndex(); doReturn(6L).when(mockReplicatedLog).getSnapshotTerm(); ReplicatedLogEntry replicatedLogEntry = mock(ReplicatedLogEntry.class); @@ -275,11 +295,10 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(9L).when(replicatedLogEntry).getIndex(); // when replicatedToAllIndex != -1 - snapshotManager.capture(new MockRaftActorContext.MockReplicatedLogEntry(6,9, - new MockRaftActorContext.MockPayload()), 9); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), 9); - byte[] bytes = new byte[] {1,2,3,4,5,6,7,8,9,10}; - snapshotManager.persist(bytes, Runtime.getRuntime().totalMemory()); + ByteState snapshotState = ByteState.of(new byte[] {1,2,3,4,5,6,7,8,9,10}); + snapshotManager.persist(snapshotState, Optional.empty(), Runtime.getRuntime().totalMemory()); ArgumentCaptor snapshotArgumentCaptor = ArgumentCaptor.forClass(Snapshot.class); verify(mockDataPersistenceProvider).saveSnapshot(snapshotArgumentCaptor.capture()); @@ -290,7 +309,7 @@ public class SnapshotManagerTest extends AbstractActorTest { assertEquals("getLastIndex", 9L, snapshot.getLastIndex()); assertEquals("getLastAppliedTerm", 6L, snapshot.getLastAppliedTerm()); assertEquals("getLastAppliedIndex", 9L, snapshot.getLastAppliedIndex()); - assertArrayEquals("getState", bytes, snapshot.getState()); + assertEquals("getState", snapshotState, snapshot.getState()); assertEquals("getUnAppliedEntries size", 0, snapshot.getUnAppliedEntries().size()); verify(mockReplicatedLog).snapshotPreCommit(9L, 6L); @@ -303,10 +322,9 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(Integer.MAX_VALUE).when(mockReplicatedLog).dataSize(); // when replicatedToAllIndex = -1 - snapshotManager.capture(new MockRaftActorContext.MockReplicatedLogEntry(6,9, - new MockRaftActorContext.MockPayload()), -1); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1); - snapshotManager.persist(new byte[]{}, Runtime.getRuntime().totalMemory()); + snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory()); verify(mockDataPersistenceProvider).saveSnapshot(any(Snapshot.class)); @@ -329,10 +347,10 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(6L).when(replicatedLogEntry).getTerm(); doReturn(replicatedToAllIndex).when(replicatedLogEntry).getIndex(); - snapshotManager.capture(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), replicatedToAllIndex); - snapshotManager.persist(new byte[]{}, 2000000L); + snapshotManager.persist(ByteState.empty(), Optional.empty(), 2000000L); verify(mockDataPersistenceProvider).saveSnapshot(any(Snapshot.class)); @@ -341,19 +359,29 @@ public class SnapshotManagerTest extends AbstractActorTest { verify(mockRaftActorBehavior).setReplicatedToAllIndex(replicatedToAllIndex); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Test - public void testPersistSendInstallSnapshot() { + public void testPersistSendInstallSnapshot() throws Exception { doReturn(Integer.MAX_VALUE).when(mockReplicatedLog).dataSize(); + doNothing().when(mockProcedure).accept(anyObject()); // when replicatedToAllIndex = -1 - boolean capture = snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, + boolean capture = snapshotManager.captureToInstall(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1, "follower-1"); assertTrue(capture); - byte[] bytes = new byte[] {1,2,3,4,5,6,7,8,9,10}; + ByteState snapshotState = ByteState.of(new byte[] {1,2,3,4,5,6,7,8,9,10}); + + ArgumentCaptor installSnapshotStreamCapture = ArgumentCaptor.forClass(Optional.class); + verify(mockProcedure).accept(installSnapshotStreamCapture.capture()); + + Optional installSnapshotStream = installSnapshotStreamCapture.getValue(); + assertEquals("isPresent", true, installSnapshotStream.isPresent()); - snapshotManager.persist(bytes, Runtime.getRuntime().totalMemory()); + installSnapshotStream.get().write(snapshotState.getBytes()); + + snapshotManager.persist(snapshotState, installSnapshotStream, Runtime.getRuntime().totalMemory()); assertEquals(true, snapshotManager.isCapturing()); @@ -368,12 +396,13 @@ public class SnapshotManagerTest extends AbstractActorTest { SendInstallSnapshot sendInstallSnapshot = sendInstallSnapshotArgumentCaptor.getValue(); - assertTrue(Arrays.equals(bytes, sendInstallSnapshot.getSnapshot().getState())); + assertEquals("state", snapshotState, sendInstallSnapshot.getSnapshot().getState()); + assertArrayEquals("state", snapshotState.getBytes(), sendInstallSnapshot.getSnapshotBytes().read()); } @Test public void testCallingPersistWithoutCaptureWillDoNothing() { - snapshotManager.persist(new byte[]{}, Runtime.getRuntime().totalMemory()); + snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory()); verify(mockDataPersistenceProvider, never()).saveSnapshot(any(Snapshot.class)); @@ -387,18 +416,15 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(Integer.MAX_VALUE).when(mockReplicatedLog).dataSize(); // when replicatedToAllIndex = -1 - snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, - new MockRaftActorContext.MockPayload()), -1, "follower-1"); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1); - snapshotManager.persist(new byte[]{}, Runtime.getRuntime().totalMemory()); + snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory()); - snapshotManager.persist(new byte[]{}, Runtime.getRuntime().totalMemory()); + snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory()); verify(mockDataPersistenceProvider).saveSnapshot(any(Snapshot.class)); verify(mockReplicatedLog).snapshotPreCommit(9L, 6L); - - verify(mockRaftActorBehavior).handleMessage(any(ActorRef.class), any(SendInstallSnapshot.class)); } @Test @@ -406,10 +432,9 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(50L).when(mockDataPersistenceProvider).getLastSequenceNumber(); // when replicatedToAllIndex = -1 - snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, - new MockRaftActorContext.MockPayload()), -1, "follower-1"); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1); - snapshotManager.persist(new byte[]{}, Runtime.getRuntime().totalMemory()); + snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory()); assertEquals(true, snapshotManager.isCapturing()); @@ -435,8 +460,7 @@ public class SnapshotManagerTest extends AbstractActorTest { @Test public void testCommitBeforePersist() { // when replicatedToAllIndex = -1 - snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, - new MockRaftActorContext.MockPayload()), -1, "follower-1"); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1); snapshotManager.commit(100L, 0); @@ -465,10 +489,9 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(50L).when(mockDataPersistenceProvider).getLastSequenceNumber(); // when replicatedToAllIndex = -1 - snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, - new MockRaftActorContext.MockPayload()), -1, "follower-1"); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1); - snapshotManager.persist(new byte[]{}, Runtime.getRuntime().totalMemory()); + snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory()); snapshotManager.commit(100L, 0); @@ -484,10 +507,9 @@ public class SnapshotManagerTest extends AbstractActorTest { @Test public void testRollback() { // when replicatedToAllIndex = -1 - snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, - new MockRaftActorContext.MockPayload()), -1, "follower-1"); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1); - snapshotManager.persist(new byte[]{}, Runtime.getRuntime().totalMemory()); + snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory()); snapshotManager.rollback(); @@ -500,8 +522,7 @@ public class SnapshotManagerTest extends AbstractActorTest { @Test public void testRollbackBeforePersist() { // when replicatedToAllIndex = -1 - snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, - new MockRaftActorContext.MockPayload()), -1, "follower-1"); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1); snapshotManager.rollback(); @@ -518,10 +539,9 @@ public class SnapshotManagerTest extends AbstractActorTest { @Test public void testCallingRollbackMultipleTimesCausesNoHarm() { // when replicatedToAllIndex = -1 - snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(6, 9, - new MockRaftActorContext.MockPayload()), -1, "follower-1"); + snapshotManager.capture(new SimpleReplicatedLogEntry(9, 6, new MockRaftActorContext.MockPayload()), -1); - snapshotManager.persist(new byte[]{}, Runtime.getRuntime().totalMemory()); + snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory()); snapshotManager.rollback(); @@ -602,7 +622,7 @@ public class SnapshotManagerTest extends AbstractActorTest { @Test public void testTrimLogAfterCapture() { - boolean capture = snapshotManager.capture(new MockRaftActorContext.MockReplicatedLogEntry(1,9, + boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, new MockRaftActorContext.MockPayload()), 9); assertTrue(capture); @@ -624,8 +644,8 @@ public class SnapshotManagerTest extends AbstractActorTest { @Test public void testTrimLogAfterCaptureToInstall() { - boolean capture = snapshotManager.captureToInstall(new MockRaftActorContext.MockReplicatedLogEntry(1,9, - new MockRaftActorContext.MockPayload()), 9, "follower-1"); + boolean capture = snapshotManager.capture(new SimpleReplicatedLogEntry(9, 1, + new MockRaftActorContext.MockPayload()), 9); assertTrue(capture); @@ -652,7 +672,7 @@ public class SnapshotManagerTest extends AbstractActorTest { doReturn(4L).when(mockReplicatedLog).getSnapshotTerm(); doReturn(7L).when(mockReplicatedLog).getSnapshotIndex(); - ReplicatedLogEntry lastLogEntry = new MockRaftActorContext.MockReplicatedLogEntry(6L, 9L, + ReplicatedLogEntry lastLogEntry = new SimpleReplicatedLogEntry(9L, 6L, new MockRaftActorContext.MockPayload()); // No followers and valid lastLogEntry @@ -668,7 +688,7 @@ public class SnapshotManagerTest extends AbstractActorTest { assertEquals("getIndex", -1L, reader.getIndex()); // Followers and valid originalIndex entry - doReturn(new MockRaftActorContext.MockReplicatedLogEntry(5L, 8L, + doReturn(new SimpleReplicatedLogEntry(8L, 5L, new MockRaftActorContext.MockPayload())).when(mockReplicatedLog).get(8L); reader.init(mockReplicatedLog, 8L, lastLogEntry, true);