@Test public void testNonVotingOnRecovery() { TEST_LOG.info("testNonVotingOnRecovery starting"); DefaultConfigParamsImpl config = new DefaultConfigParamsImpl(); config.setElectionTimeoutFactor(1); config.setHeartBeatInterval(FiniteDuration.create(1, TimeUnit.MILLISECONDS)); String persistenceId = factory.generateActorId("test-actor-"); InMemoryJournal.addEntry(persistenceId, 1, new SimpleReplicatedLogEntry(0, 1, new ServerConfigurationPayload(Arrays.asList(new ServerInfo(persistenceId, false))))); TestActorRef<MockRaftActor> raftActorRef = factory.createTestActor(MockRaftActor.builder().id(persistenceId) .config(config).props().withDispatcher(Dispatchers.DefaultDispatcherId()), persistenceId); MockRaftActor mockRaftActor = raftActorRef.underlyingActor(); mockRaftActor.waitForInitializeBehaviorComplete(); Uninterruptibles.sleepUninterruptibly(400, TimeUnit.MILLISECONDS); assertEquals("getRaftState", RaftState.Follower, mockRaftActor.getRaftState()); TEST_LOG.info("testNonVotingOnRecovery ending"); }
@VisibleForTesting protected final RaftState getRaftState() { return getCurrentBehavior().state(); }
RaftActor extends AbstractUntypedPersistentActor { @VisibleForTesting protected final RaftState getRaftState() { return getCurrentBehavior().state(); } }
RaftActor extends AbstractUntypedPersistentActor { @VisibleForTesting protected final RaftState getRaftState() { return getCurrentBehavior().state(); } protected  RaftActor(final String id, final Map<String, String> peerAddresses,
         final Optional<ConfigParams> configParams, final short payloadVersion); }
RaftActor extends AbstractUntypedPersistentActor { @VisibleForTesting protected final RaftState getRaftState() { return getCurrentBehavior().state(); } protected  RaftActor(final String id, final Map<String, String> peerAddresses,
         final Optional<ConfigParams> configParams, final short payloadVersion); @Override void preStart(); @Override void postStop(); @Override long snapshotSequenceNr(); ActorSelection getLeader(); final DataPersistenceProvider persistence(); void setPersistence(final DataPersistenceProvider provider); }
RaftActor extends AbstractUntypedPersistentActor { @VisibleForTesting protected final RaftState getRaftState() { return getCurrentBehavior().state(); } protected  RaftActor(final String id, final Map<String, String> peerAddresses,
         final Optional<ConfigParams> configParams, final short payloadVersion); @Override void preStart(); @Override void postStop(); @Override long snapshotSequenceNr(); ActorSelection getLeader(); final DataPersistenceProvider persistence(); void setPersistence(final DataPersistenceProvider provider);  }