revert last commit

This commit is contained in:
Fangjin Yang 2012-12-11 17:20:23 -08:00
parent 143de953fc
commit 127b632421
1 changed files with 4 additions and 4 deletions

View File

@ -105,8 +105,8 @@ public class DruidMasterBalancer implements DruidMasterHelper
continue;
}
MinMaxPriorityQueue<ServerHolder> serversByPercentUsed = MinMaxPriorityQueue.orderedBy(percentUsedComparator)
.create(entry.getValue());
TreeSet<ServerHolder> serversByPercentUsed = Sets.newTreeSet(percentUsedComparator);
serversByPercentUsed.addAll(entry.getValue());
if (serversByPercentUsed.size() <= 1) {
log.info(
@ -116,8 +116,8 @@ public class DruidMasterBalancer implements DruidMasterHelper
continue;
}
ServerHolder highestPercentUsedServer = serversByPercentUsed.peekFirst();
ServerHolder lowestPercentUsedServer = serversByPercentUsed.peekLast();
ServerHolder highestPercentUsedServer = serversByPercentUsed.first();
ServerHolder lowestPercentUsedServer = serversByPercentUsed.last();
analyzer.init(highestPercentUsedServer, lowestPercentUsedServer);