@Test public void testTwoSegmentForTwoInstances() { segments.put("instanceOne", of(0, 1)); segments.put("instanceTwo", of()); testSubject.balance(eventProcessor).perform(); assertEquals(1, segments.get("instanceOne").size()); assertEquals(1, segments.get("instanceTwo").size()); }
@Override public LoadBalancingOperation balance(TrackingEventProcessor processor) { return new MoveSegmentAlgorithm<>(new Move(processor)).balance(instanceClones(processor)); }
ThreadNumberBalancing implements LoadBalancingStrategy { @Override public LoadBalancingOperation balance(TrackingEventProcessor processor) { return new MoveSegmentAlgorithm<>(new Move(processor)).balance(instanceClones(processor)); } }
ThreadNumberBalancing implements LoadBalancingStrategy { @Override public LoadBalancingOperation balance(TrackingEventProcessor processor) { return new MoveSegmentAlgorithm<>(new Move(processor)).balance(instanceClones(processor)); } ThreadNumberBalancing(InstancesRepo instances, OperationFactory operationFactory); }
ThreadNumberBalancing implements LoadBalancingStrategy { @Override public LoadBalancingOperation balance(TrackingEventProcessor processor) { return new MoveSegmentAlgorithm<>(new Move(processor)).balance(instanceClones(processor)); } ThreadNumberBalancing(InstancesRepo instances, OperationFactory operationFactory); @Override LoadBalancingOperation balance(TrackingEventProcessor processor); }
ThreadNumberBalancing implements LoadBalancingStrategy { @Override public LoadBalancingOperation balance(TrackingEventProcessor processor) { return new MoveSegmentAlgorithm<>(new Move(processor)).balance(instanceClones(processor)); } ThreadNumberBalancing(InstancesRepo instances, OperationFactory operationFactory); @Override LoadBalancingOperation balance(TrackingEventProcessor processor);  }