HADOOP-7183. WritableComparator.get should not cache comparator objects. Contributed by Tom White

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1100056 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Eli Collins 2011-05-06 05:07:22 +00:00
parent ad36a0e6a0
commit a213c5676c
2 changed files with 5 additions and 2 deletions

View File

@ -682,6 +682,9 @@ Release 0.21.1 - Unreleased
HADOOP-7194. Fix resource leak in IOUtils.copyBytes(..).
(Devaraj K via szetszwo)
HADOOP-7183. WritableComparator.get should not cache comparator objects.
(tomwhite via eli)
Release 0.21.0 - 2010-08-13
INCOMPATIBLE CHANGES

View File

@ -53,7 +53,6 @@ WritableComparator get(Class<? extends WritableComparable> c) {
// if not, use the generic one
if (comparator == null) {
comparator = new WritableComparator(c, true);
comparators.put(c, comparator);
}
}
return comparator;
@ -75,7 +74,8 @@ private static void forceInit(Class<?> cls) {
}
/** Register an optimized comparator for a {@link WritableComparable}
* implementation. */
* implementation. Comparators registered with this method must be
* thread-safe. */
public static synchronized void define(Class c,
WritableComparator comparator) {
comparators.put(c, comparator);