use of javax.management.openmbean.OpenDataException in project geode by apache.
the class CompositeConverter method toNonNullOpenValue.
/**
* Converts to open value
*/
Object toNonNullOpenValue(Object value) throws OpenDataException {
CompositeType ct = (CompositeType) getOpenType();
if (value instanceof CompositeDataView)
return ((CompositeDataView) value).toCompositeData(ct);
if (value == null)
return null;
Object[] values = new Object[getters.length];
for (int i = 0; i < getters.length; i++) {
try {
Object got = getters[i].invoke(value, (Object[]) null);
values[i] = getterConverters[i].toOpenValue(got);
} catch (Exception e) {
throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e);
}
}
return new CompositeDataSupport(ct, itemNames, values);
}
use of javax.management.openmbean.OpenDataException in project jackrabbit-oak by apache.
the class ConsolidatedListenerMBeanImpl method getObserversStats.
@Override
public TabularData getObserversStats() {
TabularDataSupport tds;
try {
int id = 0;
TabularType tt = new TabularType(ObserverStatsData.class.getName(), "Consolidated Observer Stats", ObserverStatsData.TYPE, new String[] { "index" });
tds = new TabularDataSupport(tt);
for (BackgroundObserverMBean o : collectNonJcrObservers()) {
tds.put(new ObserverStatsData(++id, o).toCompositeData());
}
} catch (OpenDataException e) {
throw new IllegalStateException(e);
}
return tds;
}
use of javax.management.openmbean.OpenDataException in project jackrabbit-oak by apache.
the class IndexCopier method getIndexPathMapping.
//~------------------------------------------< CopyOnReadStatsMBean >
@Override
public TabularData getIndexPathMapping() {
TabularDataSupport tds;
try {
TabularType tt = new TabularType(IndexMappingData.class.getName(), "Lucene Index Stats", IndexMappingData.TYPE, new String[] { "jcrPath" });
tds = new TabularDataSupport(tt);
for (LocalIndexDir indexDir : indexRootDirectory.getAllLocalIndexes()) {
String size = humanReadableByteCount(indexDir.size());
tds.put(new CompositeDataSupport(IndexMappingData.TYPE, IndexMappingData.FIELD_NAMES, new String[] { indexDir.getJcrPath(), indexDir.getFSPath(), size }));
}
} catch (OpenDataException e) {
throw new IllegalStateException(e);
} catch (IOException e) {
throw new IllegalStateException(e);
}
return tds;
}
use of javax.management.openmbean.OpenDataException in project jackrabbit-oak by apache.
the class LuceneIndexMBeanImpl method getIndexStats.
@Override
public TabularData getIndexStats() throws IOException {
TabularDataSupport tds;
try {
TabularType tt = new TabularType(LuceneIndexMBeanImpl.class.getName(), "Lucene Index Stats", IndexStats.TYPE, new String[] { "path" });
tds = new TabularDataSupport(tt);
Set<String> indexes = indexTracker.getIndexNodePaths();
for (String path : indexes) {
IndexNode indexNode = null;
try {
indexNode = indexTracker.acquireIndexNode(path);
if (indexNode != null) {
IndexStats stats = new IndexStats(path, indexNode);
tds.put(stats.toCompositeData());
}
} finally {
if (indexNode != null) {
indexNode.release();
}
}
}
} catch (OpenDataException e) {
throw new IllegalStateException(e);
}
return tds;
}
use of javax.management.openmbean.OpenDataException in project jackrabbit-oak by apache.
the class LuceneIndexMBeanImpl method getBadPersistedIndexStats.
@Override
public TabularData getBadPersistedIndexStats() {
TabularDataSupport tds;
try {
TabularType tt = new TabularType(LuceneIndexMBeanImpl.class.getName(), "Lucene Bad Persisted Index Stats", BadIndexStats.TYPE, new String[] { "path" });
tds = new TabularDataSupport(tt);
Set<String> indexes = indexTracker.getBadIndexTracker().getBadPersistedIndexPaths();
for (String path : indexes) {
BadIndexInfo info = indexTracker.getBadIndexTracker().getPersistedIndexInfo(path);
if (info != null) {
BadIndexStats stats = new BadIndexStats(info);
tds.put(stats.toCompositeData());
}
}
} catch (OpenDataException e) {
throw new IllegalStateException(e);
}
return tds;
}
Aggregations