Search in sources :

Example 26 with StopNodeFailureHandler

use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.

the class BasicIndexTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    assertNotNull(inlineSize);
    for (QueryIndex index : indexes) index.setInlineSize(inlineSize);
    IgniteConfiguration igniteCfg = super.getConfiguration(igniteInstanceName);
    igniteCfg.setConsistentId(igniteInstanceName);
    if (igniteInstanceName.startsWith(CLIENT_NAME) && clientLog != null)
        igniteCfg.setGridLogger(clientLog);
    else if (srvLog != null)
        igniteCfg.setGridLogger(srvLog);
    LinkedHashMap<String, String> fields = new LinkedHashMap<>();
    fields.put("keyStr", String.class.getName());
    fields.put("keyLong", Long.class.getName());
    fields.put("keyPojo", Pojo.class.getName());
    fields.put("valStr", String.class.getName());
    fields.put("valLong", Long.class.getName());
    fields.put("valPojo", Pojo.class.getName());
    if (!createIdx)
        indexes = Collections.emptyList();
    CacheConfiguration<Key, Val> ccfg = new CacheConfiguration<Key, Val>(DEFAULT_CACHE_NAME).setAffinity(new RendezvousAffinityFunction(false, 32)).setQueryEntities(Collections.singleton(new QueryEntity().setKeyType(Key.class.getName()).setValueType(Val.class.getName()).setFields(fields).setKeyFields(new HashSet<>(Arrays.asList("keyStr", "keyLong", "keyPojo"))).setIndexes(indexes).setAliases(Collections.singletonMap(QueryUtils.KEY_FIELD_NAME, "pk_id")))).setSqlIndexMaxInlineSize(inlineSize);
    if (createStaticCache)
        igniteCfg.setCacheConfiguration(ccfg);
    if (srvLog != null)
        igniteCfg.setGridLogger(srvLog);
    if (isPersistenceEnabled) {
        igniteCfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setMaxSize(10 * 1024 * 1024)));
    }
    return igniteCfg.setFailureHandler(new StopNodeFailureHandler());
}
Also used : StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler) QueryEntity(org.apache.ignite.cache.QueryEntity) LinkedHashMap(java.util.LinkedHashMap) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) QueryIndex(org.apache.ignite.cache.QueryIndex) RendezvousAffinityFunction(org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction) HashSet(java.util.HashSet)

Example 27 with StopNodeFailureHandler

use of org.apache.ignite.failure.StopNodeFailureHandler in project ignite by apache.

the class DynamicIndexAbstractSelfTest method commonConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration commonConfiguration(int idx) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(getTestIgniteInstanceName(idx));
    cfg.setFailureHandler(new StopNodeFailureHandler());
    cfg.setMarshaller(new BinaryMarshaller());
    DataStorageConfiguration memCfg = new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(128L * 1024 * 1024));
    cfg.setDataStorageConfiguration(memCfg);
    return optimize(cfg);
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BinaryMarshaller(org.apache.ignite.internal.binary.BinaryMarshaller) StopNodeFailureHandler(org.apache.ignite.failure.StopNodeFailureHandler)

Aggregations

StopNodeFailureHandler (org.apache.ignite.failure.StopNodeFailureHandler)27 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)23 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)18 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)16 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)8 RendezvousAffinityFunction (org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction)6 TransactionConfiguration (org.apache.ignite.configuration.TransactionConfiguration)4 TestRecordingCommunicationSpi (org.apache.ignite.internal.TestRecordingCommunicationSpi)4 LinkedHashMap (java.util.LinkedHashMap)3 TcpCommunicationSpi (org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi)3 HashMap (java.util.HashMap)2 Ignite (org.apache.ignite.Ignite)2 BinaryBasicNameMapper (org.apache.ignite.binary.BinaryBasicNameMapper)2 AtomicConfiguration (org.apache.ignite.configuration.AtomicConfiguration)2 BinaryConfiguration (org.apache.ignite.configuration.BinaryConfiguration)2 ExecutorConfiguration (org.apache.ignite.configuration.ExecutorConfiguration)2 NoOpFailureHandler (org.apache.ignite.failure.NoOpFailureHandler)2 StopNodeOrHaltFailureHandler (org.apache.ignite.failure.StopNodeOrHaltFailureHandler)2 IgniteEx (org.apache.ignite.internal.IgniteEx)2 PlatformDotNetBinaryConfiguration (org.apache.ignite.platform.dotnet.PlatformDotNetBinaryConfiguration)2