本文整理汇总了Java中org.apache.cassandra.io.sstable.SSTableReader.setTrackedBy方法的典型用法代码示例。如果您正苦于以下问题:Java SSTableReader.setTrackedBy方法的具体用法?Java SSTableReader.setTrackedBy怎么用?Java SSTableReader.setTrackedBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.io.sstable.SSTableReader
的用法示例。
在下文中一共展示了SSTableReader.setTrackedBy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replaceReaders
import org.apache.cassandra.io.sstable.SSTableReader; //导入方法依赖的package包/类
/**
* A special kind of replacement for SSTableReaders that were cloned with a new index summary sampling level (see
* SSTableReader.cloneWithNewSummarySamplingLevel and CASSANDRA-5519). This does not mark the old reader
* as compacted.
* @param oldSSTables replaced readers
* @param newSSTables replacement readers
*/
private void replaceReaders(Collection<SSTableReader> oldSSTables, Collection<SSTableReader> newSSTables, boolean notify)
{
View currentView, newView;
do
{
currentView = view.get();
newView = currentView.replace(oldSSTables, newSSTables);
}
while (!view.compareAndSet(currentView, newView));
if (!oldSSTables.isEmpty() && notify)
notifySSTablesChanged(oldSSTables, newSSTables, OperationType.UNKNOWN);
for (SSTableReader sstable : newSSTables)
sstable.setTrackedBy(this);
Refs.release(Refs.selfRefs(oldSSTables));
}
示例2: addNewSSTablesSize
import org.apache.cassandra.io.sstable.SSTableReader; //导入方法依赖的package包/类
private void addNewSSTablesSize(Iterable<SSTableReader> newSSTables)
{
for (SSTableReader sstable : newSSTables)
{
if (logger.isDebugEnabled())
logger.debug(String.format("adding %s to list of files tracked for %s.%s",
sstable.descriptor, cfstore.keyspace.getName(), cfstore.name));
long size = sstable.bytesOnDisk();
StorageMetrics.load.inc(size);
cfstore.metric.liveDiskSpaceUsed.inc(size);
cfstore.metric.totalDiskSpaceUsed.inc(size);
sstable.setTrackedBy(this);
}
}