use of org.apache.ignite.internal.managers.systemview.walker.MetastorageViewWalker in project ignite by apache.
the class GridCacheDatabaseSharedManager method registerSystemView.
/**
* Registers system view.
*/
private void registerSystemView() {
cctx.kernalContext().systemView().registerView(METASTORE_VIEW, METASTORE_VIEW_DESC, new MetastorageViewWalker(), () -> {
try {
List<MetastorageView> data = new ArrayList<>();
metaStorage.iterate("", (key, valBytes) -> {
try {
Serializable val = metaStorage.marshaller().unmarshal((byte[]) valBytes, U.gridClassLoader());
data.add(new MetastorageView(key, IgniteUtils.toStringSafe(val)));
} catch (IgniteCheckedException ignored) {
data.add(new MetastorageView(key, "[Raw data. " + (((byte[]) valBytes).length + " bytes]")));
}
}, false);
return data;
} catch (IgniteCheckedException e) {
log.warning("Metastore iteration error", e);
return emptyList();
}
}, identity());
}
use of org.apache.ignite.internal.managers.systemview.walker.MetastorageViewWalker in project ignite by apache.
the class DistributedMetaStorageImpl method registerSystemView.
/**
*/
private void registerSystemView() {
ctx.systemView().registerView(DISTRIBUTED_METASTORE_VIEW, DISTRIBUTED_METASTORE_VIEW_DESC, new MetastorageViewWalker(), () -> {
try {
List<MetastorageView> data = new ArrayList<>();
iterate("", (key, val) -> data.add(new MetastorageView(key, IgniteUtils.toStringSafe(val))));
return data;
} catch (IgniteCheckedException e) {
log.warning("Metastore iteration error", e);
return Collections.emptyList();
}
}, identity());
}
Aggregations