Search in sources :

Example 31 with TabularType

use of javax.management.openmbean.TabularType in project karaf by apache.

the class InstanceToTableMapper method tableFrom.

public static TabularData tableFrom(List<Instance> instances) {
    try {
        CompositeType rowType = createRowType();
        TabularType tableType = new TabularType("Instances", "Table of all Karaf instances", rowType, new String[] { InstancesMBean.INSTANCE_NAME });
        TabularDataSupport table = new TabularDataSupport(tableType);
        for (Instance instance : instances) {
            CompositeDataSupport row = mapInstance(instance, rowType);
            table.put(row);
        }
        return table;
    } catch (OpenDataException e) {
        throw new IllegalStateException("Error building instance table", e);
    }
}
Also used : Instance(org.apache.karaf.instance.core.Instance) OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType) CompositeDataSupport(javax.management.openmbean.CompositeDataSupport) CompositeType(javax.management.openmbean.CompositeType)

Example 32 with TabularType

use of javax.management.openmbean.TabularType in project jackrabbit-oak by apache.

the class ConsolidatedDataStoreCacheStats method getCacheStats.

@Override
public TabularData getCacheStats() {
    TabularDataSupport tds;
    try {
        TabularType tt = new TabularType(CacheStatsData.class.getName(), "Consolidated DataStore Cache Stats", CacheStatsData.TYPE, new String[] { "name" });
        tds = new TabularDataSupport(tt);
        for (DataStoreCacheStatsMBean stats : cacheStats) {
            tds.put(new CacheStatsData(stats).toCompositeData());
        }
    } catch (OpenDataException e) {
        throw new IllegalStateException(e);
    }
    return tds;
}
Also used : ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType)

Example 33 with TabularType

use of javax.management.openmbean.TabularType in project jackrabbit-oak by apache.

the class AbstractCheckpointMBean method listCheckpoints.

@Override
public TabularData listCheckpoints() {
    try {
        TabularDataSupport tab = new TabularDataSupport(new TabularType(getTypeName(), "Checkpoints", createCompositeType(), new String[] { "id" }));
        collectCheckpoints(tab);
        return tab;
    } catch (OpenDataException e) {
        throw new IllegalStateException(e);
    }
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType)

Example 34 with TabularType

use of javax.management.openmbean.TabularType in project jackrabbit-oak by apache.

the class ConsolidatedCacheStats method getCacheStats.

@Override
public TabularData getCacheStats() {
    TabularDataSupport tds;
    try {
        TabularType tt = new TabularType(CacheStatsData.class.getName(), "Consolidated Cache Stats", CacheStatsData.TYPE, new String[] { "name" });
        tds = new TabularDataSupport(tt);
        for (CacheStatsMBean stats : cacheStats.getServices()) {
            tds.put(new CacheStatsData(stats).toCompositeData());
        }
        for (CacheStatsMBean stats : persistentCacheStats.getServices()) {
            tds.put(new CacheStatsData(stats).toCompositeData());
        }
    } catch (OpenDataException e) {
        throw new IllegalStateException(e);
    }
    return tds;
}
Also used : OpenDataException(javax.management.openmbean.OpenDataException) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType) ConsolidatedCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedCacheStatsMBean) CacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean) PersistentCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.PersistentCacheStatsMBean)

Example 35 with TabularType

use of javax.management.openmbean.TabularType in project jackrabbit-oak by apache.

the class PropertyIndexStats method getStatsForAllIndexes.

@Override
public TabularData getStatsForAllIndexes(String path, int maxValueCount, int maxDepth, int maxPathCount) throws OpenDataException {
    String indexRootPath = concat(path, "oak:index");
    NodeState idxRoot = NodeStateUtils.getNode(store.getRoot(), indexRootPath);
    TabularType tt = new TabularType(PropertyIndexStats.class.getName(), "Property Index Stats", getType(), new String[] { "path" });
    TabularDataSupport tds = new TabularDataSupport(tt);
    for (ChildNodeEntry cne : idxRoot.getChildNodeEntries()) {
        if ("property".equals(cne.getNodeState().getString("type"))) {
            CompositeData stats = getStatsForIndex(concat(indexRootPath, cne.getName()), cne.getNodeState(), maxValueCount, maxDepth, maxPathCount);
            tds.put(stats);
        }
    }
    return tds;
}
Also used : NodeState(org.apache.jackrabbit.oak.spi.state.NodeState) TabularDataSupport(javax.management.openmbean.TabularDataSupport) TabularType(javax.management.openmbean.TabularType) ChildNodeEntry(org.apache.jackrabbit.oak.spi.state.ChildNodeEntry) CompositeData(javax.management.openmbean.CompositeData)

Aggregations

TabularType (javax.management.openmbean.TabularType)42 TabularDataSupport (javax.management.openmbean.TabularDataSupport)37 CompositeType (javax.management.openmbean.CompositeType)26 OpenDataException (javax.management.openmbean.OpenDataException)22 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)20 TabularData (javax.management.openmbean.TabularData)18 CompositeData (javax.management.openmbean.CompositeData)14 Map (java.util.Map)8 OpenType (javax.management.openmbean.OpenType)8 NotCompliantMBeanException (javax.management.NotCompliantMBeanException)6 ConcurrentMap (java.util.concurrent.ConcurrentMap)5 MBeanException (javax.management.MBeanException)5 ObjectName (javax.management.ObjectName)4 Bundle (org.osgi.framework.Bundle)4 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)3 DataSourceProxyImpl (com.alibaba.druid.proxy.jdbc.DataSourceProxyImpl)3 HashMap (java.util.HashMap)3 LinkedHashMap (java.util.LinkedHashMap)3 MBeanInfo (javax.management.MBeanInfo)3 Field (java.lang.reflect.Field)2