@Test public void testSameThreadPoolSize() { segments.put("instanceOne", of()); segments.put("instanceTwo", of(0, 1, 2, 3)); segments.put("instanceThree", of(4)); segments.put("instanceFour", of(5, 6, 7)); segments.put("instanceFive", of(8, 9)); threadPoolSize.put("instanceOne", 5); threadPoolSize.put("instanceTwo", 5); threadPoolSize.put("instanceThree", 5); threadPoolSize.put("instanceFour", 5); threadPoolSize.put("instanceFive", 5); testSubject.balance(eventProcessor).perform(); assertEquals(2, segments.get("instanceOne").size()); assertEquals(2, segments.get("instanceTwo").size()); assertEquals(2, segments.get("instanceThree").size()); assertEquals(2, segments.get("instanceFour").size()); assertEquals(2, segments.get("instanceFive").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);  }