netflix.ocelli.LoadBalancerBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ocelli-core Show documentation
Show all versions of ocelli-core Show documentation
ocelli-core developed by Netflix
package netflix.ocelli;
import netflix.ocelli.selectors.ClientsAndWeights;
import rx.Observable;
import rx.functions.Func1;
public interface LoadBalancerBuilder {
/**
* Arbitrary name used in debugging
* @param name
*/
LoadBalancerBuilder withName(String name);
/**
* Strategy used to determine the delay time in msec based on the quarantine
* count. The count is incremented by one for each failure detections and reset
* once the host is back to normal.
*/
LoadBalancerBuilder withQuarantineStrategy(Func1 quaratineDelayStrategy);
/**
* Strategy used to determine how many hosts should be active.
* This strategy is invoked whenever a host is added or removed from the pool
*/
LoadBalancerBuilder withActiveClientCountStrategy(Func1 activeClientCountStrategy);
/**
* Source for host membership events
*/
LoadBalancerBuilder withMembershipSource(Observable> hostSource);
/**
* Strategy use to calculate weights for active clients
*/
LoadBalancerBuilder withWeightingStrategy(WeightingStrategy algorithm);
/**
* Strategy used to select hosts from the calculated weights.
* @param selectionStrategy
*/
LoadBalancerBuilder withSelectionStrategy(Func1, Observable> selectionStrategy);
/**
* The failure detector returns an Observable that will emit a Throwable for each
* failure of the client. The load balancer will quaratine the client in response.
* @param failureDetector
*/
LoadBalancerBuilder withFailureDetector(FailureDetectorFactory failureDetector);
/**
* The connector can be used to prime a client prior to activating it in the connection
* pool.
* @param clientConnector
*/
LoadBalancerBuilder withClientConnector(ClientConnector clientConnector);
/**
* Partition the load balancer using the provided function
*
* @param partitioner
* @return
*/
PartitionedLoadBalancerBuilder withPartitioner(Func1> partitioner);
LoadBalancer build();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy