本文整理汇总了Java中org.apache.cassandra.db.ColumnFamilyStore.markReferenced方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnFamilyStore.markReferenced方法的具体用法?Java ColumnFamilyStore.markReferenced怎么用?Java ColumnFamilyStore.markReferenced使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.db.ColumnFamilyStore
的用法示例。
在下文中一共展示了ColumnFamilyStore.markReferenced方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTransferRanges
import org.apache.cassandra.db.ColumnFamilyStore; //导入方法依赖的package包/类
/**
* Set up transfer for specific keyspace/ranges/CFs
*
* @param keyspace Transfer keyspace
* @param ranges Transfer ranges
* @param columnFamilies Transfer ColumnFamilies
*/
public void addTransferRanges(String keyspace, Collection<Range<Token>> ranges, Collection<String> columnFamilies, boolean flushTables)
{
Collection<ColumnFamilyStore> stores = new HashSet<>();
// if columnfamilies are not specified, we add all cf under the keyspace
if (columnFamilies.isEmpty())
{
stores.addAll(Keyspace.open(keyspace).getColumnFamilyStores());
}
else
{
for (String cf : columnFamilies)
stores.add(Keyspace.open(keyspace).getColumnFamilyStore(cf));
}
if (flushTables)
flushSSTables(stores);
List<Range<Token>> normalizedRanges = Range.normalize(ranges);
List<SSTableReader> sstables = Lists.newLinkedList();
for (ColumnFamilyStore cfStore : stores)
{
List<AbstractBounds<RowPosition>> rowBoundsList = Lists.newLinkedList();
for (Range<Token> range : normalizedRanges)
rowBoundsList.add(range.toRowBounds());
ColumnFamilyStore.ViewFragment view = cfStore.markReferenced(rowBoundsList);
sstables.addAll(view.sstables);
}
addTransferFiles(normalizedRanges, sstables);
}
示例2: getSSTableScope
import org.apache.cassandra.db.ColumnFamilyStore; //导入方法依赖的package包/类
private static Set<SSTableReader> getSSTableScope(ColumnFamilyStore store, ExtendedFilter filter)
{
ColumnFamilyStore.ViewFragment scope = store.markReferenced(filter.dataRange.keyRange());
return scope == null ? Collections.<SSTableReader>emptySet() : new HashSet<>(scope.sstables);
}