Search in sources :

Example 21 with MemoryConfiguration

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));
}
Also used : MemoryConfiguration(org.apache.ignite.configuration.MemoryConfiguration) MemoryPolicyConfiguration(org.apache.ignite.configuration.MemoryPolicyConfiguration)

Example 22 with MemoryConfiguration

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));
}
Also used : MemoryConfiguration(org.apache.ignite.configuration.MemoryConfiguration) MemoryPolicyConfiguration(org.apache.ignite.configuration.MemoryPolicyConfiguration)

Example 23 with MemoryConfiguration

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));
}
Also used : MemoryConfiguration(org.apache.ignite.configuration.MemoryConfiguration) MemoryPolicyConfiguration(org.apache.ignite.configuration.MemoryPolicyConfiguration)

Example 24 with MemoryConfiguration

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;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) MemoryConfiguration(org.apache.ignite.configuration.MemoryConfiguration) MemoryPolicyConfiguration(org.apache.ignite.configuration.MemoryPolicyConfiguration)

Example 25 with MemoryConfiguration

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;
}
Also used : MemoryConfiguration(org.apache.ignite.configuration.MemoryConfiguration) MemoryPolicyConfiguration(org.apache.ignite.configuration.MemoryPolicyConfiguration)

Aggregations

MemoryConfiguration (org.apache.ignite.configuration.MemoryConfiguration)28 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)17 MemoryPolicyConfiguration (org.apache.ignite.configuration.MemoryPolicyConfiguration)14 TcpDiscoverySpi (org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi)11 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)10 NearCacheConfiguration (org.apache.ignite.configuration.NearCacheConfiguration)3 IgniteOutOfMemoryException (org.apache.ignite.internal.mem.IgniteOutOfMemoryException)3 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)2 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)2 IgniteEx (org.apache.ignite.internal.IgniteEx)2 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)2 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 Socket (java.net.Socket)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 AffinityKey (org.apache.ignite.cache.affinity.AffinityKey)1 LruEvictionPolicy (org.apache.ignite.cache.eviction.lru.LruEvictionPolicy)1 ConnectorConfiguration (org.apache.ignite.configuration.ConnectorConfiguration)1 FileSystemConfiguration (org.apache.ignite.configuration.FileSystemConfiguration)1 TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)1