-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load Balancing Group routing object #429
Conversation
components/proxy/src/main/java/com/hotels/styx/routing/RoutingObjectAdapter.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/handlers/HostProxy.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/handlers/HostProxy.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/handlers/HostProxy.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/handlers/HostProxy.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/handlers/HostProxy.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/handlers/LoadBalancingGroup.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/startup/StyxServerComponents.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you may need to rebase from master
. I will continue reviewing after.
* | ||
* @return a collection of all entries. | ||
*/ | ||
Collection<Map.Entry<String, T>> entrySet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider using com.hotels.styx.common.Pair
instead of Map.Entry
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly. Can you think of any pros/cons using Pair
vs Map.Entry
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map.Entry
does have a method setValue(V value)
for mutating it (or throwing UnsupportedOperationException
), which could give the illusion of mutability, however most Java programmers will be aware of the awkward way that the JCF handles immutable classes.
Otherwise, it doesn't really make a difference, so if Map.Entry
is more convenient otherwise, I think we can put up with it.
components/common/src/main/java/com/hotels/styx/api/ResponseEventListener.java
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/RoutingObjectAdapter.java
Outdated
Show resolved
Hide resolved
components/proxy/src/main/java/com/hotels/styx/routing/handlers/HostProxy.java
Outdated
Show resolved
Hide resolved
04189e5
to
3040730
Compare
components/proxy/src/main/kotlin/com/hotels/styx/routing/RoutingObjectRecord.kt
Outdated
Show resolved
Hide resolved
components/proxy/src/main/kotlin/com/hotels/styx/routing/db/StyxObjectStore.kt
Outdated
Show resolved
Hide resolved
components/proxy/src/main/kotlin/com/hotels/styx/routing/db/StyxObjectStore.kt
Outdated
Show resolved
Hide resolved
components/proxy/src/main/kotlin/com/hotels/styx/routing/handlers/LoadBalancingGroup.kt
Outdated
Show resolved
Hide resolved
components/proxy/src/main/kotlin/com/hotels/styx/routing/handlers/LoadBalancingGroup.kt
Outdated
Show resolved
Hide resolved
components/proxy/src/test/kotlin/com/hotels/styx/routing/handlers/LoadBalancingGroupTest.kt
Outdated
Show resolved
Hide resolved
components/proxy/src/test/kotlin/com/hotels/styx/routing/handlers/LoadBalancingGroupTest.kt
Outdated
Show resolved
Hide resolved
components/proxy/src/test/kotlin/com/hotels/styx/routing/handlers/LoadBalancingGroupTest.kt
Outdated
Show resolved
Hide resolved
system-tests/ft-suite/src/test/kotlin/com/hotels/styx/routing/LoadBalancingGroupSpec.kt
Outdated
Show resolved
Hide resolved
system-tests/ft-suite/src/test/kotlin/com/hotels/styx/routing/LoadBalancingGroupSpec.kt
Outdated
Show resolved
Hide resolved
import java.nio.charset.StandardCharsets.UTF_8 | ||
import java.util.concurrent.CompletableFuture | ||
|
||
fun routingObjectDef(text: String) = YamlConfig(text).`as`((RoutingObjectDefinition::class.java)) | ||
|
||
data class RoutingContext( | ||
internal data class RoutingObjectFactoryContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably not too clear from its usage (import com.hotels.styx.routing.RoutingObjectFactoryContext, etc.) that this is a test class with default values. Maybe we could choose a different name,
Add RoutingObjectAdapter for providing load balancing metric. Add `entrySet` method to ObjectStore. Add `whenFinished` action to ResponseEventListener. Add functional test suite for LoadBalancingGroup. LoadBalancingGroup: Add functional tests for sticky sessions and origins restriction cookie.
Rename HttpHandlerFactory class to RoutingObjectFactory. Kotlin: RoutingObjectFactoryContext. Rename to Builtins.
a3faffb
to
6eb8d08
Compare
* Add LoadBalancingGroup routing object. * Add RoutingObjectDecorator to provide a load balancing metric. * Add `entrySet` method to ObjectStore. * Add `whenFinished` action to ResponseEventListener. * Rename HttpHandlerFactory class to RoutingObjectFactory. * Remove safe calls from Kotlin tests.
Adds a
LoadBalancingGroup
routing object that balances load between other routing objects. Specifically it can load balance betweenHostProxy
objects, and can be used withPathPrefixRouter
to perform styx application routing. Currently, onlyPow2
load balancing algorithm is supported.