Author: jbellis Date: Mon Aug 22 21:07:34 2011 New Revision: 1160436 URL: http://svn.apache.org/viewvc?rev=1160436&view=rev Log: avoid retaining references to dropped CFS objects in CompactionManager.estimatedCompactions patch by Dan LaRocque; reviewed by jbellis for CASSANDRA-2708
Modified: cassandra/branches/cassandra-0.7/CHANGES.txt cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java Modified: cassandra/branches/cassandra-0.7/CHANGES.txt URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1160436&r1=1160435&r2=1160436&view=diff ============================================================================== --- cassandra/branches/cassandra-0.7/CHANGES.txt (original) +++ cassandra/branches/cassandra-0.7/CHANGES.txt Mon Aug 22 21:07:34 2011 @@ -5,6 +5,8 @@ resultset expansion case (CASSANDRA-2964) * (Hadoop) fail jobs when Cassandra node has failed but TaskTracker has not (CASSANDRA-2388) + * avoid retaining references to dropped CFS objects in + CompactionManager.estimatedCompactions (CASSANDRA-2708) 0.7.8 Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java?rev=1160436&r1=1160435&r2=1160436&view=diff ============================================================================== --- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java (original) +++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/CompactionManager.java Mon Aug 22 21:07:34 2011 @@ -33,6 +33,7 @@ import java.util.concurrent.locks.Reentr import javax.management.MBeanServer; import javax.management.ObjectName; +import com.google.common.collect.MapMaker; import org.apache.commons.collections.PredicateUtils; import org.apache.commons.collections.iterators.FilterIterator; import org.apache.commons.lang.StringUtils; @@ -76,7 +77,7 @@ public class CompactionManager implement } private CompactionExecutor executor = new CompactionExecutor(); - private Map<ColumnFamilyStore, Integer> estimatedCompactions = new NonBlockingHashMap<ColumnFamilyStore, Integer>(); + private Map<ColumnFamilyStore, Integer> estimatedCompactions = new MapMaker().concurrencyLevel(1).weakKeys().makeMap(); public Lock getCompactionLock() {