当前位置: 首页>>代码示例>>Java>>正文


Java Keyspace.getColumnFamilyStores方法代码示例

本文整理汇总了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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:17,代码来源:StorageService.java

示例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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:26,代码来源:IndexSummaryManager.java

示例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);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:30,代码来源:IndexSummaryManager.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:15,代码来源:StorageService.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:12,代码来源:IndexSummaryManager.java

示例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);
        }
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:14,代码来源:Ref.java

示例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;
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:12,代码来源:IndexSummaryManager.java


注:本文中的org.apache.cassandra.db.Keyspace.getColumnFamilyStores方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。