use of org.apache.ignite.configuration.MemoryConfiguration in project ignite by apache.
the class MemoryPolicyInitializationTest method prepareCustomConfigWithOverridingDefaultAndCustom.
/**
*
*/
private void prepareCustomConfigWithOverridingDefaultAndCustom() {
memCfg = new MemoryConfiguration();
memCfg.setMemoryPolicies(new MemoryPolicyConfiguration().setName(DFLT_MEM_PLC_DEFAULT_NAME).setInitialSize(USER_CUSTOM_MEM_PLC_SIZE).setMaxSize(USER_DEFAULT_MEM_PLC_SIZE), new MemoryPolicyConfiguration().setName(CUSTOM_NON_DEFAULT_MEM_PLC_NAME).setInitialSize(USER_CUSTOM_MEM_PLC_SIZE).setMaxSize(USER_CUSTOM_MEM_PLC_SIZE));
}
use of org.apache.ignite.configuration.MemoryConfiguration in project ignite by apache.
the class MemoryPolicyInitializationTest method prepareCustomNoDefaultConfig.
/**
*
*/
private void prepareCustomNoDefaultConfig() {
memCfg = new MemoryConfiguration();
memCfg.setMemoryPolicies(new MemoryPolicyConfiguration().setName(CUSTOM_NON_DEFAULT_MEM_PLC_NAME).setInitialSize(USER_CUSTOM_MEM_PLC_SIZE).setMaxSize(USER_CUSTOM_MEM_PLC_SIZE));
}
use of org.apache.ignite.configuration.MemoryConfiguration in project ignite by apache.
the class MemoryPolicyInitializationTest method prepareCustomConfigWithOverriddenDefaultName.
/**
*
*/
private void prepareCustomConfigWithOverriddenDefaultName() {
memCfg = new MemoryConfiguration();
memCfg.setDefaultMemoryPolicyName(CUSTOM_NON_DEFAULT_MEM_PLC_NAME);
memCfg.setMemoryPolicies(new MemoryPolicyConfiguration().setName(CUSTOM_NON_DEFAULT_MEM_PLC_NAME).setInitialSize(USER_CUSTOM_MEM_PLC_SIZE).setMaxSize(USER_CUSTOM_MEM_PLC_SIZE), new MemoryPolicyConfiguration().setName(DFLT_MEM_PLC_DEFAULT_NAME).setInitialSize(USER_CUSTOM_MEM_PLC_SIZE).setMaxSize(USER_DEFAULT_MEM_PLC_SIZE));
}
use of org.apache.ignite.configuration.MemoryConfiguration in project ignite by apache.
the class IgniteDbDynamicCacheSelfTest method getConfiguration.
/** {@inheritDoc} */
@Override
protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
MemoryConfiguration dbCfg = new MemoryConfiguration();
MemoryPolicyConfiguration plc = new MemoryPolicyConfiguration();
plc.setName("dfltPlc");
plc.setInitialSize(200 * 1024 * 1024);
plc.setMaxSize(200 * 1024 * 1024);
dbCfg.setDefaultMemoryPolicyName("dfltPlc");
dbCfg.setMemoryPolicies(plc);
cfg.setMemoryConfiguration(dbCfg);
if (gridName.equals("client"))
cfg.setClientMode(true);
return cfg;
}
use of org.apache.ignite.configuration.MemoryConfiguration in project ignite by apache.
the class PlatformConfigurationUtils method readMemoryConfiguration.
/**
* Reads the memory configuration.
*
* @param in Reader
* @return Config.
*/
private static MemoryConfiguration readMemoryConfiguration(BinaryRawReader in) {
MemoryConfiguration res = new MemoryConfiguration();
res.setSystemCacheInitialSize(in.readLong()).setSystemCacheMaxSize(in.readLong()).setPageSize(in.readInt()).setConcurrencyLevel(in.readInt()).setDefaultMemoryPolicyName(in.readString());
int cnt = in.readInt();
if (cnt > 0) {
MemoryPolicyConfiguration[] plcs = new MemoryPolicyConfiguration[cnt];
for (int i = 0; i < cnt; i++) {
MemoryPolicyConfiguration cfg = new MemoryPolicyConfiguration();
cfg.setName(in.readString()).setInitialSize(in.readLong()).setMaxSize(in.readLong()).setSwapFilePath(in.readString()).setPageEvictionMode(DataPageEvictionMode.values()[in.readInt()]).setEvictionThreshold(in.readDouble()).setEmptyPagesPoolSize(in.readInt()).setMetricsEnabled(in.readBoolean()).setSubIntervals(in.readInt()).setRateTimeInterval(in.readLong());
plcs[i] = cfg;
}
res.setMemoryPolicies(plcs);
}
return res;
}
Aggregations