Netflix / ocelli

Apache License 2.0
53 stars 28 forks source link

Simplifying `LoadBalancer` interface #14

Closed NiteshKant closed 9 years ago

NiteshKant commented 9 years ago

Currently LoadBalancer has lifecycle and insight related APIs. I think there is value in just have a simple interface that just has a single method (hence lambda friendly) Observable<C> choose() and everything else is an implementation choice.

I also propose a single factory class Ocelli that has static factory methods creating multiple variants of LoadBalancer instances.

elandau commented 9 years ago

I'll need to give this some thought. I'm actually not worried about any of the lifecycle and insight API. I'm more concerned about how this will tie into partitioning.

NiteshKant commented 9 years ago

Does the partition function share state with the parent load balancer instance? If not then, it can be at creation time; something like:

From the current code, it looks like, partition is sharing the Builder state and not the runtime state from the LoadBalancer, so is the partition definition changing at runtime or is it fixed after creation time? If later, then it should be easy to separate, if former, we need to think more :)