@Test public void testDelayedEntityOwnerSelectionWhenMaxPeerRequestsReceived() { testLog.info("testDelayedEntityOwnerSelectionWhenMaxPeerRequestsReceived starting"); ShardTestKit kit = new ShardTestKit(getSystem()); EntityOwnerSelectionStrategyConfig.Builder builder = EntityOwnerSelectionStrategyConfig.newBuilder() .addStrategy(ENTITY_TYPE, LastCandidateSelectionStrategy.class, 500); ShardIdentifier leaderId = newShardId(LOCAL_MEMBER_NAME); ShardIdentifier peerId = newShardId(PEER_MEMBER_1_NAME); TestActorRef<TestEntityOwnershipShard> peer = actorFactory.createTestActor(TestEntityOwnershipShard.props( newShardBuilder(peerId, peerMap(leaderId.toString()), PEER_MEMBER_1_NAME)), peerId.toString()); peer.underlyingActor().startDroppingMessagesOfType(ElectionTimeout.class); TestActorRef<EntityOwnershipShard> leader = actorFactory.createTestActor( newShardProps(leaderId, peerMap(peerId.toString()), LOCAL_MEMBER_NAME, builder.build()), leaderId.toString()); ShardTestKit.waitUntilLeader(leader); DOMEntity entity = new DOMEntity(ENTITY_TYPE, ENTITY_ID1); peer.tell(new RegisterCandidateLocal(entity), kit.getRef()); kit.expectMsgClass(SuccessReply.class); leader.tell(new RegisterCandidateLocal(entity), kit.getRef()); kit.expectMsgClass(SuccessReply.class); verifyCommittedEntityCandidate(leader, entity.getType(), entity.getIdentifier(), PEER_MEMBER_1_NAME); verifyCommittedEntityCandidate(leader, entity.getType(), entity.getIdentifier(), LOCAL_MEMBER_NAME); verifyOwner(leader, entity.getType(), entity.getIdentifier(), LOCAL_MEMBER_NAME); testLog.info("testDelayedEntityOwnerSelectionWhenMaxPeerRequestsReceived ending"); }
public static Builder newBuilder() { return new Builder(); }
EntityOwnershipShard extends Shard { public static Builder newBuilder() { return new Builder(); } }
EntityOwnershipShard extends Shard { public static Builder newBuilder() { return new Builder(); } protected  EntityOwnershipShard(final Builder builder); }
EntityOwnershipShard extends Shard { public static Builder newBuilder() { return new Builder(); } protected  EntityOwnershipShard(final Builder builder); @Override void handleNonRaftCommand(final Object message); static Builder newBuilder(); }
EntityOwnershipShard extends Shard { public static Builder newBuilder() { return new Builder(); } protected  EntityOwnershipShard(final Builder builder); @Override void handleNonRaftCommand(final Object message); static Builder newBuilder();  }