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;
}
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;
}
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);
}
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);
}
Aggregations