public class LoadBalancer extends Object
Constructor and Description |
---|
LoadBalancer(SearchCluster searchCluster,
boolean roundRobin) |
Modifier and Type | Method and Description |
---|---|
void |
releaseGroup(Group group)
Release an allocation given by
takeGroupForQuery(com.yahoo.search.Query, java.util.Set<java.lang.Integer>) . |
Optional<Group> |
takeGroupForQuery(Query query,
Set<Integer> rejectedGroups)
Select and allocate the search cluster group which is to be used for the provided query.
|
public LoadBalancer(SearchCluster searchCluster, boolean roundRobin)
public Optional<Group> takeGroupForQuery(Query query, Set<Integer> rejectedGroups)
releaseGroup(com.yahoo.search.dispatch.searchcluster.Group)
symmetrically for each taken allocation.query
- the query for which this allocation is maderejectedGroups
- if not null, the load balancer will only return groups with IDs not in the setpublic void releaseGroup(Group group)
takeGroupForQuery(com.yahoo.search.Query, java.util.Set<java.lang.Integer>)
. The release must be done exactly once for each allocation.group
- previously allocated groupCopyright © 2018. All rights reserved.