use of org.apache.cassandra.io.sstable.SSTableReader in project eiger by wlloyd.
the class StreamOut method createPendingFiles.
// called prior to sending anything.
private static List<PendingFile> createPendingFiles(Iterable<SSTableReader> sstables, Collection<Range<Token>> ranges, OperationType type) {
List<PendingFile> pending = new ArrayList<PendingFile>();
for (SSTableReader sstable : sstables) {
Descriptor desc = sstable.descriptor;
List<Pair<Long, Long>> sections = sstable.getPositionsForRanges(ranges);
if (sections.isEmpty()) {
// A reference was acquired on the sstable and we won't stream it
sstable.releaseReference();
continue;
}
pending.add(new PendingFile(sstable, desc, SSTable.COMPONENT_DATA, sections, type, sstable.estimatedKeysForRanges(ranges)));
}
logger.info("Stream context metadata {}, {} sstables.", pending, Iterables.size(sstables));
return pending;
}
use of org.apache.cassandra.io.sstable.SSTableReader in project eiger by wlloyd.
the class DataTracker method getRecentBloomFilterFalseRatio.
public double getRecentBloomFilterFalseRatio() {
long falseCount = 0L;
long trueCount = 0L;
for (SSTableReader sstable : getSSTables()) {
falseCount += sstable.getRecentBloomFilterFalsePositiveCount();
trueCount += sstable.getRecentBloomFilterTruePositiveCount();
}
if (falseCount == 0L && trueCount == 0L)
return 0d;
return (double) falseCount / (trueCount + falseCount);
}
use of org.apache.cassandra.io.sstable.SSTableReader in project eiger by wlloyd.
the class DataTracker method getMeanRowSize.
public long getMeanRowSize() {
long sum = 0;
long count = 0;
for (SSTableReader sstable : getSSTables()) {
sum += sstable.getEstimatedRowSize().mean();
count++;
}
return count > 0 ? sum / count : 0;
}
use of org.apache.cassandra.io.sstable.SSTableReader in project eiger by wlloyd.
the class DataTracker method getMeanColumns.
public int getMeanColumns() {
long sum = 0;
int count = 0;
for (SSTableReader sstable : getSSTables()) {
sum += sstable.getEstimatedColumnCount().mean();
count++;
}
return count > 0 ? (int) (sum / count) : 0;
}
use of org.apache.cassandra.io.sstable.SSTableReader in project eiger by wlloyd.
the class DataTracker method unmarkCompacting.
/**
* Removes files from compacting status: this is different from 'markCompacted'
* because it should be run regardless of whether a compaction succeeded.
*/
public void unmarkCompacting(Collection<SSTableReader> unmark) {
if (!cfstore.isValid()) {
// is harmlessly redundant, and if it failed ensures that at least the sstable will get deleted on restart.
for (SSTableReader sstable : unmark) sstable.markCompacted();
}
View currentView, newView;
do {
currentView = view.get();
newView = currentView.unmarkCompacting(unmark);
} while (!view.compareAndSet(currentView, newView));
}
Aggregations