/** * Verifies that {@link IgniteCheckedException} is thrown when IgniteCheckedException if validation of * memory metrics properties fails. Metrics rate time interval must not be less than 1000ms. */ @Test public void testInvalidMetricsProperties() { final long SMALL_RATE_TIME_INTERVAL_MS = 999; 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 rate time less then 1000ms invCfg.setMetricsRateTimeInterval(SMALL_RATE_TIME_INTERVAL_MS); memCfg = new DataStorageConfiguration(); memCfg.setDataRegionConfigurations(invCfg); ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); checkStartGridException(IgniteCheckedException.class, "Failed to start processor: GridProcessorAdapter []"); }
region.setName(mpc.getName()); region.setPageEvictionMode(mpc.getPageEvictionMode()); region.setMetricsRateTimeInterval(mpc.getRateTimeInterval()); region.setMetricsSubIntervalCount(mpc.getSubIntervals()); region.setSwapPath(mpc.getSwapFilePath());
/** * 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.setName(mpc.getName()); region.setPageEvictionMode(mpc.getPageEvictionMode()); region.setMetricsRateTimeInterval(mpc.getRateTimeInterval()); region.setMetricsSubIntervalCount(mpc.getSubIntervals()); region.setSwapPath(mpc.getSwapFilePath());
/** * 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()); }