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


Java CompactionInfo类代码示例

本文整理汇总了Java中org.apache.cassandra.db.compaction.CompactionInfo的典型用法代码示例。如果您正苦于以下问题:Java CompactionInfo类的具体用法?Java CompactionInfo怎么用?Java CompactionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CompactionInfo类属于org.apache.cassandra.db.compaction包,在下文中一共展示了CompactionInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Writer

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
protected Writer(int keysToSave)
{
    if (keysToSave >= getKeySet().size())
        keys = getKeySet();
    else
        keys = hotKeySet(keysToSave);

    OperationType type;
    if (cacheType == CacheService.CacheType.KEY_CACHE)
        type = OperationType.KEY_CACHE_SAVE;
    else if (cacheType == CacheService.CacheType.ROW_CACHE)
        type = OperationType.ROW_CACHE_SAVE;
    else if (cacheType == CacheService.CacheType.COUNTER_CACHE)
        type = OperationType.COUNTER_CACHE_SAVE;
    else
        type = OperationType.UNKNOWN;

    info = new CompactionInfo(CFMetaData.denseCFMetaData(Keyspace.SYSTEM_KS, cacheType.toString(), BytesType.instance),
                              type,
                              0,
                              keys.size(),
                              "keys");
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:24,代码来源:AutoSavingCache.java

示例2: Writer

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
protected Writer(int keysToSave)
{
    if (keysToSave >= getKeySet().size())
        keys = getKeySet();
    else
        keys = hotKeySet(keysToSave);

    OperationType type;
    if (cacheType == CacheService.CacheType.KEY_CACHE)
        type = OperationType.KEY_CACHE_SAVE;
    else if (cacheType == CacheService.CacheType.ROW_CACHE)
        type = OperationType.ROW_CACHE_SAVE;
    else
        type = OperationType.UNKNOWN;

    info = new CompactionInfo(new CFMetaData(Keyspace.SYSTEM_KS, cacheType.toString(), ColumnFamilyType.Standard, BytesType.instance, null),
                              type,
                              0,
                              keys.size(),
                              "keys");
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:22,代码来源:AutoSavingCache.java

示例3: getCompactionInfo

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
public CompactionInfo getCompactionInfo()
{
    long rangesLeft = 0, rangesTotal = 0;
    Token lastToken = prevToken;

    // This approximation is not very accurate, but since we do not have a method which allows us to calculate the
    // percentage of a range covered by a second range, this is the best approximation that we can calculate.
    // Instead, we just count the total number of ranges that haven't been seen by the node (we use the order of
    // the tokens to determine whether they have been seen yet or not), and the total number of ranges that a node
    // has.
    for (Range<Token> range : StorageService.instance.getLocalRanges(baseCfs.keyspace.getName()))
    {
        rangesLeft++;
        rangesTotal++;
        // This will reset rangesLeft, so that the number of ranges left will be less than the total ranges at the
        // end of the method.
        if (lastToken == null || range.contains(lastToken))
            rangesLeft = 0;
    }
    return new CompactionInfo(baseCfs.metadata, OperationType.VIEW_BUILD, rangesLeft, rangesTotal, "ranges", compactionId);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:22,代码来源:ViewBuilder.java

示例4: afterTest

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
@After
public void afterTest()
{
    for (CompactionInfo.Holder holder: CompactionMetrics.getCompactions())
    {
        holder.stop();
    }

    String ksname = KEYSPACE1;
    String cfname = CF_STANDARDLOWiINTERVAL; // index interval of 8, no key caching
    Keyspace keyspace = Keyspace.open(ksname);
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(cfname);
    cfs.metadata.minIndexInterval(originalMinIndexInterval);
    cfs.metadata.maxIndexInterval(originalMaxIndexInterval);
    IndexSummaryManager.instance.setMemoryPoolCapacityInMB(originalCapacity);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:17,代码来源:IndexSummaryManagerTest.java

示例5: Writer

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
protected Writer(int keysToSave)
{
    if (keysToSave >= getKeySet().size())
        keys = getKeySet();
    else
        keys = hotKeySet(keysToSave);

    OperationType type;
    if (cacheType == CacheService.CacheType.KEY_CACHE)
        type = OperationType.KEY_CACHE_SAVE;
    else if (cacheType == CacheService.CacheType.ROW_CACHE)
        type = OperationType.ROW_CACHE_SAVE;
    else
        type = OperationType.UNKNOWN;

    info = new CompactionInfo(new CFMetaData(Table.SYSTEM_KS, cacheType.toString(), null, null, null),
                              type,
                              0,
                              keys.size(),
                              "keys");
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:22,代码来源:AutoSavingCache.java

示例6: Writer

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
protected Writer(int keysToSave)
{
    if (keysToSave >= getKeySet().size())
        keys = getKeySet();
    else
        keys = hotKeySet(keysToSave);

    OperationType type;
    if (cacheType == CacheService.CacheType.KEY_CACHE)
        type = OperationType.KEY_CACHE_SAVE;
    else if (cacheType == CacheService.CacheType.ROW_CACHE)
        type = OperationType.ROW_CACHE_SAVE;
    else
        type = OperationType.UNKNOWN;

    info = new CompactionInfo(CFMetaData.denseCFMetaData(Keyspace.SYSTEM_KS, cacheType.toString(), BytesType.instance),
                              type,
                              0,
                              keys.size(),
                              "keys");
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:22,代码来源:AutoSavingCache.java

示例7: Writer

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
private Writer(String ksname, String cfname)
{
    keys = getKeySet();
    long bytes = 0;
    for (K key : keys)
        bytes += translateKey(key).remaining();
    // an approximation -- the keyset can change while saving
    estimatedTotalBytes = bytes;
    CompactionType type;

    if (cacheType.equals(ColumnFamilyStore.CacheType.KEY_CACHE_TYPE)) 
        type = CompactionType.KEY_CACHE_SAVE;
    else if (cacheType.equals(ColumnFamilyStore.CacheType.ROW_CACHE_TYPE))
        type = CompactionType.ROW_CACHE_SAVE;
    else
        type = CompactionType.UNKNOWN;

    info = new CompactionInfo(ksname,
                              cfname,
                              type,
                              0,
                              estimatedTotalBytes);
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:24,代码来源:AutoSavingCache.java

示例8: finishCompaction

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
public void finishCompaction(CompactionInfo.Holder ci)
{
    // notify
    ci.finished();
    compactions.remove(ci);
    bytesCompacted.inc(ci.getCompactionInfo().getTotal());
    totalCompactionsCompleted.mark();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:CompactionMetrics.java

示例9: getCompactionInfo

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
public CompactionInfo getCompactionInfo()
{
    return new CompactionInfo(cfs.metadata,
                              OperationType.INDEX_BUILD,
                              iter.getBytesRead(),
                              iter.getTotalBytes());
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:SecondaryIndexBuilder.java

示例10: getCompactionInfo

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
public CompactionInfo getCompactionInfo()
{
    return new CompactionInfo(cfs.metadata,
                              OperationType.INDEX_BUILD,
                              iter.getBytesRead(),
                              iter.getTotalBytes(),
                              compactionId);
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:9,代码来源:SecondaryIndexBuilder.java

示例11: Writer

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
protected Writer(int keysToSave)
{
    int size = size();
    if (keysToSave >= size || keysToSave == 0)
    {
        keyIterator = keyIterator();
        keysEstimate = size;
    }
    else
    {
        keyIterator = hotKeyIterator(keysToSave);
        keysEstimate = keysToSave;
    }

    OperationType type;
    if (cacheType == CacheService.CacheType.KEY_CACHE)
        type = OperationType.KEY_CACHE_SAVE;
    else if (cacheType == CacheService.CacheType.ROW_CACHE)
        type = OperationType.ROW_CACHE_SAVE;
    else if (cacheType == CacheService.CacheType.COUNTER_CACHE)
        type = OperationType.COUNTER_CACHE_SAVE;
    else
        type = OperationType.UNKNOWN;

    info = new CompactionInfo(CFMetaData.createFake(SystemKeyspace.NAME, cacheType.toString()),
                              type,
                              0,
                              keysEstimate,
                              "keys",
                              UUIDGen.getTimeUUID());
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:32,代码来源:AutoSavingCache.java

示例12: getCompactionInfo

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
public CompactionInfo getCompactionInfo()
{
    return new CompactionInfo(cfs.table.name,
                              cfs.columnFamily,
                              CompactionType.INDEX_BUILD,
                              iter.getBytesRead(),
                              iter.getTotalBytes());
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:9,代码来源:Table.java

示例13: getCompactionInfo

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
public CompactionInfo getCompactionInfo()
{
    long bytesWritten = this.bytesWritten;
    // keyset can change in size, thus totalBytes can too
    return info.forProgress(bytesWritten,
                            Math.max(bytesWritten, estimatedTotalBytes));
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:8,代码来源:AutoSavingCache.java

示例14: printCompactionStats

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
public void printCompactionStats(PrintStream outs)
{
    CompactionManagerMBean cm = probe.getCompactionManagerProxy();
    outs.println("pending tasks: " + cm.getPendingTasks());
    if (cm.getCompactions().size() > 0)
        outs.printf("%25s%16s%16s%16s%16s%10s%n", "compaction type", "keyspace", "column family", "bytes compacted", "bytes total", "progress");
    for (CompactionInfo c : cm.getCompactions())
    {
        String percentComplete = c.getTotalBytes() == 0
                               ? "n/a"
                               : new DecimalFormat("0.00").format((double) c.getBytesComplete() / c.getTotalBytes() * 100) + "%";
        outs.printf("%25s%16s%16s%16s%16s%10s%n", c.getTaskType(), c.getKeyspace(), c.getColumnFamily(), c.getBytesComplete(), c.getTotalBytes(), percentComplete);
    }
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:15,代码来源:NodeCmd.java

示例15: beginCompaction

import org.apache.cassandra.db.compaction.CompactionInfo; //导入依赖的package包/类
public void beginCompaction(CompactionInfo.Holder ci)
{
    // notify
    ci.started();
    compactions.add(ci);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:7,代码来源:CompactionMetrics.java


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