Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

presize collection

  • Loading branch information...
commit 782536176e24fdb34635e024b48085343dada337 1 parent dbc8bd8
@mebigfatguy mebigfatguy authored
View
2  src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
@@ -229,7 +229,7 @@ private void updateScores() // this is expensive
}
double maxLatency = 1;
long maxPenalty = 1;
- HashMap<InetAddress, Long> penalties = new HashMap<InetAddress, Long>();
+ HashMap<InetAddress, Long> penalties = new HashMap<InetAddress, Long>(samples.size());
// We're going to weight the latency and time since last reply for each host against the worst one we see, to arrive at sort of a 'badness percentage' for both of them.
// first, find the worst for each.
for (Map.Entry<InetAddress, ExponentiallyDecayingSample> entry : samples.entrySet())
Please sign in to comment.
Something went wrong with that request. Please try again.