Reformat.
This commit is contained in:
@@ -100,7 +100,8 @@ public class RoundRobinLoadBalancer implements ReactorServiceInstanceLoadBalance
|
||||
return new EmptyResponse();
|
||||
}
|
||||
|
||||
// Ignore the sign bit, this allows pos to loop sequentially from 0 to Integer.MAX_VALUE
|
||||
// Ignore the sign bit, this allows pos to loop sequentially from 0 to
|
||||
// Integer.MAX_VALUE
|
||||
int pos = this.position.incrementAndGet() & Integer.MAX_VALUE;
|
||||
|
||||
ServiceInstance instance = instances.get(pos % instances.size());
|
||||
|
||||
@@ -73,4 +73,5 @@ class RoundRobinLoadBalancerTests {
|
||||
assertThat(chosen.getInstanceId()).isEqualTo(instanceId + "");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user