Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
This commit is contained in:
Marcus Eriksson 2014-05-19 14:32:54 +02:00
commit 518c3cf616
3 changed files with 13 additions and 3 deletions

View File

@ -38,6 +38,7 @@ Merged from 2.0:
* reduce garbage on codec flag deserialization (CASSANDRA-7244)
* Fix duplicated error messages on directory creation error at startup (CASSANDRA-5818)
* Proper null handle for IF with map element access (CASSANDRA-7155)
* Improve compaction visibility (CASSANDRA-7242)
Merged from 1.2:
* Add Cloudstack snitch (CASSANDRA-7147)
* Update system.peers correctly when relocating tokens (CASSANDRA-7126)

View File

@ -58,6 +58,7 @@ import org.slf4j.LoggerFactory;
import org.apache.cassandra.cache.AutoSavingCache;
import org.apache.cassandra.concurrent.DebuggableThreadPoolExecutor;
import org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor;
import org.apache.cassandra.concurrent.NamedThreadFactory;
import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.DatabaseDescriptor;
@ -1117,12 +1118,11 @@ public class CompactionManager implements CompactionManagerMBean
return CompactionMetrics.getCompactions().size();
}
private static class CompactionExecutor extends ThreadPoolExecutor
private static class CompactionExecutor extends JMXEnabledThreadPoolExecutor
{
protected CompactionExecutor(int minThreads, int maxThreads, String name, BlockingQueue<Runnable> queue)
{
super(minThreads, maxThreads, 60, TimeUnit.SECONDS, queue, new NamedThreadFactory(name, Thread.MIN_PRIORITY));
allowCoreThreadTimeOut(true);
super(minThreads, maxThreads, 60, TimeUnit.SECONDS, queue, new NamedThreadFactory(name, Thread.MIN_PRIORITY), "internal");
}
private CompactionExecutor(int threadCount, String name)

View File

@ -63,6 +63,8 @@ public class ColumnFamilyMetrics
public final LatencyMetrics writeLatency;
/** Estimated number of tasks pending for this column family */
public final Counter pendingFlushes;
/** Estimate of number of pending compactios for this CF */
public final Gauge<Integer> pendingCompactions;
/** Number of SSTables on disk for this CF */
public final Gauge<Integer> liveSSTableCount;
/** Disk space used by SSTables belonging to this CF */
@ -232,6 +234,13 @@ public class ColumnFamilyMetrics
readLatency = new LatencyMetrics(factory, "Read");
writeLatency = new LatencyMetrics(factory, "Write");
pendingFlushes = Metrics.newCounter(factory.createMetricName("PendingFlushes"));
pendingCompactions = Metrics.newGauge(factory.createMetricName("PendingCompactions"), new Gauge<Integer>()
{
public Integer value()
{
return cfs.getCompactionStrategy().getEstimatedRemainingTasks();
}
});
liveSSTableCount = Metrics.newGauge(factory.createMetricName("LiveSSTableCount"), new Gauge<Integer>()
{
public Integer value()