本文整理汇总了Java中org.apache.cassandra.db.Keyspace.getColumnFamilyStores方法的典型用法代码示例。如果您正苦于以下问题:Java Keyspace.getColumnFamilyStores方法的具体用法?Java Keyspace.getColumnFamilyStores怎么用?Java Keyspace.getColumnFamilyStores使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.db.Keyspace
的用法示例。
在下文中一共展示了Keyspace.getColumnFamilyStores方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: trueSnapshotsSize
import org.apache.cassandra.db.Keyspace; //导入方法依赖的package包/类
public long trueSnapshotsSize()
{
long total = 0;
for (Keyspace keyspace : Keyspace.all())
{
if (Keyspace.SYSTEM_KS.equals(keyspace.getName()))
continue;
for (ColumnFamilyStore cfStore : keyspace.getColumnFamilyStores())
{
total += cfStore.trueSnapshotsSize();
}
}
return total;
}
示例2: getCompactingAndNonCompactingSSTables
import org.apache.cassandra.db.Keyspace; //导入方法依赖的package包/类
/**
* Returns a Pair of all compacting and non-compacting sstables. Non-compacting sstables will be marked as
* compacting.
*/
private Pair<List<SSTableReader>, Multimap<DataTracker, SSTableReader>> getCompactingAndNonCompactingSSTables()
{
List<SSTableReader> allCompacting = new ArrayList<>();
Multimap<DataTracker, SSTableReader> allNonCompacting = HashMultimap.create();
for (Keyspace ks : Keyspace.all())
{
for (ColumnFamilyStore cfStore: ks.getColumnFamilyStores())
{
Set<SSTableReader> nonCompacting, allSSTables;
do
{
allSSTables = cfStore.getDataTracker().getSSTables();
nonCompacting = Sets.newHashSet(cfStore.getDataTracker().getUncompactingSSTables(allSSTables));
}
while (!(nonCompacting.isEmpty() || cfStore.getDataTracker().markCompacting(nonCompacting)));
allNonCompacting.putAll(cfStore.getDataTracker(), nonCompacting);
allCompacting.addAll(Sets.difference(allSSTables, nonCompacting));
}
}
return Pair.create(allCompacting, allNonCompacting);
}
示例3: getCompactingAndNonCompactingSSTables
import org.apache.cassandra.db.Keyspace; //导入方法依赖的package包/类
/**
* Returns a Pair of all compacting and non-compacting sstables. Non-compacting sstables will be marked as
* compacting.
*/
@SuppressWarnings("resource")
private Pair<List<SSTableReader>, Map<UUID, LifecycleTransaction>> getCompactingAndNonCompactingSSTables()
{
List<SSTableReader> allCompacting = new ArrayList<>();
Map<UUID, LifecycleTransaction> allNonCompacting = new HashMap<>();
for (Keyspace ks : Keyspace.all())
{
for (ColumnFamilyStore cfStore: ks.getColumnFamilyStores())
{
Set<SSTableReader> nonCompacting, allSSTables;
LifecycleTransaction txn = null;
do
{
View view = cfStore.getTracker().getView();
allSSTables = ImmutableSet.copyOf(view.select(SSTableSet.CANONICAL));
nonCompacting = ImmutableSet.copyOf(view.getUncompacting(allSSTables));
}
while (null == (txn = cfStore.getTracker().tryModify(nonCompacting, OperationType.UNKNOWN)));
allNonCompacting.put(cfStore.metadata.cfId, txn);
allCompacting.addAll(Sets.difference(allSSTables, nonCompacting));
}
}
return Pair.create(allCompacting, allNonCompacting);
}
示例4: getLoad
import org.apache.cassandra.db.Keyspace; //导入方法依赖的package包/类
/** raw load value */
public double getLoad()
{
double bytes = 0;
for (String keyspaceName : Schema.instance.getKeyspaces())
{
Keyspace keyspace = Schema.instance.getKeyspaceInstance(keyspaceName);
if (keyspace == null)
continue;
for (ColumnFamilyStore cfs : keyspace.getColumnFamilyStores())
bytes += cfs.getLiveDiskSpaceUsed();
}
return bytes;
}
示例5: getAllSSTables
import org.apache.cassandra.db.Keyspace; //导入方法依赖的package包/类
private List<SSTableReader> getAllSSTables()
{
List<SSTableReader> result = new ArrayList<>();
for (Keyspace ks : Keyspace.all())
{
for (ColumnFamilyStore cfStore: ks.getColumnFamilyStores())
result.addAll(cfStore.getSSTables());
}
return result;
}
示例6: removeExpected
import org.apache.cassandra.db.Keyspace; //导入方法依赖的package包/类
private void removeExpected(Set<Tidy> candidates)
{
final Ref.IdentityCollection expected = new Ref.IdentityCollection(candidates);
for (Keyspace ks : Keyspace.all())
{
for (ColumnFamilyStore cfs : ks.getColumnFamilyStores())
{
View view = cfs.getTracker().getView();
for (SSTableReader reader : view.allKnownSSTables())
reader.addTo(expected);
}
}
}
示例7: getAllSSTables
import org.apache.cassandra.db.Keyspace; //导入方法依赖的package包/类
private List<SSTableReader> getAllSSTables()
{
List<SSTableReader> result = new ArrayList<>();
for (Keyspace ks : Keyspace.all())
{
for (ColumnFamilyStore cfStore: ks.getColumnFamilyStores())
result.addAll(cfStore.getLiveSSTables());
}
return result;
}