Search in sources :

Example 1 with SharedFsCheckpointSpi

use of org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi in project ignite by apache.

the class ComputeFailoverNodeStartup method configuration.

/**
 * Create Ignite configuration with configured checkpoints.
 *
 * @return Ignite configuration.
 * @throws IgniteException If configuration creation failed.
 */
public static IgniteConfiguration configuration() throws IgniteException {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setLocalHost("127.0.0.1");
    cfg.setPeerClassLoadingEnabled(true);
    // Configure checkpoint SPI.
    SharedFsCheckpointSpi checkpointSpi = new SharedFsCheckpointSpi();
    checkpointSpi.setDirectoryPaths(Collections.singletonList("work/checkpoint/sharedfs"));
    cfg.setCheckpointSpi(checkpointSpi);
    // Configure discovery SPI.
    TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
    TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
    ipFinder.setAddresses(Arrays.asList("127.0.0.1:47500..47509"));
    discoSpi.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(discoSpi);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) SharedFsCheckpointSpi(org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi) TcpDiscoveryVmIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 2 with SharedFsCheckpointSpi

use of org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi in project ignite by apache.

the class GridAbstractTest method getConfiguration.

/**
 * This method should be overridden by subclasses to change configuration parameters.
 *
 * @return Grid configuration used for starting of grid.
 * @param igniteInstanceName Ignite instance name.
 * @param rsrcs Resources.
 * @throws Exception If failed.
 */
@SuppressWarnings("deprecation")
protected IgniteConfiguration getConfiguration(String igniteInstanceName, IgniteTestResources rsrcs) throws Exception {
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setIgniteInstanceName(igniteInstanceName);
    cfg.setGridLogger(rsrcs.getLogger());
    cfg.setMarshaller(rsrcs.getMarshaller());
    cfg.setNodeId(rsrcs.getNodeId());
    cfg.setIgniteHome(rsrcs.getIgniteHome());
    cfg.setMBeanServer(rsrcs.getMBeanServer());
    cfg.setPeerClassLoadingEnabled(true);
    cfg.setMetricsLogFrequency(0);
    cfg.setConnectorConfiguration(null);
    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
    commSpi.setLocalPort(GridTestUtils.getNextCommPort(getClass()));
    commSpi.setTcpNoDelay(true);
    cfg.setCommunicationSpi(commSpi);
    TcpDiscoverySpi discoSpi = new TestTcpDiscoverySpi();
    if (isDebug()) {
        cfg.setFailureDetectionTimeout(Integer.MAX_VALUE);
        cfg.setNetworkTimeout(Long.MAX_VALUE / 3);
    } else {
        // Set network timeout to 10 sec to avoid unexpected p2p class loading errors.
        cfg.setNetworkTimeout(10_000);
        cfg.setFailureDetectionTimeout(10_000);
        cfg.setClientFailureDetectionTimeout(10_000);
    }
    // Set metrics update interval to 1 second to speed up tests.
    cfg.setMetricsUpdateFrequency(1000);
    String mcastAddr = GridTestUtils.getNextMulticastGroup(getClass());
    TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
    ipFinder.setAddresses(Collections.singleton("127.0.0.1:" + TcpDiscoverySpi.DFLT_PORT));
    if (!F.isEmpty(mcastAddr)) {
        ipFinder.setMulticastGroup(mcastAddr);
        ipFinder.setMulticastPort(GridTestUtils.getNextMulticastPort(getClass()));
    }
    discoSpi.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(discoSpi);
    SharedFsCheckpointSpi cpSpi = new SharedFsCheckpointSpi();
    Collection<String> paths = new ArrayList<>();
    paths.add(getDefaultCheckpointPath(cfg.getMarshaller()));
    cpSpi.setDirectoryPaths(paths);
    cfg.setCheckpointSpi(cpSpi);
    cfg.setEventStorageSpi(new MemoryEventStorageSpi());
    cfg.setIncludeEventTypes(EventType.EVTS_ALL);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) TcpDiscoveryMulticastIpFinder(org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder) SharedFsCheckpointSpi(org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi) ArrayList(java.util.ArrayList) MemoryEventStorageSpi(org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi) TestTcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi) TcpCommunicationSpi(org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi) TestTcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi) TcpDiscoverySpi(org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)

Example 3 with SharedFsCheckpointSpi

use of org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi in project ignite by apache.

the class GridManagerStopSelfTest method testStopCheckpointManager.

/**
 * @throws Exception If failed.
 */
public void testStopCheckpointManager() throws Exception {
    SharedFsCheckpointSpi spi = new SharedFsCheckpointSpi();
    injectLogger(spi);
    ctx.config().setCheckpointSpi(spi);
    GridCheckpointManager mgr = new GridCheckpointManager(ctx);
    mgr.stop(true);
}
Also used : GridCheckpointManager(org.apache.ignite.internal.managers.checkpoint.GridCheckpointManager) SharedFsCheckpointSpi(org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi)

Example 4 with SharedFsCheckpointSpi

use of org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi in project ignite by apache.

the class GridSessionCheckpointSelfTest method testSharedFsCheckpoint.

/**
 * @throws Exception If failed.
 */
public void testSharedFsCheckpoint() throws Exception {
    IgniteConfiguration cfg = getConfiguration();
    cfg.setCheckpointSpi(spi = new SharedFsCheckpointSpi());
    checkCheckpoints(cfg);
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) SharedFsCheckpointSpi(org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi)

Aggregations

SharedFsCheckpointSpi (org.apache.ignite.spi.checkpoint.sharedfs.SharedFsCheckpointSpi)4 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)3 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)2 ArrayList (java.util.ArrayList)1 GridCheckpointManager (org.apache.ignite.internal.managers.checkpoint.GridCheckpointManager)1 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)1 TestTcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TestTcpDiscoverySpi)1 TcpDiscoveryMulticastIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder)1 TcpDiscoveryVmIpFinder (org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder)1 MemoryEventStorageSpi (org.apache.ignite.spi.eventstorage.memory.MemoryEventStorageSpi)1