From 17155957aa8bdb18a6d721831c9fb8c91ebd7d43 Mon Sep 17 00:00:00 2001 From: David Latorre Date: Wed, 6 Mar 2019 14:57:50 +0000 Subject: [PATCH 1/2] Correct javadoc for PowerOfTwoStrategy. --- .../loadbalancing/strategies/PowerOfTwoStrategy.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java b/components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java index a7de1b5249..d6f7085a56 100644 --- a/components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java +++ b/components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java @@ -32,11 +32,8 @@ /** - * A load balancing strategy that sorts origins according to three functions: - *

- * Whether they have below or above average 5xx errors. - * The number of busy connections. - * Whether they having existing connections available. + * A load balancing strategy that selects two hosts randomly and then chooses the host (of those two) with the least ongoing connections. + * */ public class PowerOfTwoStrategy implements LoadBalancer { private final ActiveOrigins activeOrigins; From d571169043eacd96a81123cdd1eb5105ba8bfd5a Mon Sep 17 00:00:00 2001 From: Mikko Karjalainen Date: Thu, 7 Mar 2019 10:37:14 +0000 Subject: [PATCH 2/2] Update components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java Co-Authored-By: dvlato --- .../client/loadbalancing/strategies/PowerOfTwoStrategy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java b/components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java index d6f7085a56..71a5d41ced 100644 --- a/components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java +++ b/components/client/src/main/java/com/hotels/styx/client/loadbalancing/strategies/PowerOfTwoStrategy.java @@ -32,7 +32,7 @@ /** - * A load balancing strategy that selects two hosts randomly and then chooses the host (of those two) with the least ongoing connections. + * A load balancing strategy that selects two hosts randomly and chooses the one with fewer ongoing connections. * */ public class PowerOfTwoStrategy implements LoadBalancer {