org.apache.ignite.configuration.DataStorageConfiguration Java Examples
The following examples show how to use
org.apache.ignite.configuration.DataStorageConfiguration.
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: IgnitePdsSpuriousRebalancingOnNodeJoinTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setCommunicationSpi(new TestRecordingCommunicationSpi()); cfg.setConsistentId(igniteInstanceName); DataStorageConfiguration dsCfg = new DataStorageConfiguration(); dsCfg.setWalSegmentSize(4 * 1024 * 1024); dsCfg.setPageSize(1024); dsCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration(). setInitialSize(100L * 1024 * 1024). setMaxSize(200L * 1024 * 1024). setPersistenceEnabled(true)); cfg.setDataStorageConfiguration(dsCfg); cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME). setAtomicityMode(TRANSACTIONAL). setCacheMode(REPLICATED). setAffinity(new RendezvousAffinityFunction(false, PARTS))); return cfg; }
Example #2
Source File: PersistenceBasicCompatibilityTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setPeerClassLoadingEnabled(false); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setPersistenceEnabled(true) .setMaxSize(DataStorageConfiguration.DFLT_DATA_REGION_INITIAL_SIZE) )); cfg.setBinaryConfiguration( new BinaryConfiguration() .setCompactFooter(compactFooter) ); return cfg; }
Example #3
Source File: IgnitePdsBinaryMetadataOnClusterRestartTest.java From ignite with Apache License 2.0 | 6 votes |
/** */ private void copyIncompatibleBinaryMetadata(String fromWorkDir, String fromConsId, String toWorkDir, String toConsId, String fileName ) throws Exception { String workDir = U.defaultWorkDirectory(); Path fromFile = Paths.get(workDir, fromWorkDir, DataStorageConfiguration.DFLT_BINARY_METADATA_PATH, fromConsId, fileName); Path toFile = Paths.get(workDir, toWorkDir, DataStorageConfiguration.DFLT_BINARY_METADATA_PATH, toConsId, fileName); Files.copy(fromFile, toFile, StandardCopyOption.REPLACE_EXISTING); }
Example #4
Source File: VisorPersistentStoreConfiguration.java From ignite with Apache License 2.0 | 6 votes |
/** * @param cfg Persistent store configuration. */ public VisorPersistentStoreConfiguration(DataStorageConfiguration cfg) { persistenceStorePath = cfg.getStoragePath(); checkpointingFreq = cfg.getCheckpointFrequency(); lockWaitTime = cfg.getLockWaitTime(); checkpointingThreads = cfg.getCheckpointThreads(); walHistSize = cfg.getWalHistorySize(); walSegments = cfg.getWalSegments(); walSegmentSize = cfg.getWalSegmentSize(); walStorePath = cfg.getWalPath(); walArchivePath = cfg.getWalArchivePath(); metricsEnabled = cfg.isMetricsEnabled(); walMode = cfg.getWalMode(); tlbSize = cfg.getWalBufferSize(); walFlushFreq = cfg.getWalFlushFrequency(); walFsyncDelay = cfg.getWalFsyncDelayNanos(); walRecordIterBuffSize = cfg.getWalRecordIteratorBufferSize(); alwaysWriteFullPages = cfg.isAlwaysWriteFullPages(); subIntervals = cfg.getMetricsSubIntervalCount(); rateTimeInterval = cfg.getMetricsRateTimeInterval(); }
Example #5
Source File: CheckpointBufferDeadlockTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setFileIOFactory(new SlowCheckpointFileIOFactory()) .setCheckpointThreads(checkpointThreads) .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setPersistenceEnabled(true) .setMaxSize(MAX_SIZE) .setCheckpointPageBufferSize(CP_BUF_SIZE) ) ); cfg.setFailureHandler(new StopNodeFailureHandler()); cfg.setGridLogger(log); return cfg; }
Example #6
Source File: WalDeletionArchiveAbstractTest.java From ignite with Apache License 2.0 | 6 votes |
/** * Start grid with override default configuration via customConfigurator. */ private Ignite startGrid(Consumer<DataStorageConfiguration> customConfigurator) throws Exception { IgniteConfiguration configuration = getConfiguration(getTestIgniteInstanceName()); DataStorageConfiguration dbCfg = new DataStorageConfiguration(); dbCfg.setWalMode(walMode()); dbCfg.setWalSegmentSize(512 * 1024); dbCfg.setCheckpointFrequency(60 * 1000);//too high value for turn off frequency checkpoint. dbCfg.setDefaultDataRegionConfiguration(new DataRegionConfiguration() .setMaxSize(100 * 1024 * 1024) .setPersistenceEnabled(true)); customConfigurator.accept(dbCfg); configuration.setDataStorageConfiguration(dbCfg); Ignite ignite = startGrid(configuration); ignite.active(true); return ignite; }
Example #7
Source File: IgniteAbstractWalIteratorInvalidCrcTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setWalSegmentSize(WAL_SEGMENT_SIZE) .setWalMode(getWalMode()) .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setPersistenceEnabled(true) ) ); cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME)); return cfg; }
Example #8
Source File: AbstractQueryOOMTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { return super.getConfiguration(igniteInstanceName) .setDataStorageConfiguration(new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration() .setPersistenceEnabled(true))) .setCacheConfiguration(new CacheConfiguration() .setName(CACHE_NAME) .setNodeFilter(new TestNodeFilter()) .setBackups(0) .setQueryParallelism(queryParallelism()) .setQueryEntities(Collections.singleton(new QueryEntity() .setTableName("test") .setKeyFieldName("ID") .setValueType(Value.class.getName()) .addQueryField("ID", Long.class.getName(), null) .addQueryField("INDEXED", Long.class.getName(), null) .addQueryField("VAL", Long.class.getName(), null) .addQueryField("STR", String.class.getName(), null) .setIndexes(Collections.singleton(new QueryIndex("INDEXED")))))) .setUserAttributes(igniteInstanceName.startsWith("remote") ? F.asMap(HAS_CACHE, true) : null); }
Example #9
Source File: IgnitePKIndexesMigrationToUnwrapPkTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override public void apply(IgniteConfiguration cfg) { cfg.setLocalHost("127.0.0.1"); TcpDiscoverySpi disco = new TcpDiscoverySpi(); disco.setIpFinder(GridCacheAbstractFullApiSelfTest.LOCAL_IP_FINDER); cfg.setDiscoverySpi(disco); cfg.setPeerClassLoadingEnabled(false); DataStorageConfiguration memCfg = new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration().setPersistenceEnabled(true) .setInitialSize(1024 * 1024 * 10).setMaxSize(1024 * 1024 * 15)) .setSystemRegionInitialSize(1024 * 1024 * 10) .setSystemRegionMaxSize(1024 * 1024 * 15); cfg.setDataStorageConfiguration(memCfg); }
Example #10
Source File: BaselineAutoAdjustTest.java From ignite with Apache License 2.0 | 6 votes |
/** * @throws Exception if failed. */ private IgniteConfiguration inMemoryConfiguration(int id) throws Exception { IgniteConfiguration conf = getConfiguration(getTestIgniteInstanceName(id)); DataStorageConfiguration storageCfg = new DataStorageConfiguration(); storageCfg.getDefaultDataRegionConfiguration() .setPersistenceEnabled(false) .setMaxSize(500L * 1024 * 1024); storageCfg.setDataRegionConfigurations(new DataRegionConfiguration() .setName("InMemoryRegion") .setPersistenceEnabled(false) .setMaxSize(500L * 1024 * 1024)); conf.setDataStorageConfiguration(storageCfg); return conf; }
Example #11
Source File: BaselineAutoAdjustTest.java From ignite with Apache License 2.0 | 6 votes |
/** * @throws Exception if failed. */ private IgniteConfiguration persistentRegionConfiguration(int id) throws Exception { IgniteConfiguration conf = getConfiguration(getTestIgniteInstanceName(id)); DataStorageConfiguration storageCfg = new DataStorageConfiguration(); storageCfg.getDefaultDataRegionConfiguration() .setPersistenceEnabled(false) .setMaxSize(500L * 1024 * 1024); storageCfg.setDataRegionConfigurations(new DataRegionConfiguration() .setName("PersistentRegion") .setPersistenceEnabled(true) .setMaxSize(500L * 1024 * 1024)); conf.setDataStorageConfiguration(storageCfg); return conf; }
Example #12
Source File: CacheIgniteOutOfMemoryExceptionTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); cfg.setDataStorageConfiguration(new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setMaxSize(DATA_REGION_SIZE) .setPageEvictionMode(DISABLED) .setPersistenceEnabled(false))); cfg.setFailureHandler(new AbstractFailureHandler() { /** {@inheritDoc} */ @Override protected boolean handle(Ignite ignite, FailureContext failureCtx) { failure.set(true); // Do not invalidate a node context. return false; } }); cfg.setCacheConfiguration(cacheConfiguration(ATOMIC), cacheConfiguration(TRANSACTIONAL)); return cfg; }
Example #13
Source File: IgniteWALTailIsReachedDuringIterationOverArchiveTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String name) throws Exception { IgniteConfiguration cfg = super.getConfiguration(name); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setWalSegmentSize(WAL_SEGMENT_SIZE) .setWalSegments(2) .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setPersistenceEnabled(true) ) ); cfg.setCacheConfiguration(new CacheConfiguration(DEFAULT_CACHE_NAME)); return cfg; }
Example #14
Source File: IgniteBaselineLockPartitionOnAffinityRunTxCacheTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setInitialSize(200L * 1024 * 1024) .setMaxSize(200L * 1024 * 1024) .setPersistenceEnabled(true) ) ); return cfg; }
Example #15
Source File: ArrayIndexTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setConsistentId(igniteInstanceName); cfg.setDataStorageConfiguration(new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration().setPersistenceEnabled(true) ) ); cfg.setCacheConfiguration( new CacheConfiguration(DEFAULT_CACHE_NAME) .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC) .setQueryEntities(Collections.singleton( new QueryEntity() .setKeyType(byte[].class.getName()) .setValueType(Integer.class.getName()) )) ); return cfg; }
Example #16
Source File: BaselineAutoAdjustTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setConsistentId(igniteInstanceName); DataStorageConfiguration storageCfg = new DataStorageConfiguration(); storageCfg.getDefaultDataRegionConfiguration() .setPersistenceEnabled(isPersistent()) .setMaxSize(500L * 1024 * 1024); storageCfg .setWalSegments(3) .setWalSegmentSize(512 * 1024); cfg.setDataStorageConfiguration(storageCfg); return cfg; }
Example #17
Source File: IgniteStableBaselineCacheRemoveFailoverTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration() .setPersistenceEnabled(true) .setInitialSize(512L * 1024 * 1024) .setMaxSize(512L * 1024 * 1024) .setCheckpointPageBufferSize(512L * 1024 * 1024) ) ); return cfg; }
Example #18
Source File: LargeEntryUpdateTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); cfg.setPublicThreadPoolSize(THREAD_COUNT); DataStorageConfiguration mem = new DataStorageConfiguration(); mem.setPageSize(PAGE_SIZE); cfg.setDataStorageConfiguration(mem); CacheConfiguration[] ccfgs = new CacheConfiguration[CACHE_COUNT]; for (int i = 0; i < CACHE_COUNT; ++i) { CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setName(CACHE_PREFIX + i); ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); ccfg.setCacheMode(CacheMode.PARTITIONED); ccfgs[i] = ccfg; } cfg.setCacheConfiguration(ccfgs); return cfg; }
Example #19
Source File: PartitionsExchangeAwareTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(IP_FINDER)); cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration( new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024))); CacheConfiguration atomicCfg = new CacheConfiguration() .setName(ATOMIC_CACHE_NAME) .setAffinity(new RendezvousAffinityFunction(false, 16)); CacheConfiguration txCfg = new CacheConfiguration() .setName(TX_CACHE_NAME) .setAffinity(new RendezvousAffinityFunction(false, 16)); cfg.setCacheConfiguration(atomicCfg, txCfg); return cfg; }
Example #20
Source File: IgniteDynamicSqlRestoreTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); cfg.setAutoActivationEnabled(false); DataStorageConfiguration memCfg = new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration().setMaxSize(200 * 1024 * 1024).setPersistenceEnabled(true)) .setWalMode(WALMode.LOG_ONLY); cfg.setDataStorageConfiguration(memCfg); cfg.setConsistentId(gridName); return cfg; }
Example #21
Source File: IgnitePdsDataRegionMetricsTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); DataStorageConfiguration memCfg = new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setInitialSize(INIT_REGION_SIZE) .setMaxSize(MAX_REGION_SIZE) .setPersistenceEnabled(true) .setMetricsEnabled(true)) .setCheckpointFrequency(1000); cfg.setDataStorageConfiguration(memCfg); CacheConfiguration<Object, Object> ccfg = cacheConfiguration(); cfg.setCacheConfiguration(ccfg); return cfg; }
Example #22
Source File: GridCacheUtils.java From ignite with Apache License 2.0 | 6 votes |
/** * @return {@code true} if persistence is enabled for at least one data region, {@code false} if not. */ public static boolean isPersistenceEnabled(DataStorageConfiguration cfg) { if (cfg == null) return false; DataRegionConfiguration dfltReg = cfg.getDefaultDataRegionConfiguration(); if (dfltReg == null) return false; if (dfltReg.isPersistenceEnabled()) return true; DataRegionConfiguration[] regCfgs = cfg.getDataRegionConfigurations(); if (regCfgs == null) return false; for (DataRegionConfiguration regCfg : regCfgs) { if (regCfg.isPersistenceEnabled()) return true; } return false; }
Example #23
Source File: WalDeletionArchiveAbstractTest.java From ignite with Apache License 2.0 | 6 votes |
/** * History size parameters consistency check. Should be set just one of wal history size or max wal archive size. */ @Test public void testGridDoesNotStart_BecauseBothWalHistorySizeAndMaxWalArchiveSizeUsed() throws Exception { //given: wal history size and max wal archive size are both set. IgniteConfiguration configuration = getConfiguration(getTestIgniteInstanceName()); DataStorageConfiguration dbCfg = new DataStorageConfiguration(); dbCfg.setWalHistorySize(12); dbCfg.setMaxWalArchiveSize(9); configuration.setDataStorageConfiguration(dbCfg); try { //when: start grid. startGrid(getTestIgniteInstanceName(), configuration); fail("Should be fail because both wal history size and max wal archive size was used"); } catch (IgniteException e) { //then: exception is occurrence because should be set just one parameters. assertTrue(findSourceMessage(e).startsWith("Should be used only one of wal history size or max wal archive size")); } }
Example #24
Source File: DynamicEnableIndexingAbstractTest.java From ignite with Apache License 2.0 | 6 votes |
/** */ protected IgniteConfiguration commonConfiguration(int idx) throws Exception { String gridName = getTestIgniteInstanceName(idx); IgniteConfiguration cfg = getConfiguration(gridName); cfg.setClusterStateOnStart(ClusterState.INACTIVE); DataStorageConfiguration memCfg = new DataStorageConfiguration() .setDefaultDataRegionConfiguration(new DataRegionConfiguration().setMaxSize(128 * 1024 * 1024)); cfg.setDataStorageConfiguration(memCfg); cfg.setConsistentId(gridName); cfg.setSqlSchemas(POI_SCHEMA_NAME); return optimize(cfg); }
Example #25
Source File: IgniteBaselineLockPartitionOnAffinityRunAtomicCacheTest.java From ignite with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setInitialSize(200L * 1024 * 1024) .setMaxSize(200L * 1024 * 1024) .setPersistenceEnabled(true) ) ); return cfg; }
Example #26
Source File: IgniteUidAsConsistentIdMigrationTest.java From ignite with Apache License 2.0 | 6 votes |
/** * @throws IgniteCheckedException If failed. */ private void deleteWorkFiles() throws IgniteCheckedException { boolean ok = true; if (pstStoreCustomPath != null) ok &= U.delete(pstStoreCustomPath); else ok &= U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), FilePageStoreManager.DFLT_STORE_DIR, false)); if (pstWalArchCustomPath != null) ok &= U.delete(pstWalArchCustomPath); if (pstWalStoreCustomPath != null) ok &= U.delete(pstWalStoreCustomPath); ok &= U.delete(U.resolveWorkDirectory(U.defaultWorkDirectory(), DataStorageConfiguration.DFLT_BINARY_METADATA_PATH, false)); if (failIfDeleteNotCompleted) assertTrue(ok); }
Example #27
Source File: IgniteWalReaderTest.java From ignite with Apache License 2.0 | 5 votes |
/** * @param workDir Work directory. * @param subfolderName Subfolder name. * @return WAL iterator factory. * @throws IgniteCheckedException If failed. */ @NotNull private IteratorParametersBuilder createIteratorParametersBuilder( String workDir, String subfolderName ) throws IgniteCheckedException { File binaryMeta = U.resolveWorkDirectory(workDir, DataStorageConfiguration.DFLT_BINARY_METADATA_PATH, false); File binaryMetaWithConsId = new File(binaryMeta, subfolderName); File marshallerMapping = U.resolveWorkDirectory(workDir, DataStorageConfiguration.DFLT_MARSHALLER_PATH, false); return new IteratorParametersBuilder() .binaryMetadataFileStoreDir(binaryMetaWithConsId) .marshallerMappingFileStoreDir(marshallerMapping); }
Example #28
Source File: BinaryMetadataMoveLegacyFolderTest.java From ignite with Apache License 2.0 | 5 votes |
/** * Test that marshaller directory, that was previously located in workdir's root, is successfully moving to PDS * folder. */ @Test public void testMarshallerMappingsDirectoryMigration() throws Exception { IgniteConfiguration configuration = getConfiguration(); String typeName = "TestBinaryType"; File legacyDir = U.resolveWorkDirectory( U.defaultWorkDirectory(), "marshaller", false ); // just some random type id String typeIdFile = "708045005.classname0"; File testBinaryTypeDefFile = new File(legacyDir, typeIdFile); // write typename definition to legacy folder Files.write(testBinaryTypeDefFile.toPath(), typeName.getBytes()); startGrid(configuration); // legacy marshaller mappings dir must be deleted at this moment assertFalse(legacyDir.exists()); File newDir = U.resolveWorkDirectory( U.defaultWorkDirectory(), DataStorageConfiguration.DFLT_MARSHALLER_PATH, false ); // assert folder and contents moved to new location assertTrue(newDir.exists()); assertTrue(new File(newDir, typeIdFile).exists()); }
Example #29
Source File: IgniteCacheDatabaseSharedManager.java From ignite with Apache License 2.0 | 5 votes |
/** * @param dbCfg Database config. * @throws IgniteCheckedException If failed. */ protected void initPageMemoryDataStructures(DataStorageConfiguration dbCfg) throws IgniteCheckedException { freeListMap = U.newHashMap(dataRegionMap.size()); String dfltMemPlcName = dbCfg.getDefaultDataRegionConfiguration().getName(); for (DataRegion memPlc : dataRegionMap.values()) { DataRegionConfiguration memPlcCfg = memPlc.config(); DataRegionMetricsImpl memMetrics = (DataRegionMetricsImpl)memMetricsMap.get(memPlcCfg.getName()); boolean persistenceEnabled = memPlcCfg.isPersistenceEnabled(); String freeListName = memPlcCfg.getName() + "##FreeList"; PageLockListener lsnr = cctx.diagnostic().pageLockTracker().createPageLockTracker(freeListName); CacheFreeList freeList = new CacheFreeList( 0, freeListName, memMetrics, memPlc, persistenceEnabled ? cctx.wal() : null, 0L, true, lsnr, cctx.kernalContext(), null ); freeListMap.put(memPlcCfg.getName(), freeList); } dfltFreeList = freeListMap.get(dfltMemPlcName); }
Example #30
Source File: H2RowCachePageEvictionTest.java From ignite with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName) .setDataStorageConfiguration(new DataStorageConfiguration() .setConcurrencyLevel(4) .setDefaultDataRegionConfiguration(new DataRegionConfiguration() .setPersistenceEnabled(persistenceEnabled) .setMaxSize(SIZE) .setInitialSize(SIZE) .setPageEvictionMode(persistenceEnabled ? DataPageEvictionMode.DISABLED : DataPageEvictionMode.RANDOM_LRU) .setName(DATA_REGION_NAME))); return cfg; }