Search in sources :

Example 86 with TabularDataSupport

use of javax.management.openmbean.TabularDataSupport 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 87 with TabularDataSupport

use of javax.management.openmbean.TabularDataSupport 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 88 with TabularDataSupport

use of javax.management.openmbean.TabularDataSupport 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)

Example 89 with TabularDataSupport

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

the class TrackingCorruptIndexHandler method getFailingIndexStats.

//~-----------------------------------------------------< MBean Support >
public TabularData getFailingIndexStats(String asyncName) {
    TabularDataSupport tds;
    try {
        TabularType tt = new TabularType(TrackingCorruptIndexHandler.class.getName(), "Failing Index Stats", FailingIndexStats.TYPE, new String[] { "path" });
        tds = new TabularDataSupport(tt);
        Map<String, CorruptIndexInfo> infos = getFailingIndexData(asyncName);
        for (Map.Entry<String, CorruptIndexInfo> e : infos.entrySet()) {
            FailingIndexStats stats = new FailingIndexStats(e.getValue());
            tds.put(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) Map(java.util.Map)

Example 90 with TabularDataSupport

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

the class ConsolidatedListenerMBeanImpl method getListenerStats.

@Override
public TabularData getListenerStats() {
    TabularDataSupport tds;
    try {
        int id = 0;
        TabularType tt = new TabularType(ListenerStatsData.class.getName(), "Consolidated Listener Stats", ListenerStatsData.TYPE, new String[] { "index" });
        tds = new TabularDataSupport(tt);
        for (ListenerMBeans beans : getListenerMBeans()) {
            tds.put(new ListenerStatsData(++id, beans).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)

Aggregations

TabularDataSupport (javax.management.openmbean.TabularDataSupport)103 TabularData (javax.management.openmbean.TabularData)67 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)60 CompositeData (javax.management.openmbean.CompositeData)51 CompositeType (javax.management.openmbean.CompositeType)50 TabularType (javax.management.openmbean.TabularType)36 Map (java.util.Map)27 OpenDataException (javax.management.openmbean.OpenDataException)24 HashMap (java.util.HashMap)11 Bundle (org.osgi.framework.Bundle)10 IOException (java.io.IOException)7 ObjectName (javax.management.ObjectName)7 OpenType (javax.management.openmbean.OpenType)7 EndpointUtilizationStatistics (org.apache.camel.spi.EndpointUtilizationStatistics)7 Test (org.junit.Test)6 ConcurrentMap (java.util.concurrent.ConcurrentMap)5 MBeanException (javax.management.MBeanException)5 NotCompliantMBeanException (javax.management.NotCompliantMBeanException)5 ArrayList (java.util.ArrayList)4 Dictionary (java.util.Dictionary)4