org.hd.d.pg2k.svrCore.location
Class LoadBalancingUtils.BWOrder
java.lang.Object
org.hd.d.pg2k.svrCore.location.LoadBalancingUtils.BWOrder
- All Implemented Interfaces:
- java.util.Comparator<java.lang.String>
- Enclosing class:
- LoadBalancingUtils
public static final class LoadBalancingUtils.BWOrder
- extends java.lang.Object
- implements java.util.Comparator<java.lang.String>
Our simple sorting comparator for mirrors sorts by bandwidth (or other Long metric) then name.
|
Field Summary |
private java.util.Map<java.lang.String,java.lang.Long> |
mirrorInfo
The map from tag name to bandwidth. |
|
Constructor Summary |
LoadBalancingUtils.BWOrder(java.util.Map<java.lang.String,java.lang.Long> mirrorInfo)
Create an instance with the tag info map behind it. |
|
Method Summary |
int |
compare(java.lang.String s1,
java.lang.String s2)
Sort in order by bandwidth (highest first), then by name to give a total ordering. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
equals |
mirrorInfo
private final java.util.Map<java.lang.String,java.lang.Long> mirrorInfo
- The map from tag name to bandwidth.
LoadBalancingUtils.BWOrder
public LoadBalancingUtils.BWOrder(java.util.Map<java.lang.String,java.lang.Long> mirrorInfo)
- Create an instance with the tag info map behind it.
compare
public final int compare(java.lang.String s1,
java.lang.String s2)
- Sort in order by bandwidth (highest first), then by name to give a total ordering.
- Specified by:
compare in interface java.util.Comparator<java.lang.String>
Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.