use of org.apache.ignite.internal.processors.metastorage.persistence.DistributedMetaStorageImpl.DISTRIBUTED_METASTORE_VIEW in project ignite by apache.
the class SystemViewSelfTest method testDistributedMetastorage.
/**
*/
@Test
public void testDistributedMetastorage() throws Exception {
cleanPersistenceDir();
try (IgniteEx ignite = startGrid(getConfiguration().setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))))) {
ignite.cluster().state(ClusterState.ACTIVE);
DistributedMetaStorage dms = ignite.context().distributedMetastorage();
SystemView<MetastorageView> metaStoreView = ignite.context().systemView().view(DISTRIBUTED_METASTORE_VIEW);
assertNotNull(metaStoreView);
String name = "test-distributed-key";
String val = "test-distributed-value";
dms.write(name, val);
MetastorageView testKey = F.find(metaStoreView, null, (IgnitePredicate<? super MetastorageView>) view -> name.equals(view.name()) && val.equals(view.value()));
assertNotNull(testKey);
}
}
Aggregations