Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setAtomicConfiguration()
The following examples show how to use
org.apache.ignite.configuration.IgniteConfiguration#setAtomicConfiguration() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GridCachePartitionedNodeRestartTxSelfTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration cacheCfg = defaultCacheConfiguration(); cacheCfg.setCacheMode(PARTITIONED); cacheCfg.setWriteSynchronizationMode(FULL_SYNC); cacheCfg.setAtomicityMode(TRANSACTIONAL); cacheCfg.setRebalanceMode(SYNC); cacheCfg.setBackups(1); cfg.setCacheConfiguration(cacheCfg); AtomicConfiguration atomicCfg = new AtomicConfiguration(); atomicCfg.setCacheMode(PARTITIONED); atomicCfg.setGroupName("testGroup"); atomicCfg.setBackups(1); cfg.setAtomicConfiguration(atomicCfg); return cfg; }
Example 2
Source File: GridCachePartitionedAtomicLongLoadTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration c = super.getConfiguration(igniteInstanceName); AtomicConfiguration atomicCfg = new AtomicConfiguration(); atomicCfg.setCacheMode(PARTITIONED); atomicCfg.setBackups(1); atomicCfg.setAtomicSequenceReserveSize(10); c.setAtomicConfiguration(atomicCfg); c.getTransactionConfiguration().setDefaultTxConcurrency(PESSIMISTIC); c.getTransactionConfiguration().setDefaultTxIsolation(REPEATABLE_READ); CacheConfiguration cc = defaultCacheConfiguration(); cc.setCacheMode(CacheMode.PARTITIONED); cc.setRebalanceMode(CacheRebalanceMode.SYNC); cc.setWriteSynchronizationMode(FULL_SYNC); LruEvictionPolicy plc = new LruEvictionPolicy(); plc.setMaxSize(1000); cc.setEvictionPolicy(plc); cc.setOnheapCacheEnabled(true); cc.setBackups(1); cc.setAffinity(new RendezvousAffinityFunction(true)); c.setCacheConfiguration(cc); return c; }
Example 3
Source File: IgniteSequenceInternalCleanupTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setMetricsUpdateFrequency(10); cfg.setActiveOnStart(false); AtomicConfiguration atomicCfg = atomicConfiguration(); assertNotNull(atomicCfg); cfg.setAtomicConfiguration(atomicCfg); List<CacheConfiguration> cacheCfg = new ArrayList<>(); for (int i = 0; i < CACHES_CNT; i++) { cacheCfg.add(new CacheConfiguration("test" + i). setStatisticsEnabled(true). setCacheMode(PARTITIONED). setAtomicityMode(TRANSACTIONAL). setAffinity(new RendezvousAffinityFunction(false, 16))); } cfg.setCacheConfiguration(cacheCfg.toArray(new CacheConfiguration[cacheCfg.size()])); return cfg; }
Example 4
Source File: GridCacheConcurrentTxMultiNodeLoadTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration c = super.getConfiguration(igniteInstanceName); c.getTransactionConfiguration().setDefaultTxConcurrency(PESSIMISTIC); c.getTransactionConfiguration().setDefaultTxIsolation(REPEATABLE_READ); AtomicConfiguration atomicCfg = new AtomicConfiguration(); atomicCfg.setAtomicSequenceReserveSize(100000); atomicCfg.setCacheMode(mode); c.setAtomicConfiguration(atomicCfg); if (cacheOn) { CacheConfiguration cc = defaultCacheConfiguration(); cc.setCacheMode(mode); LruEvictionPolicy plc = new LruEvictionPolicy(); plc.setMaxSize(1000); cc.setEvictionPolicy(plc); cc.setOnheapCacheEnabled(true); cc.setWriteSynchronizationMode(FULL_SYNC); cc.setRebalanceMode(NONE); c.setCacheConfiguration(cc); } else c.setCacheConfiguration(); c.setPeerClassLoadingEnabled(false); return c; }
Example 5
Source File: IgniteClientReconnectAtomicsWithLostPartitionsTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); String consistentId = "consistent-id-" + igniteInstanceName.charAt(igniteInstanceName.length() - 1); cfg.setConsistentId(consistentId); AtomicConfiguration atomicCfg = new AtomicConfiguration() .setBackups(0) .setAffinity(new RendezvousAffinityFunction(false, 32)); cfg.setAtomicConfiguration(atomicCfg); return cfg; }
Example 6
Source File: GridCacheAbstractDataStructuresFailoverSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); AtomicConfiguration atomicCfg = new AtomicConfiguration(); atomicCfg.setCacheMode(collectionCacheMode()); atomicCfg.setBackups(collectionConfiguration().getBackups()); cfg.setAtomicConfiguration(atomicCfg); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setName(TRANSACTIONAL_CACHE_NAME); ccfg.setAtomicityMode(TRANSACTIONAL); cfg.setCacheConfiguration(ccfg); if (cfg.isClientMode() == TRUE) ((TcpDiscoverySpi)(cfg.getDiscoverySpi())).setForceServerMode(true); return cfg; }
Example 7
Source File: IgniteCachePutRetryAbstractSelfTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setIncludeEventTypes(); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); AtomicConfiguration acfg = new AtomicConfiguration(); acfg.setBackups(1); cfg.setAtomicConfiguration(acfg); cfg.setIncludeEventTypes(new int[0]); return cfg; }
Example 8
Source File: GridCommandHandlerAbstractTest.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (atomicConfiguration != null) cfg.setAtomicConfiguration(atomicConfiguration); cfg.setCommunicationSpi(new TestRecordingCommunicationSpi()); cfg.setConnectorConfiguration(new ConnectorConfiguration().setSslEnabled(sslEnabled())); if (sslEnabled()) cfg.setSslContextFactory(GridTestUtils.sslFactory()); DataStorageConfiguration dsCfg = new DataStorageConfiguration() .setWalMode(WALMode.LOG_ONLY) .setCheckpointFrequency(checkpointFreq) .setDefaultDataRegionConfiguration( new DataRegionConfiguration().setMaxSize(50L * 1024 * 1024).setPersistenceEnabled(persistent) ); if (dataRegionConfiguration != null) dsCfg.setDataRegionConfigurations(dataRegionConfiguration); cfg.setDataStorageConfiguration(dsCfg); cfg.setConsistentId(igniteInstanceName); cfg.setClientMode(igniteInstanceName.startsWith(CLIENT_NODE_NAME_PREFIX)); if (encriptionEnabled) { KeystoreEncryptionSpi encSpi = new KeystoreEncryptionSpi(); encSpi.setKeyStorePath(KEYSTORE_PATH); encSpi.setKeyStorePassword(KEYSTORE_PASSWORD.toCharArray()); cfg.setEncryptionSpi(encSpi); } return cfg; }
Example 9
Source File: IgniteDataStructureUniqueNameTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); AtomicConfiguration atomicCfg = new AtomicConfiguration(); atomicCfg.setBackups(1); atomicCfg.setCacheMode(PARTITIONED); cfg.setAtomicConfiguration(atomicCfg); return cfg; }
Example 10
Source File: SemaphoreFailoverSafeReleasePermitsTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); AtomicConfiguration atomicCfg = atomicConfiguration(); assertNotNull(atomicCfg); cfg.setAtomicConfiguration(atomicCfg); return cfg; }
Example 11
Source File: GridCachePartitionedAtomicSequenceTxSelfTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setPublicThreadPoolSize(THREAD_NUM); AtomicConfiguration atomicCfg = atomicConfiguration(); assertNotNull(atomicCfg); cfg.setAtomicConfiguration(atomicCfg); return cfg; }
Example 12
Source File: SemaphoreFailoverNoWaitingAcquirerTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); AtomicConfiguration atomicCfg = atomicConfiguration(); assertNotNull(atomicCfg); cfg.setAtomicConfiguration(atomicCfg); return cfg; }
Example 13
Source File: IgniteAtomicsAbstractTest.java From ignite with Apache License 2.0 | 3 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); AtomicConfiguration atomicCfg = atomicConfiguration(); assertNotNull(atomicCfg); cfg.setAtomicConfiguration(atomicCfg); return cfg; }