Search in sources :

Example 6 with JavaLogger

use of org.apache.ignite.logger.java.JavaLogger in project ignite by apache.

the class GridStartupWithUndefinedIgniteHomeSelfTest method testStartStopWithUndefinedIgniteHome.

/**
 * @throws Exception If failed.
 */
public void testStartStopWithUndefinedIgniteHome() throws Exception {
    IgniteUtils.nullifyHomeDirectory();
    // We can't use U.getIgniteHome() here because
    // it will initialize cached value which is forbidden to override.
    String igniteHome = IgniteSystemProperties.getString(IGNITE_HOME);
    assert igniteHome != null;
    U.setIgniteHome(null);
    String igniteHome0 = U.getIgniteHome();
    assert igniteHome0 == null;
    IgniteLogger log = new JavaLogger();
    log.info(">>> Test started: " + getName());
    log.info("Grid start-stop test count: " + GRID_COUNT);
    for (int i = 0; i < GRID_COUNT; i++) {
        TcpDiscoverySpi disc = new TcpDiscoverySpi();
        disc.setIpFinder(IP_FINDER);
        IgniteConfiguration cfg = new IgniteConfiguration();
        // Default console logger is used
        cfg.setGridLogger(log);
        cfg.setDiscoverySpi(disc);
        cfg.setConnectorConfiguration(null);
        try (Ignite ignite = G.start(cfg)) {
            assert ignite != null;
            igniteHome0 = U.getIgniteHome();
            assert igniteHome0 == null;
            X.println("Stopping grid " + ignite.cluster().localNode().id());
        }
    }
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) Ignite(org.apache.ignite.Ignite) IgniteLogger(org.apache.ignite.IgniteLogger) JavaLogger(org.apache.ignite.logger.java.JavaLogger) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Aggregations

JavaLogger (org.apache.ignite.logger.java.JavaLogger)6 OutputStream (java.io.OutputStream)2 UnsafeMemoryProvider (org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)2 FileOutputStream (java.io.FileOutputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 PrintWriter (java.io.PrintWriter)1 HashMap (java.util.HashMap)1 Random (java.util.Random)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 Ignite (org.apache.ignite.Ignite)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteLogger (org.apache.ignite.IgniteLogger)1 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)1 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)1 DirectMemoryRegion (org.apache.ignite.internal.mem.DirectMemoryRegion)1 PageMemory (org.apache.ignite.internal.pagemem.PageMemory)1 PageMemoryNoStoreImpl (org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl)1 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)1 FullPageIdTable (org.apache.ignite.internal.processors.cache.persistence.pagemem.FullPageIdTable)1 IpcEndpoint (org.apache.ignite.internal.util.ipc.IpcEndpoint)1