Search in sources :

Example 1 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class SqlListenerProcessorValidationSelfTest method check.

/**
     * Perform check.
     *
     * @param odbcCfg ODBC configuration.
     * @param success Success flag. * @throws Exception If failed.
     */
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
private void check(OdbcConfiguration odbcCfg, boolean success) throws Exception {
    final IgniteConfiguration cfg = super.getConfiguration();
    cfg.setIgniteInstanceName(SqlListenerProcessorValidationSelfTest.class.getName() + "-" + NODE_IDX_GEN.incrementAndGet());
    cfg.setLocalHost("127.0.0.1");
    cfg.setOdbcConfiguration(odbcCfg);
    cfg.setMarshaller(new BinaryMarshaller());
    TcpDiscoverySpi spi = new TcpDiscoverySpi();
    spi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
    cfg.setDiscoverySpi(spi);
    if (success)
        startGrid(cfg.getGridName(), cfg);
    else {
        GridTestUtils.assertThrows(log, new Callable<Void>() {

            @Override
            public Void call() throws Exception {
                startGrid(cfg.getGridName(), cfg);
                return null;
            }
        }, IgniteException.class, null);
    }
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) IgniteException(org.apache.ignite.IgniteException) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 2 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class MemoryPolicyInitializationTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setMemoryConfiguration(memCfg);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 3 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class GridCacheAtomicLateAffDisabledMultiNodeFullApiSelfTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setLateAffinityAssignment(false);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 4 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class IgniteCacheP2pUnmarshallingTxErrorTest method getConfiguration.

/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setLateAffinityAssignment(false);
    if (!igniteInstanceName.endsWith("0"))
        // Allows to check GridDhtLockRequest fail.
        cfg.getCacheConfiguration()[0].setRebalanceDelay(-1);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration)

Example 5 with IgniteConfiguration

use of org.apache.ignite.configuration.IgniteConfiguration in project ignite by apache.

the class GridLog4j2InitializedTest method testLogInitialize.

/** */
public void testLogInitialize() {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName("grid" + 1);
    cfg.setNodeId(new UUID(1, 1));
    // cfg.setIgniteHome("/home/glutters/Documenti/apache-ignite/ignite-master/ignite/");
    URL xml = U.resolveIgniteUrl("config/ignite-log4j2.xml");
    IgniteLogger log;
    try {
        log = new Log4J2Logger(xml);
        // log.isQuiet();
        cfg.setGridLogger(log);
    } catch (IgniteCheckedException e) {
        e.printStackTrace();
        return;
    }
    assert log.isInfoEnabled() == true;
    if (log.isDebugEnabled())
        log.debug("This is 'debug' message.");
    log.info("This is 'info' message.");
    log.warning("This is 'warning' message.");
    log.warning("This is 'warning' message.", new Exception("It's a test warning exception"));
    log.error("This is 'error' message.");
    assert log.getLogger(GridLog4j2InitializedTest.class.getName()) instanceof Log4J2Logger;
}
Also used : IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) UUID(java.util.UUID) IgniteLogger(org.apache.ignite.IgniteLogger) URL(java.net.URL) IgniteCheckedException(org.apache.ignite.IgniteCheckedException)

Aggregations

IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)2118 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)686 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)404 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)385 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)363 Ignite (org.apache.ignite.Ignite)194 Test (org.junit.Test)182 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)161 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)127 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)123 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)105 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)98 IgniteEx (org.apache.ignite.internal.IgniteEx)95 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)89 IgniteException (org.apache.ignite.IgniteException)78 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)75 BinaryMarshaller (org.apache.ignite.internal.binary.BinaryMarshaller)72 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)68 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)65 ArrayList (java.util.ArrayList)55