Package org.apache.cassandra.db

Examples of org.apache.cassandra.db.ColumnFamilyStoreMBean


            // get a list of column family stores
            query = new ObjectName("org.apache.cassandra.db:type=ColumnFamilyStores,*");
            Set<ObjectName> result = mbeanServerConn.queryNames(query, null);
            for (ObjectName objectName: result) {
                String tableName = objectName.getKeyProperty("name");
                ColumnFamilyStoreMBean cfsProxy = JMX.newMBeanProxy(
                        mbeanServerConn, objectName, ColumnFamilyStoreMBean.class);
               
                if (!cfstoreMap.containsKey(tableName)) {
                    List <ColumnFamilyStoreMBean> columnFamilies = new ArrayList<ColumnFamilyStoreMBean>();
                    columnFamilies.add(cfsProxy);
View Full Code Here


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

                if (!cfstoreMap.containsKey(keyspaceName) && filter.isColumnFamilyIncluded(entry.getKey(), cfsProxy.getColumnFamilyName()))
                {
                    List<ColumnFamilyStoreMBean> columnFamilies = new ArrayList<>();
                    columnFamilies.add(cfsProxy);
                    cfstoreMap.put(keyspaceName, columnFamilies);
                } else if (filter.isColumnFamilyIncluded(entry.getKey(), cfsProxy.getColumnFamilyName()))
                {
                    cfstoreMap.get(keyspaceName).add(cfsProxy);
                }
            }
View Full Code Here

        {
            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());
        }
View Full Code Here

     *
     * @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());
    }
View Full Code Here

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

            if (!cfstoreMap.containsKey(keyspaceName) && filter.isColumnFamilyIncluded(entry.getKey(), cfsProxy.getColumnFamilyName()))
            {
                List<ColumnFamilyStoreMBean> columnFamilies = new ArrayList<ColumnFamilyStoreMBean>();
                columnFamilies.add(cfsProxy);
                cfstoreMap.put(keyspaceName, columnFamilies);
            }
            else if (filter.isColumnFamilyIncluded(entry.getKey(), cfsProxy.getColumnFamilyName()))
            {
                cfstoreMap.get(keyspaceName).add(cfsProxy);
            }
        }
View Full Code Here

        outs.println("RemovalStatus: " + probe.getRemovalStatus());
    }

    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"));
View Full Code Here

     * @param minimumCompactionThreshold minimum compaction threshold
     * @param maximumCompactionThreshold maximum compaction threshold
     */
    public void setCompactionThreshold(String ks, String cf, int minimumCompactionThreshold, int maximumCompactionThreshold)
    {
        ColumnFamilyStoreMBean cfsProxy = getCfsProxy(ks, cf);
        cfsProxy.setCompactionThresholds(minimumCompactionThreshold, maximumCompactionThreshold);
    }
View Full Code Here

        return ssProxy.getNaturalEndpoints(keyspace, cf, key);
    }

    public List<String> getSSTables(String keyspace, String cf, String key)
    {
        ColumnFamilyStoreMBean cfsProxy = getCfsProxy(keyspace, cf);
        return cfsProxy.getSSTablesForKey(key);
    }
View Full Code Here

        }
    }

    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);
View Full Code Here

        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;
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.db.ColumnFamilyStoreMBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.