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


Java EstimatedHistogram.max方法代码示例

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


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

示例1: getSSTableMetadata

import org.apache.cassandra.utils.EstimatedHistogram; //导入方法依赖的package包/类
public List<SSTableMetadata> getSSTableMetadata(String ksName, String cfName) {
    ColumnFamilyStore cfStore = getStore(ksName, cfName);
    Collection<SSTableReader> tables = cfStore.getLiveSSTables();
    List<SSTableMetadata> metaData = new ArrayList<>(tables.size());
    for (SSTableReader table : tables) {
        SSTableMetadata tableMetadata = new SSTableMetadata();
        File dataFile = new File(table.descriptor.filenameFor(Component.DATA));
        tableMetadata.filename = dataFile.getName();
        tableMetadata.generation = table.descriptor.generation;
        try {
            tableMetadata.fileTimestamp = Files.getLastModifiedTime(dataFile.toPath()).toMillis();
        } catch (IOException e) {
            tableMetadata.fileTimestamp = 0;
        }
        tableMetadata.minTimestamp = table.getMinTimestamp();
        tableMetadata.maxTimestamp = table.getMaxTimestamp();
        tableMetadata.diskLength = table.onDiskLength();
        tableMetadata.uncompressedLength = table.uncompressedLength();
        tableMetadata.keys = table.estimatedKeys();
        EstimatedHistogram rowSizeHistogram = table.getEstimatedPartitionSize();
        tableMetadata.maxRowSize = rowSizeHistogram.max();
        tableMetadata.avgRowSize = rowSizeHistogram.mean();
        EstimatedHistogram columnCountHistogram = table.getEstimatedColumnCount();
        tableMetadata.maxColumnCount = columnCountHistogram.max();
        tableMetadata.avgColumnCount = columnCountHistogram.mean();
        tableMetadata.droppableTombstones = table.getDroppableTombstonesBefore(NOW_SECONDS - table.metadata.params.gcGraceSeconds);
        tableMetadata.level = table.getSSTableLevel();
        tableMetadata.isRepaired = table.isRepaired();
        tableMetadata.repairedAt = table.getSSTableMetadata().repairedAt;
        metaData.add(tableMetadata);
    }
    return metaData;
}
 
开发者ID:instaclustr,项目名称:cassandra-sstable-tools,代码行数:34,代码来源:CassandraBackend.java

示例2: getSSTableMetadata

import org.apache.cassandra.utils.EstimatedHistogram; //导入方法依赖的package包/类
public List<SSTableMetadata> getSSTableMetadata(String ksName, String cfName) {
    ColumnFamilyStore cfStore = getStore(ksName, cfName);
    Collection<SSTableReader> tables = cfStore.getSSTables();
    List<SSTableMetadata> metaData = new ArrayList<>(tables.size());
    for (SSTableReader table : tables) {
        SSTableMetadata tableMetadata = new SSTableMetadata();
        File dataFile = new File(table.descriptor.filenameFor(Component.DATA));
        tableMetadata.filename = dataFile.getName();
        tableMetadata.generation = table.descriptor.generation;
        try {
            tableMetadata.fileTimestamp = Files.getLastModifiedTime(dataFile.toPath()).toMillis();
        } catch (IOException e) {
            tableMetadata.fileTimestamp = 0;
        }
        tableMetadata.minTimestamp = table.getMinTimestamp();
        tableMetadata.maxTimestamp = table.getMaxTimestamp();
        tableMetadata.diskLength = table.onDiskLength();
        tableMetadata.uncompressedLength = table.uncompressedLength();
        tableMetadata.keys = table.estimatedKeys();
        EstimatedHistogram rowSizeHistogram = table.getEstimatedRowSize();
        tableMetadata.maxRowSize = rowSizeHistogram.max();
        tableMetadata.avgRowSize = rowSizeHistogram.mean();
        EstimatedHistogram columnCountHistogram = table.getEstimatedColumnCount();
        tableMetadata.maxColumnCount = columnCountHistogram.max();
        tableMetadata.avgColumnCount = columnCountHistogram.mean();
        tableMetadata.droppableTombstones = table.getDroppableTombstonesBefore(Util.NOW_SECONDS - table.metadata.getGcGraceSeconds());
        tableMetadata.level = table.getSSTableLevel();
        tableMetadata.isRepaired = table.isRepaired();
        tableMetadata.repairedAt = table.getSSTableMetadata().repairedAt;
        metaData.add(tableMetadata);
    }
    return metaData;
}
 
开发者ID:instaclustr,项目名称:cassandra-sstable-tools,代码行数:34,代码来源:CassandraBackend.java

示例3: getSSTableMetadata

import org.apache.cassandra.utils.EstimatedHistogram; //导入方法依赖的package包/类
public List<SSTableMetadata> getSSTableMetadata(String ksName, String cfName) {
    ColumnFamilyStore cfStore = getStore(ksName, cfName);
    Collection<SSTableReader> tables = cfStore.getSSTables();
    List<SSTableMetadata> metaData = new ArrayList<>(tables.size());
    for (SSTableReader table : tables) {
        SSTableMetadata tableMetadata = new SSTableMetadata();
        File dataFile = new File(table.descriptor.filenameFor(Component.DATA));
        tableMetadata.filename = dataFile.getName();
        tableMetadata.generation = table.descriptor.generation;
        try {
            tableMetadata.fileTimestamp = Files.getLastModifiedTime(dataFile.toPath()).toMillis();
        } catch (IOException e) {
            tableMetadata.fileTimestamp = 0;
        }
        tableMetadata.minTimestamp = table.getMinTimestamp();
        tableMetadata.maxTimestamp = table.getMaxTimestamp();
        tableMetadata.diskLength = table.onDiskLength();
        tableMetadata.uncompressedLength = table.uncompressedLength();
        tableMetadata.keys = table.estimatedKeys();
        EstimatedHistogram rowSizeHistogram = table.getEstimatedRowSize();
        tableMetadata.maxRowSize = rowSizeHistogram.max();
        tableMetadata.avgRowSize = rowSizeHistogram.mean();
        EstimatedHistogram columnCountHistogram = table.getEstimatedColumnCount();
        tableMetadata.maxColumnCount = columnCountHistogram.max();
        tableMetadata.avgColumnCount = columnCountHistogram.mean();
        tableMetadata.droppableTombstones = table.getDroppableTombstonesBefore(Util.NOW_SECONDS - table.metadata.getGcGraceSeconds());
        tableMetadata.level = table.getSSTableLevel();
        tableMetadata.isRepaired = false;
        metaData.add(tableMetadata);
    }
    return metaData;
}
 
开发者ID:instaclustr,项目名称:cassandra-sstable-tools,代码行数:33,代码来源:CassandraBackend.java

示例4: metricPercentilesAsArray

import org.apache.cassandra.utils.EstimatedHistogram; //导入方法依赖的package包/类
public double[] metricPercentilesAsArray(long[] counts)
{
    double[] result = new double[7];

    if (isEmpty(counts))
    {
        Arrays.fill(result, Double.NaN);
        return result;
    }

    double[] offsetPercentiles = new double[] { 0.5, 0.75, 0.95, 0.98, 0.99 };
    long[] offsets = new EstimatedHistogram(counts.length).getBucketOffsets();
    EstimatedHistogram metric = new EstimatedHistogram(offsets, counts);

    if (metric.isOverflowed())
    {
        System.err.println(String.format("EstimatedHistogram overflowed larger than %s, unable to calculate percentiles",
                                         offsets[offsets.length - 1]));
        for (int i = 0; i < result.length; i++)
            result[i] = Double.NaN;
    }
    else
    {
        for (int i = 0; i < offsetPercentiles.length; i++)
            result[i] = metric.percentile(offsetPercentiles[i]);
    }
    result[5] = metric.min();
    result[6] = metric.max();
    return result;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:31,代码来源:NodeProbe.java

示例5: execute

import org.apache.cassandra.utils.EstimatedHistogram; //导入方法依赖的package包/类
@Override
public void execute(NodeProbe probe)
{
    checkArgument(args.size() == 2, "cfhistograms requires ks and cf args");

    String keyspace = args.get(0);
    String cfname = args.get(1);

    // calculate percentile of row size and column count
    long[] estimatedRowSize = (long[]) probe.getColumnFamilyMetric(keyspace, cfname, "EstimatedRowSizeHistogram");
    long[] estimatedColumnCount = (long[]) probe.getColumnFamilyMetric(keyspace, cfname, "EstimatedColumnCountHistogram");

    long[] bucketOffsets = new EstimatedHistogram().getBucketOffsets();
    EstimatedHistogram rowSizeHist = new EstimatedHistogram(bucketOffsets, estimatedRowSize);
    EstimatedHistogram columnCountHist = new EstimatedHistogram(bucketOffsets, estimatedColumnCount);

    // build arrays to store percentile values
    double[] estimatedRowSizePercentiles = new double[7];
    double[] estimatedColumnCountPercentiles = new double[7];
    double[] offsetPercentiles = new double[]{0.5, 0.75, 0.95, 0.98, 0.99};
    for (int i = 0; i < offsetPercentiles.length; i++)
    {
        estimatedRowSizePercentiles[i] = rowSizeHist.percentile(offsetPercentiles[i]);
        estimatedColumnCountPercentiles[i] = columnCountHist.percentile(offsetPercentiles[i]);
    }

    // min value
    estimatedRowSizePercentiles[5] = rowSizeHist.min();
    estimatedColumnCountPercentiles[5] = columnCountHist.min();
    // max value
    estimatedRowSizePercentiles[6] = rowSizeHist.max();
    estimatedColumnCountPercentiles[6] = columnCountHist.max();

    String[] percentiles = new String[]{"50%", "75%", "95%", "98%", "99%", "Min", "Max"};
    double[] readLatency = probe.metricPercentilesAsArray((JmxReporter.HistogramMBean) probe.getColumnFamilyMetric(keyspace, cfname, "ReadLatency"));
    double[] writeLatency = probe.metricPercentilesAsArray((JmxReporter.TimerMBean) probe.getColumnFamilyMetric(keyspace, cfname, "WriteLatency"));
    double[] sstablesPerRead = probe.metricPercentilesAsArray((JmxReporter.HistogramMBean) probe.getColumnFamilyMetric(keyspace, cfname, "SSTablesPerReadHistogram"));

    System.out.println(format("%s/%s histograms", keyspace, cfname));
    System.out.println(format("%-10s%10s%18s%18s%18s%18s",
            "Percentile", "SSTables", "Write Latency", "Read Latency", "Partition Size", "Cell Count"));
    System.out.println(format("%-10s%10s%18s%18s%18s%18s",
            "", "", "(micros)", "(micros)", "(bytes)", ""));

    for (int i = 0; i < percentiles.length; i++)
    {
        System.out.println(format("%-10s%10.2f%18.2f%18.2f%18.0f%18.0f",
                percentiles[i],
                sstablesPerRead[i],
                writeLatency[i],
                readLatency[i],
                estimatedRowSizePercentiles[i],
                estimatedColumnCountPercentiles[i]));
    }
    System.out.println();
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:57,代码来源:NodeTool.java


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