Search in sources :

Example 31 with IgniteEx

use of org.apache.ignite.internal.IgniteEx in project ignite by apache.

the class DynamicColumnsAbstractConcurrentSelfTest method testOperationChaining.

/**
 * Test operations join.
 *
 * @throws Exception If failed.
 */
public void testOperationChaining() throws Exception {
    // 7 nodes * 2 columns = 14 latch countdowns.
    CountDownLatch finishLatch = new CountDownLatch(14);
    IgniteEx srv1 = ignitionStart(serverConfiguration(1), finishLatch);
    ignitionStart(serverConfiguration(2), finishLatch);
    ignitionStart(serverConfiguration(3, true), finishLatch);
    ignitionStart(clientConfiguration(4), finishLatch);
    createSqlCache(srv1);
    run(srv1, createSql);
    CountDownLatch idxLatch = blockIndexing(srv1);
    QueryField c0 = c("ID", Integer.class.getName());
    QueryField c1 = c("NAME", String.class.getName());
    QueryField c2 = c("age", Integer.class.getName());
    QueryField c3 = c("city", String.class.getName());
    IgniteInternalFuture<?> colFut1 = addCols(srv1, QueryUtils.DFLT_SCHEMA, c2);
    IgniteInternalFuture<?> colFut2 = dropCols(srv1, QueryUtils.DFLT_SCHEMA, c1.name());
    IgniteInternalFuture<?> colFut3 = addCols(srv1, QueryUtils.DFLT_SCHEMA, c3);
    U.await(idxLatch);
    // Start even more nodes of different flavors
    ignitionStart(serverConfiguration(5), finishLatch);
    ignitionStart(serverConfiguration(6, true), finishLatch);
    ignitionStart(clientConfiguration(7), finishLatch);
    assert !colFut1.isDone();
    assert !colFut2.isDone();
    assert !colFut3.isDone();
    unblockIndexing(srv1);
    colFut1.get();
    colFut2.get();
    colFut3.get();
    U.await(finishLatch);
    checkTableState(srv1, QueryUtils.DFLT_SCHEMA, TBL_NAME, c0, c2, c3);
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) QueryField(org.apache.ignite.internal.processors.query.QueryField) IgniteEx(org.apache.ignite.internal.IgniteEx) CountDownLatch(java.util.concurrent.CountDownLatch)

Example 32 with IgniteEx

use of org.apache.ignite.internal.IgniteEx in project ignite by apache.

the class GridPartitionedCacheJtaLookupClassNameSelfTest method testIncompatibleTmLookup.

/**
 */
@IgniteIgnore(value = "https://issues.apache.org/jira/browse/IGNITE-1094", forceFailure = true)
public void testIncompatibleTmLookup() {
    final IgniteEx ignite = grid(0);
    final CacheConfiguration cacheCfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
    cacheCfg.setName("Foo");
    cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
    cacheCfg.setTransactionManagerLookupClassName(TestTmLookup2.class.getName());
    GridTestUtils.assertThrows(log, new Callable<Object>() {

        @Override
        public Object call() throws IgniteException {
            ignite.createCache(cacheCfg);
            return null;
        }
    }, IgniteException.class, null);
}
Also used : IgniteException(org.apache.ignite.IgniteException) IgniteEx(org.apache.ignite.internal.IgniteEx) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration) IgniteIgnore(org.apache.ignite.testsuites.IgniteIgnore)

Example 33 with IgniteEx

use of org.apache.ignite.internal.IgniteEx in project ignite by apache.

the class IgfsProcessorSelfTest method beforeTest.

/**
 * {@inheritDoc}
 */
@Override
protected void beforeTest() throws Exception {
    IgniteEx grid = grid(0);
    igfs = grid.fileSystem(igfsName());
    FileSystemConfiguration[] cfgs = grid.configuration().getFileSystemConfiguration();
    assert cfgs.length == 1;
    metaCacheName = cfgs[0].getMetaCacheConfiguration().getName();
    metaCache = ((IgniteKernal) grid).internalCache(metaCacheName);
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration)

Example 34 with IgniteEx

use of org.apache.ignite.internal.IgniteEx in project ignite by apache.

the class IgfsProcessorValidationSelfTest method testPreConfiguredCache.

/**
 * @throws Exception If failed.
 */
public void testPreConfiguredCache() throws Exception {
    FileSystemConfiguration igfsCfg1 = new FileSystemConfiguration(g1IgfsCfg1);
    igfsCfg1.setName("igfs");
    g1Cfg.setFileSystemConfiguration(igfsCfg1);
    CacheConfiguration ccfgData = dataCache(1024);
    ccfgData.setRebalanceTimeout(10001);
    CacheConfiguration ccfgMeta = metaCache();
    ccfgMeta.setRebalanceTimeout(10002);
    igfsCfg1.setDataCacheConfiguration(ccfgData);
    igfsCfg1.setMetaCacheConfiguration(ccfgMeta);
    IgniteEx g = (IgniteEx) G.start(g1Cfg);
    assertEquals(10001, g.cachex(g.igfsx("igfs").configuration().getDataCacheConfiguration().getName()).configuration().getRebalanceTimeout());
    assertEquals(10002, g.cachex(g.igfsx("igfs").configuration().getMetaCacheConfiguration().getName()).configuration().getRebalanceTimeout());
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) FileSystemConfiguration(org.apache.ignite.configuration.FileSystemConfiguration) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 35 with IgniteEx

use of org.apache.ignite.internal.IgniteEx in project ignite by apache.

the class H2DynamicTableSelfTest method testDropTable.

/**
 * Test that {@code DROP TABLE} actually removes specified cache and type descriptor on all nodes.
 * @throws Exception if failed.
 */
public void testDropTable() throws Exception {
    execute("CREATE TABLE IF NOT EXISTS \"Person\" (\"id\" int, \"city\" varchar," + " \"name\" varchar, \"surname\" varchar, \"age\" int, PRIMARY KEY (\"id\", \"city\")) WITH " + "\"template=cache\"");
    execute("DROP TABLE \"Person\"");
    for (int i = 0; i < 4; i++) {
        IgniteEx node = grid(i);
        assertNull(node.cache("Person"));
        QueryTypeDescriptorImpl desc = type(node, "Person", "Person");
        assertNull(desc);
    }
}
Also used : QueryTypeDescriptorImpl(org.apache.ignite.internal.processors.query.QueryTypeDescriptorImpl) IgniteEx(org.apache.ignite.internal.IgniteEx)

Aggregations

IgniteEx (org.apache.ignite.internal.IgniteEx)396 Ignite (org.apache.ignite.Ignite)85 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)64 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)60 IgniteException (org.apache.ignite.IgniteException)46 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)37 Transaction (org.apache.ignite.transactions.Transaction)34 ArrayList (java.util.ArrayList)31 HashMap (java.util.HashMap)31 CountDownLatch (java.util.concurrent.CountDownLatch)28 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)27 IgniteCache (org.apache.ignite.IgniteCache)25 Map (java.util.Map)24 ClusterNode (org.apache.ignite.cluster.ClusterNode)20 CacheException (javax.cache.CacheException)19 GridCacheDatabaseSharedManager (org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager)19 UUID (java.util.UUID)18 Callable (java.util.concurrent.Callable)17 List (java.util.List)16 Random (java.util.Random)16