/** * Verifies that {@link IgniteCheckedException} is thrown when IgniteCheckedException if validation of * memory metrics properties fails. Metrics sub interval count must be positive. */ @Test public void testInvalidSubIntervalCount() { final int NEG_SUB_INTERVAL_COUNT = -1000; DataRegionConfiguration invCfg = new DataRegionConfiguration(); invCfg.setName("invCfg"); invCfg.setInitialSize(DFLT_MEM_PLC_SIZE); invCfg.setMaxSize(DFLT_MEM_PLC_SIZE); invCfg.setPageEvictionMode(DataPageEvictionMode.RANDOM_LRU); // Setting the metrics sub interval count as negative invCfg.setMetricsSubIntervalCount(NEG_SUB_INTERVAL_COUNT); memCfg = new DataStorageConfiguration(); memCfg.setDataRegionConfigurations(invCfg); ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); checkStartGridException(IgniteCheckedException.class, "Failed to start processor: GridProcessorAdapter []"); } }
region.setPageEvictionMode(mpc.getPageEvictionMode()); region.setMetricsRateTimeInterval(mpc.getRateTimeInterval()); region.setMetricsSubIntervalCount(mpc.getSubIntervals()); region.setSwapPath(mpc.getSwapFilePath()); region.setMetricsEnabled(mpc.isMetricsEnabled());
/** * Reads the data region configuration. * * @param r Reader. */ private static DataRegionConfiguration readDataRegionConfiguration(BinaryRawReader r) { assert r != null; return new DataRegionConfiguration() .setName(r.readString()) .setPersistenceEnabled(r.readBoolean()) .setInitialSize(r.readLong()) .setMaxSize(r.readLong()) .setSwapPath(r.readString()) .setPageEvictionMode(DataPageEvictionMode.fromOrdinal(r.readInt())) .setEvictionThreshold(r.readDouble()) .setEmptyPagesPoolSize(r.readInt()) .setMetricsEnabled(r.readBoolean()) .setMetricsSubIntervalCount(r.readInt()) .setMetricsRateTimeInterval(r.readLong()) .setCheckpointPageBufferSize(r.readLong()); }
region.setPageEvictionMode(mpc.getPageEvictionMode()); region.setMetricsRateTimeInterval(mpc.getRateTimeInterval()); region.setMetricsSubIntervalCount(mpc.getSubIntervals()); region.setSwapPath(mpc.getSwapFilePath()); region.setMetricsEnabled(mpc.isMetricsEnabled());
/** * Reads the data region configuration. * * @param r Reader. */ private static DataRegionConfiguration readDataRegionConfiguration(BinaryRawReader r) { assert r != null; return new DataRegionConfiguration() .setName(r.readString()) .setPersistenceEnabled(r.readBoolean()) .setInitialSize(r.readLong()) .setMaxSize(r.readLong()) .setSwapPath(r.readString()) .setPageEvictionMode(DataPageEvictionMode.fromOrdinal(r.readInt())) .setEvictionThreshold(r.readDouble()) .setEmptyPagesPoolSize(r.readInt()) .setMetricsEnabled(r.readBoolean()) .setMetricsSubIntervalCount(r.readInt()) .setMetricsRateTimeInterval(r.readLong()) .setCheckpointPageBufferSize(r.readLong()); }