use of org.apache.ignite.internal.processors.cluster.GridClusterStateProcessor.BASELINE_NODES_SYS_VIEW in project ignite by apache.
the class SystemViewSelfTest method testBaselineNodes.
/**
*/
@Test
public void testBaselineNodes() throws Exception {
cleanPersistenceDir();
try (IgniteEx ignite0 = startGrid(getConfiguration(getTestIgniteInstanceName(0)).setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))).setConsistentId("consId0"));
IgniteEx ignite1 = startGrid(getConfiguration(getTestIgniteInstanceName(1)).setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true))).setConsistentId("consId1"))) {
ignite0.cluster().state(ClusterState.ACTIVE);
ignite1.close();
awaitPartitionMapExchange();
SystemView<BaselineNodeView> view = ignite0.context().systemView().view(BASELINE_NODES_SYS_VIEW);
assertEquals(2, view.size());
assertEquals(1, F.size(view.iterator(), row -> "consId0".equals(row.consistentId()) && row.online()));
assertEquals(1, F.size(view.iterator(), row -> "consId1".equals(row.consistentId()) && !row.online()));
}
}
Aggregations