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


Java CompactionManagerMBean.getCompactions方法代码示例

本文整理汇总了Java中org.apache.cassandra.db.compaction.CompactionManagerMBean.getCompactions方法的典型用法代码示例。如果您正苦于以下问题:Java CompactionManagerMBean.getCompactions方法的具体用法?Java CompactionManagerMBean.getCompactions怎么用?Java CompactionManagerMBean.getCompactions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.db.compaction.CompactionManagerMBean的用法示例。


在下文中一共展示了CompactionManagerMBean.getCompactions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printCompactionStats

import org.apache.cassandra.db.compaction.CompactionManagerMBean; //导入方法依赖的package包/类
public void printCompactionStats(PrintStream outs)
{
    int compactionThroughput = probe.getCompactionThroughput();
    CompactionManagerMBean cm = probe.getCompactionManagerProxy();
    outs.println("pending tasks: " + cm.getPendingTasks());
    if (cm.getCompactions().size() > 0)
        outs.printf("%25s%16s%16s%16s%16s%10s%10s%n", "compaction type", "keyspace", "table", "completed", "total", "unit", "progress");
    long remainingBytes = 0;
    for (Map<String, String> c : cm.getCompactions())
    {
        String percentComplete = new Long(c.get("total")) == 0
                               ? "n/a"
                               : new DecimalFormat("0.00").format((double) new Long(c.get("completed")) / new Long(c.get("total")) * 100) + "%";
        outs.printf("%25s%16s%16s%16s%16s%10s%10s%n", c.get("taskType"), c.get("keyspace"), c.get("columnfamily"), c.get("completed"), c.get("total"), c.get("unit"), percentComplete);
        if (c.get("taskType").equals(OperationType.COMPACTION.toString()))
            remainingBytes += (new Long(c.get("total")) - new Long(c.get("completed")));
    }
    long remainingTimeInSecs = compactionThroughput == 0 || remainingBytes == 0
                    ? -1
                    : (remainingBytes) / (long) (1024L * 1024L * compactionThroughput);
    String remainingTime = remainingTimeInSecs < 0
                    ? "n/a"
                    : String.format("%dh%02dm%02ds", remainingTimeInSecs / 3600, (remainingTimeInSecs % 3600) / 60, (remainingTimeInSecs % 60));

    outs.printf("%25s%10s%n", "Active compaction remaining time : ", remainingTime);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:27,代码来源:NodeCmd.java

示例2: printCompactionStats

import org.apache.cassandra.db.compaction.CompactionManagerMBean; //导入方法依赖的package包/类
public void printCompactionStats(PrintStream outs)
{
    int compactionThroughput = probe.getCompactionThroughput();
    CompactionManagerMBean cm = probe.getCompactionManagerProxy();
    outs.println("pending tasks: " + cm.getPendingTasks());
    if (cm.getCompactions().size() > 0)
        outs.printf("%25s%16s%16s%16s%16s%10s%10s%n", "compaction type", "keyspace", "column family", "completed", "total", "unit", "progress");
    long remainingBytes = 0;
    for (Map<String, String> c : cm.getCompactions())
    {
        String percentComplete = new Long(c.get("total")) == 0
                               ? "n/a"
                               : new DecimalFormat("0.00").format((double) new Long(c.get("completed")) / new Long(c.get("total")) * 100) + "%";
        outs.printf("%25s%16s%16s%16s%16s%10s%10s%n", c.get("taskType"), c.get("keyspace"), c.get("columnfamily"), c.get("completed"), c.get("total"), c.get("unit"), percentComplete);
        if (c.get("taskType").equals(OperationType.COMPACTION.toString()))
            remainingBytes += (new Long(c.get("total")) - new Long(c.get("completed")));
    }
    long remainingTimeInSecs = compactionThroughput == 0 || remainingBytes == 0
                    ? -1
                    : (remainingBytes) / (long) (1024L * 1024L * compactionThroughput);
    String remainingTime = remainingTimeInSecs < 0
                    ? "n/a"
                    : String.format("%dh%02dm%02ds", remainingTimeInSecs / 3600, (remainingTimeInSecs % 3600) / 60, (remainingTimeInSecs % 60));

    outs.printf("%25s%10s%n", "Active compaction remaining time : ", remainingTime);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:27,代码来源:NodeCmd.java

示例3: execute

import org.apache.cassandra.db.compaction.CompactionManagerMBean; //导入方法依赖的package包/类
@Override
public void execute(NodeProbe probe)
{
    int compactionThroughput = probe.getCompactionThroughput();
    CompactionManagerMBean cm = probe.getCompactionManagerProxy();
    System.out.println("pending tasks: " + probe.getCompactionMetric("PendingTasks"));
    if (cm.getCompactions().size() > 0)
        System.out.printf("%25s%16s%16s%16s%16s%10s%10s%n", "compaction type", "keyspace", "table", "completed", "total", "unit", "progress");
    long remainingBytes = 0;
    for (Map<String, String> c : cm.getCompactions())
    {
        String percentComplete = new Long(c.get("total")) == 0
                                 ? "n/a"
                                 : new DecimalFormat("0.00").format((double) new Long(c.get("completed")) / new Long(c.get("total")) * 100) + "%";
        System.out.printf("%25s%16s%16s%16s%16s%10s%10s%n", c.get("taskType"), c.get("keyspace"), c.get("columnfamily"), c.get("completed"), c.get("total"), c.get("unit"), percentComplete);
        if (c.get("taskType").equals(OperationType.COMPACTION.toString()))
            remainingBytes += (new Long(c.get("total")) - new Long(c.get("completed")));
    }
    long remainingTimeInSecs = compactionThroughput == 0 || remainingBytes == 0
                               ? -1
                               : (remainingBytes) / (1024L * 1024L * compactionThroughput);
    String remainingTime = remainingTimeInSecs < 0
                           ? "n/a"
                           : format("%dh%02dm%02ds", remainingTimeInSecs / 3600, (remainingTimeInSecs % 3600) / 60, (remainingTimeInSecs % 60));

    System.out.printf("%25s%10s%n", "Active compaction remaining time : ", remainingTime);
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:28,代码来源:NodeTool.java

示例4: printCompactionStats

import org.apache.cassandra.db.compaction.CompactionManagerMBean; //导入方法依赖的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


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