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);
}
}
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;
}
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);
}
}
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;
}
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;
}
Aggregations