• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ColumnFamilyStoreMBean类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getTableNamesForKeyspace

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
@Override
public Set<String> getTableNamesForKeyspace(String keyspace) throws ReaperException {
  Set<String> tableNames = new HashSet<>();
  Iterator<Map.Entry<String, ColumnFamilyStoreMBean>> proxies;
  try {
    proxies = ColumnFamilyStoreMBeanIterator.getColumnFamilyStoreMBeanProxies(mbeanServer);
  } catch (IOException | MalformedObjectNameException e) {
    throw new ReaperException("failed to get ColumnFamilyStoreMBean instances from JMX", e);
  }
  while (proxies.hasNext()) {
    Map.Entry<String, ColumnFamilyStoreMBean> proxyEntry = proxies.next();
    String keyspaceName = proxyEntry.getKey();
    if (keyspace.equalsIgnoreCase(keyspaceName)) {
      ColumnFamilyStoreMBean columnFamilyMBean = proxyEntry.getValue();
      tableNames.add(columnFamilyMBean.getColumnFamilyName());
    }
  }
  return tableNames;
}
 
开发者ID:thelastpickle,项目名称:cassandra-reaper,代码行数:20,代码来源:JmxProxyImpl.java


示例2: getOffHeapMemoryUsed

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
/**
 * Returns the total off heap memory used in MB.
 * @return the total off heap memory used in MB.
 */
private static double getOffHeapMemoryUsed(NodeProbe probe)
{
    long offHeapMemUsedInBytes = 0;
    // get a list of column family stores
    Iterator<Map.Entry<String, ColumnFamilyStoreMBean>> cfamilies = probe.getColumnFamilyStoreMBeanProxies();

    while (cfamilies.hasNext())
    {
        Entry<String, ColumnFamilyStoreMBean> entry = cfamilies.next();
        String keyspaceName = entry.getKey();
        String cfName = entry.getValue().getColumnFamilyName();

        offHeapMemUsedInBytes += (Long) probe.getColumnFamilyMetric(keyspaceName, cfName, "MemtableOffHeapSize");
        offHeapMemUsedInBytes += (Long) probe.getColumnFamilyMetric(keyspaceName, cfName, "BloomFilterOffHeapMemoryUsed");
        offHeapMemUsedInBytes += (Long) probe.getColumnFamilyMetric(keyspaceName, cfName, "IndexSummaryOffHeapMemoryUsed");
        offHeapMemUsedInBytes += (Long) probe.getColumnFamilyMetric(keyspaceName, cfName, "CompressionMetadataOffHeapMemoryUsed");
    }

    return offHeapMemUsedInBytes / (1024d * 1024);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:25,代码来源:NodeTool.java


示例3: newColumnFamilyStore

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
private ColumnFamilyStoreMBean newColumnFamilyStore() {
    return (ColumnFamilyStoreMBean) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{ColumnFamilyStoreMBean.class},
            new InvocationHandler() {
                @Override
                public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                    String name = method.getName();
                    switch (name) {
                        case "loadNewSSTables":
                            invocations.add("loadNewSSTables");
                            return null;
                        default:
                            throw new UnsupportedOperationException(name);

                    }
                }
            });
}
 
开发者ID:mesosphere,项目名称:cassandra-mesos-deprecated,代码行数:18,代码来源:BackupManagerTest.java


示例4: getCfsProxy

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
public ColumnFamilyStoreMBean getCfsProxy(String ks, String cf)
{
    ColumnFamilyStoreMBean cfsProxy = null;
    try
    {
        cfsProxy = JMX.newMBeanProxy(mbeanServerConn,
                new ObjectName("org.apache.cassandra.db:type=ColumnFamilies,keyspace="+ks+",columnfamily="+cf), 
                ColumnFamilyStoreMBean.class);
    }
    catch (MalformedObjectNameException mone)
    {
        System.err.println("ColumnFamilyStore for " + ks + "/" + cf + " not found.");
        System.exit(1);
    }

    return cfsProxy;
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:18,代码来源:NodeProbe.java


示例5: next

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
@Override
public Map.Entry<String, ColumnFamilyStoreMBean> next() {
  ObjectName objectName = resIter.next();
  String keyspaceName = objectName.getKeyProperty("keyspace");
  ColumnFamilyStoreMBean cfsProxy = JMX.newMBeanProxy(mbeanServerConn, objectName, ColumnFamilyStoreMBean.class);
  return new AbstractMap.SimpleImmutableEntry<>(keyspaceName, cfsProxy);
}
 
开发者ID:thelastpickle,项目名称:cassandra-reaper,代码行数:8,代码来源:ColumnFamilyStoreMBeanIterator.java


示例6: getCfsProxy

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
public ColumnFamilyStoreMBean getCfsProxy(String ks, String cf)
{
    ColumnFamilyStoreMBean cfsProxy = null;
    try
    {
        String type = cf.contains(".") ? "IndexColumnFamilies" : "ColumnFamilies";
        Set<ObjectName> beans = mbeanServerConn.queryNames(
                new ObjectName("org.apache.cassandra.db:type=*" + type +",keyspace=" + ks + ",columnfamily=" + cf), null);

        if (beans.isEmpty())
            throw new MalformedObjectNameException("couldn't find that bean");
        assert beans.size() == 1;
        for (ObjectName bean : beans)
            cfsProxy = JMX.newMBeanProxy(mbeanServerConn, bean, ColumnFamilyStoreMBean.class);
    }
    catch (MalformedObjectNameException mone)
    {
        System.err.println("ColumnFamilyStore for " + ks + "/" + cf + " not found.");
        System.exit(1);
    }
    catch (IOException e)
    {
        System.err.println("ColumnFamilyStore for " + ks + "/" + cf + " not found: " + e);
        System.exit(1);
    }

    return cfsProxy;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:29,代码来源:NodeProbe.java


示例7: getCFSMBeans

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
private List<Entry<String, ColumnFamilyStoreMBean>> getCFSMBeans(MBeanServerConnection mbeanServerConn, String type)
        throws MalformedObjectNameException, IOException
{
    ObjectName query = new ObjectName("org.apache.cassandra.db:type=" + type +",*");
    Set<ObjectName> cfObjects = mbeanServerConn.queryNames(query, null);
    List<Entry<String, ColumnFamilyStoreMBean>> mbeans = new ArrayList<Entry<String, ColumnFamilyStoreMBean>>(cfObjects.size());
    for(ObjectName n : cfObjects)
    {
        String keyspaceName = n.getKeyProperty("keyspace");
        ColumnFamilyStoreMBean cfsProxy = JMX.newMBeanProxy(mbeanServerConn, n, ColumnFamilyStoreMBean.class);
        mbeans.add(new AbstractMap.SimpleImmutableEntry<String, ColumnFamilyStoreMBean>(keyspaceName, cfsProxy));
    }
    return mbeans;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:15,代码来源:NodeProbe.java


示例8: execute

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
@Override
public void execute(NodeProbe probe)
{
    checkArgument(args.size() == 2, "getcompactionthreshold requires ks and cf args");
    String ks = args.get(0);
    String cf = args.get(1);

    ColumnFamilyStoreMBean cfsProxy = probe.getCfsProxy(ks, cf);
    System.out.println("Current compaction thresholds for " + ks + "/" + cf + ": \n" +
            " min = " + cfsProxy.getMinimumCompactionThreshold() + ", " +
            " max = " + cfsProxy.getMaximumCompactionThreshold());
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:13,代码来源:NodeTool.java


示例9: printCompactionThreshold

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
/**
 * Print the compaction threshold
 *
 * @param outs the stream to write to
 */
public void printCompactionThreshold(PrintStream outs, String ks, String cf)
{
    ColumnFamilyStoreMBean cfsProxy = probe.getCfsProxy(ks, cf);
    outs.println("Current compaction thresholds for " + ks + "/" + cf + ": \n" +
                 " min = " + cfsProxy.getMinimumCompactionThreshold() + ", " +
                 " max = " + cfsProxy.getMaximumCompactionThreshold());
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:13,代码来源:NodeCmd.java


示例10: printCfHistograms

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
private void printCfHistograms(String keySpace, String columnFamily, PrintStream output)
{
    ColumnFamilyStoreMBean store = this.probe.getCfsProxy(keySpace, columnFamily);

    // default is 90 offsets
    long[] offsets = new EstimatedHistogram().getBucketOffsets();

    long[] rrlh = store.getRecentReadLatencyHistogramMicros();
    long[] rwlh = store.getRecentWriteLatencyHistogramMicros();
    long[] sprh = store.getRecentSSTablesPerReadHistogram();
    long[] ersh = store.getEstimatedRowSizeHistogram();
    long[] ecch = store.getEstimatedColumnCountHistogram();

    output.println(String.format("%s/%s histograms", keySpace, columnFamily));

    output.println(String.format("%-10s%10s%18s%18s%18s%18s",
                                 "Offset", "SSTables", "Write Latency", "Read Latency", "Partition Size", "Cell Count"));
    output.println(String.format("%-10s%10s%18s%18s%18s%18s",
                                 "", "", "(micros)", "(micros)", "(bytes)", ""));

    for (int i = 0; i < offsets.length; i++)
    {
        output.println(String.format("%-10d%10s%18s%18s%18s%18s",
                                     offsets[i],
                                     (i < sprh.length ? sprh[i] : "0"),
                                     (i < rwlh.length ? rwlh[i] : "0"),
                                     (i < rrlh.length ? rrlh[i] : "0"),
                                     (i < ersh.length ? ersh[i] : "0"),
                                     (i < ecch.length ? ecch[i] : "0")));
    }
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:32,代码来源:NodeCmd.java


示例11: printCfHistograms

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
private void printCfHistograms(String keySpace, String columnFamily, PrintStream output)
{
    ColumnFamilyStoreMBean store = this.probe.getCfsProxy(keySpace, columnFamily);

    // default is 90 offsets
    long[] offsets = new EstimatedHistogram().getBucketOffsets();

    long[] rrlh = store.getRecentReadLatencyHistogramMicros();
    long[] rwlh = store.getRecentWriteLatencyHistogramMicros();
    long[] sprh = store.getRecentSSTablesPerReadHistogram();
    long[] ersh = store.getEstimatedRowSizeHistogram();
    long[] ecch = store.getEstimatedColumnCountHistogram();

    output.println(String.format("%s/%s histograms", keySpace, columnFamily));

    output.println(String.format("%-10s%10s%18s%18s%18s%18s",
                                 "Offset", "SSTables", "Write Latency", "Read Latency", "Row Size", "Column Count"));

    for (int i = 0; i < offsets.length; i++)
    {
        output.println(String.format("%-10d%10s%18s%18s%18s%18s",
                                     offsets[i],
                                     (i < sprh.length ? sprh[i] : "0"),
                                     (i < rwlh.length ? rwlh[i] : "0"),
                                     (i < rrlh.length ? rrlh[i] : "0"),
                                     (i < ersh.length ? ersh[i] : "0"),
                                     (i < ecch.length ? ecch[i] : "0")));
    }
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:30,代码来源:NodeCmd.java


示例12: getCFSMBeans

import org.apache.cassandra.db.ColumnFamilyStoreMBean; //导入依赖的package包/类
private List<Entry<String, ColumnFamilyStoreMBean>> getCFSMBeans(MBeanServerConnection mbeanServerConn, String type)
        throws MalformedObjectNameException, IOException
{
    ObjectName query = new ObjectName("org.apache.cassandra.db:type=" + type +",*");
    Set<ObjectName> cfObjects = mbeanServerConn.queryNames(query, null);
    List<Entry<String, ColumnFamilyStoreMBean>> mbeans = new ArrayList<Entry<String, ColumnFamilyStoreMBean>>(cfObjects.size());
    for(ObjectName n : cfObjects)
    {
        String tableName = n.getKeyProperty("keyspace");
        ColumnFamilyStoreMBean cfsProxy = JMX.newMBeanProxy(mbeanServerConn, n, ColumnFamilyStoreMBean.class);
        mbeans.add(new AbstractMap.SimpleImmutableEntry<String, ColumnFamilyStoreMBean>(tableName, cfsProxy));
    }
    return mbeans;
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:15,代码来源:NodeProbe.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TransPreviewProgressDialog类代码示例发布时间:2022-05-21
下一篇:
Java Endpoint类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap