restore server selector behaviour

This commit is contained in:
fjy 2013-05-22 23:53:31 -07:00
parent 3299900690
commit 1537bcf55a
1 changed files with 6 additions and 1 deletions

View File

@ -83,7 +83,12 @@ public class ServerSelector
public QueryableDruidServer pick()
{
synchronized (this) {
return Collections.min(servers, comparator);
final int size = servers.size();
switch (size) {
case 0: return null;
case 1: return servers.iterator().next();
default: return Collections.min(servers, comparator);
}
}
}
}