use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class AuthenticationProcessorSelfTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
if (getTestIgniteInstanceIndex(igniteInstanceName) == CLI_NODE)
cfg.setClientMode(true);
TcpDiscoverySpi spi = new TcpDiscoverySpi();
spi.setIpFinder(IP_FINDER);
cfg.setDiscoverySpi(spi);
cfg.setAuthenticationEnabled(true);
cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class CacheConfigurationLeakTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration() throws Exception {
IgniteConfiguration cfg = super.getConfiguration();
DataStorageConfiguration memCfg = new DataStorageConfiguration();
DataRegionConfiguration plc = new DataRegionConfiguration();
plc.setName("dfltPlc");
plc.setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_MAX_SIZE * 10);
memCfg.setDefaultDataRegionConfiguration(plc);
cfg.setDataStorageConfiguration(memCfg);
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class CacheDataRegionConfigurationTest method testProperlySizedMemoryPolicy.
/**
* Verifies that with enough memory allocated adding values to cache doesn't cause any exceptions.
*/
public void testProperlySizedMemoryPolicy() throws Exception {
memCfg = new DataStorageConfiguration();
DataRegionConfiguration dfltPlcCfg = new DataRegionConfiguration();
dfltPlcCfg.setName("dfltPlc");
dfltPlcCfg.setInitialSize(DFLT_MEM_PLC_SIZE);
dfltPlcCfg.setMaxSize(DFLT_MEM_PLC_SIZE);
DataRegionConfiguration bigPlcCfg = new DataRegionConfiguration();
bigPlcCfg.setName("bigPlc");
bigPlcCfg.setMaxSize(BIG_MEM_PLC_SIZE);
memCfg.setDataRegionConfigurations(bigPlcCfg);
memCfg.setDefaultDataRegionConfiguration(dfltPlcCfg);
ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
ccfg.setDataRegionName("bigPlc");
IgniteEx ignite0 = startGrid(0);
IgniteCache<Object, Object> cache = ignite0.cache(DEFAULT_CACHE_NAME);
try {
for (int i = 0; i < 500_000; i++) cache.put(i, "abc");
} catch (Exception e) {
fail("With properly sized DataRegion no exceptions are expected to be thrown.");
}
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class CacheMetricsEnableRuntimeTest method getConfiguration.
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
((TcpDiscoverySpi) cfg.getDiscoverySpi()).setIpFinder(ipFinder);
CacheConfiguration cacheCfg = new CacheConfiguration().setName(CACHE1).setGroupName(GROUP).setCacheMode(CacheMode.PARTITIONED).setAtomicityMode(CacheAtomicityMode.ATOMIC);
cfg.setCacheConfiguration(cacheCfg);
if (persistence)
cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)).setWalMode(WALMode.LOG_ONLY));
return cfg;
}
use of org.apache.ignite.configuration.DataRegionConfiguration in project ignite by apache.
the class CacheLateAffinityAssignmentTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
TestRecordingCommunicationSpi commSpi;
if (spiC != null)
commSpi = spiC.apply(igniteInstanceName);
else
commSpi = new TestRecordingCommunicationSpi();
commSpi.setSharedMemoryPort(-1);
cfg.setCommunicationSpi(commSpi);
TestTcpDiscoverySpi discoSpi = new TestTcpDiscoverySpi();
discoSpi.setForceServerMode(forceSrvMode);
discoSpi.setIpFinder(ipFinder);
discoSpi.setNetworkTimeout(60_000);
cfg.setDiscoverySpi(discoSpi);
cfg.setClientFailureDetectionTimeout(100000);
CacheConfiguration[] ccfg;
if (cacheC != null)
ccfg = cacheC.apply(igniteInstanceName);
else
ccfg = new CacheConfiguration[] { cacheConfiguration() };
if (ccfg != null)
cfg.setCacheConfiguration(ccfg);
if (clientC != null) {
client = clientC.apply(igniteInstanceName);
discoSpi.setJoinTimeout(30_000);
}
DataStorageConfiguration cfg1 = new DataStorageConfiguration();
cfg1.setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(150 * 1024 * 1024L));
cfg.setDataStorageConfiguration(cfg1);
cfg.setClientMode(client);
return cfg;
}
Aggregations