Search in sources :

Example 6 with MetastorageView

use of org.apache.ignite.spi.systemview.view.MetastorageView in project ignite by apache.

the class SqlViewExporterSpiTest method testDistributedMetastorage.

/**
 */
@Test
public void testDistributedMetastorage() throws Exception {
    DistributedMetaStorage dms = ignite0.context().distributedMetastorage();
    SystemView<MetastorageView> distributedMetaStoreView = ignite0.context().systemView().view(DISTRIBUTED_METASTORE_VIEW);
    assertNotNull(distributedMetaStoreView);
    String name = "test-distributed-key";
    String val = "test-distributed-value";
    dms.write(name, val);
    assertEquals(1, execute(ignite0, "SELECT * FROM SYS.DISTRIBUTED_METASTORAGE WHERE name = ? AND value = ?", name, val).size());
    assertTrue(waitForCondition(() -> execute(ignite1, "SELECT * FROM SYS.DISTRIBUTED_METASTORAGE WHERE name = ? AND value = ?", name, val).size() == 1, getTestTimeout()));
}
Also used : MetastorageView(org.apache.ignite.spi.systemview.view.MetastorageView) DistributedMetaStorage(org.apache.ignite.internal.processors.metastorage.DistributedMetaStorage) AbstractExporterSpiTest(org.apache.ignite.internal.metric.AbstractExporterSpiTest) Test(org.junit.Test)

Aggregations

MetastorageView (org.apache.ignite.spi.systemview.view.MetastorageView)6 Test (org.junit.Test)4 IgniteCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager)3 ArrayList (java.util.ArrayList)2 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)2 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)2 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)2 IgniteEx (org.apache.ignite.internal.IgniteEx)2 MetastorageViewWalker (org.apache.ignite.internal.managers.systemview.walker.MetastorageViewWalker)2 IgnitePredicate (org.apache.ignite.lang.IgnitePredicate)2 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)2 Lists (com.google.common.collect.Lists)1 Serializable (java.io.Serializable)1 Field (java.lang.reflect.Field)1 Connection (java.sql.Connection)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1