This is an automated email from the ASF dual-hosted git repository.

nizhikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new a6e1d845058 IGNITE-18355 Removal of DataRegionMetricsMXBean (#10427)
a6e1d845058 is described below

commit a6e1d84505820dcd2e46cd8a7a657012cb2b1a76
Author: Nikolay <[email protected]>
AuthorDate: Thu Dec 22 12:59:07 2022 +0300

    IGNITE-18355 Removal of DataRegionMetricsMXBean (#10427)
---
 .../java/org/apache/ignite/DataRegionMetrics.java  |   8 +-
 .../main/java/org/apache/ignite/MemoryMetrics.java |   8 +-
 .../configuration/DataRegionConfiguration.java     |   5 +-
 .../configuration/MemoryPolicyConfiguration.java   |   5 +-
 .../persistence/DataRegionMetricsMXBeanImpl.java   | 210 ---------------------
 .../GridCacheDatabaseSharedManager.java            |   6 -
 .../IgniteCacheDatabaseSharedManager.java          |  98 ----------
 .../ignite/mxbean/DataRegionMetricsMXBean.java     | 198 -------------------
 .../apache/ignite/mxbean/MemoryMetricsMXBean.java  | 134 -------------
 .../org/apache/ignite/internal/GridMBeansTest.java |   1 -
 10 files changed, 9 insertions(+), 664 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java 
b/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java
index d2978cabede..a1539e1e8b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/DataRegionMetrics.java
@@ -19,7 +19,6 @@ package org.apache.ignite;
 
 import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.configuration.DataStorageConfiguration;
-import org.apache.ignite.mxbean.DataRegionMetricsMXBean;
 import org.apache.ignite.spi.metric.MetricExporterSpi;
 import org.apache.ignite.spi.metric.ReadOnlyMetricManager;
 import org.apache.ignite.spi.metric.ReadOnlyMetricRegistry;
@@ -39,16 +38,15 @@ import 
org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi;
  *       the method returns data region metrics snapshots rather than just in 
time memory state.
  *     </li>
  *     <li>
- *       Second, all {@link DataRegionMetrics} of a local Apache Ignite node 
are visible through JMX interface. Refer to
- *       {@link DataRegionMetricsMXBean} for more details.
+ *       Second, all {@link DataRegionMetrics} of a local Apache Ignite node 
are visible through JMX interface.
+ *       Refer to JMX bean with the name 
"name=io.dataregion.{data_region_name}" for more details.
  *     </li>
  * </ol>
  * </p>
  * <p>
  * Data region metrics collection is not a free operation and might affect 
performance of an application. This is the reason
  * why the metrics are turned off by default. To enable the collection you can 
use both
- * {@link DataRegionConfiguration#setMetricsEnabled(boolean)} configuration 
property or
- * {@link DataRegionMetricsMXBean#enableMetrics()} method of a respective JMX 
bean.
+ * {@link DataRegionConfiguration#setMetricsEnabled(boolean)} configuration 
property.
  *
  * @deprecated Check the {@link ReadOnlyMetricRegistry} with 
"name=io.dataregion.{data_region_name}" instead.
  *
diff --git a/modules/core/src/main/java/org/apache/ignite/MemoryMetrics.java 
b/modules/core/src/main/java/org/apache/ignite/MemoryMetrics.java
index 775cf8c94ab..48939a8a20b 100644
--- a/modules/core/src/main/java/org/apache/ignite/MemoryMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/MemoryMetrics.java
@@ -19,7 +19,6 @@ package org.apache.ignite;
 
 import org.apache.ignite.configuration.MemoryConfiguration;
 import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-import org.apache.ignite.mxbean.DataRegionMetricsMXBean;
 import org.apache.ignite.spi.metric.ReadOnlyMetricRegistry;
 
 /**
@@ -36,16 +35,15 @@ import org.apache.ignite.spi.metric.ReadOnlyMetricRegistry;
  *       the method returns memory metrics snapshots rather than just in time 
memory state.
  *     </li>
  *     <li>
- *       Second, all {@link MemoryMetrics} of a local Apache Ignite node are 
visible through JMX interface. Refer to
- *       {@link DataRegionMetricsMXBean} for more details.
+ *       Second, all {@link MemoryMetrics} of a local Apache Ignite node are 
visible through JMX interface.
+ *       Refer to JMX bean with the name 
"name=io.dataregion.{data_region_name}" for more details.
  *     </li>
  * </ol>
  * </p>
  * <p>
  * Memory metrics collection is not a free operation and might affect 
performance of an application. This is the reason
  * why the metrics are turned off by default. To enable the collection you can 
use both
- * {@link MemoryPolicyConfiguration#setMetricsEnabled(boolean)} configuration 
property or
- * {@link DataRegionMetricsMXBean#enableMetrics()} method of a respective JMX 
bean.
+ * {@link MemoryPolicyConfiguration#setMetricsEnabled(boolean)} configuration 
property.
  *
  * @deprecated Check the {@link ReadOnlyMetricRegistry} with 
"name=io.dataregion.{data_region_name}" instead.
  */
diff --git 
a/modules/core/src/main/java/org/apache/ignite/configuration/DataRegionConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/configuration/DataRegionConfiguration.java
index 2279ba8ce1f..299cce13f4f 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/configuration/DataRegionConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/configuration/DataRegionConfiguration.java
@@ -22,7 +22,6 @@ import 
org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteExperimental;
 import org.apache.ignite.mem.MemoryAllocator;
-import org.apache.ignite.mxbean.DataRegionMetricsMXBean;
 import org.apache.ignite.mxbean.MetricsMxBean;
 import org.jetbrains.annotations.Nullable;
 
@@ -378,7 +377,7 @@ public final class DataRegionConfiguration implements 
Serializable {
 
     /**
      * Gets whether memory metrics are enabled by default on node startup. 
Memory metrics can be enabled and disabled
-     * at runtime via memory metrics {@link DataRegionMetricsMXBean MX bean}.
+     * at runtime via memory metrics "name=io.dataregion.{data_region_name}" 
mx bean.
      *
      * @return Metrics enabled flag.
      */
@@ -388,7 +387,7 @@ public final class DataRegionConfiguration implements 
Serializable {
 
     /**
      * Sets memory metrics enabled flag. If this flag is {@code true}, metrics 
will be enabled on node startup.
-     * Memory metrics can be enabled and disabled at runtime via memory 
metrics {@link DataRegionMetricsMXBean MX bean}.
+     * Memory metrics can be enabled and disabled at runtime via memory 
metrics "name=io.dataregion.{data_region_name}" mx bean.
      *
      * @param metricsEnabled Metrics enabled flag.
      * @return {@code this} for chaining.
diff --git 
a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
 
b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
index fb32d1a82eb..f3c8ebb881b 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/configuration/MemoryPolicyConfiguration.java
@@ -20,7 +20,6 @@ import java.io.Serializable;
 import org.apache.ignite.MemoryMetrics;
 import org.apache.ignite.internal.mem.IgniteOutOfMemoryException;
 import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.mxbean.DataRegionMetricsMXBean;
 import org.apache.ignite.mxbean.MetricsMxBean;
 
 import static 
org.apache.ignite.configuration.MemoryConfiguration.DFLT_MEM_PLC_DEFAULT_NAME;
@@ -294,8 +293,7 @@ public final class MemoryPolicyConfiguration implements 
Serializable {
     }
 
     /**
-     * Gets whether memory metrics are enabled by default on node startup. 
Memory metrics can be enabled and disabled
-     * at runtime via memory metrics {@link DataRegionMetricsMXBean MX bean}.
+     * Gets whether memory metrics are enabled by default on node startup.
      *
      * @return Metrics enabled flag.
      */
@@ -305,7 +303,6 @@ public final class MemoryPolicyConfiguration implements 
Serializable {
 
     /**
      * Sets memory metrics enabled flag. If this flag is {@code true}, metrics 
will be enabled on node startup.
-     * Memory metrics can be enabled and disabled at runtime via memory 
metrics {@link DataRegionMetricsMXBean MX bean}.
      *
      * @param metricsEnabled Metrics enabled flag.
      * @return {@code this} for chaining.
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DataRegionMetricsMXBeanImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DataRegionMetricsMXBeanImpl.java
deleted file mode 100644
index e68438b1337..00000000000
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/DataRegionMetricsMXBeanImpl.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ignite.internal.processors.cache.persistence;
-
-import org.apache.ignite.DataRegionMetrics;
-import org.apache.ignite.configuration.DataRegionConfiguration;
-import org.apache.ignite.mxbean.DataRegionMetricsMXBean;
-import org.apache.ignite.spi.metric.MetricExporterSpi;
-import org.apache.ignite.spi.metric.ReadOnlyMetricManager;
-import org.apache.ignite.spi.metric.ReadOnlyMetricRegistry;
-import org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi;
-
-/**
- * MBean to expose {@link DataRegionMetrics} through JMX interface.
- *
- * @deprecated Check the {@link JmxMetricExporterSpi} with 
"name=io.dataregion.{data_region_name}" instead.
- *
- * @see ReadOnlyMetricManager
- * @see ReadOnlyMetricRegistry
- * @see JmxMetricExporterSpi
- * @see MetricExporterSpi
- */
-@Deprecated
-class DataRegionMetricsMXBeanImpl implements DataRegionMetricsMXBean {
-    /** */
-    private final DataRegionMetricsImpl memMetrics;
-
-    /** */
-    private final DataRegionConfiguration dataRegCfg;
-
-    /**
-     * @param dataRegion Data region which metrics will be exposed through 
this JMX bean.
-     */
-    DataRegionMetricsMXBeanImpl(DataRegion dataRegion) {
-        this.memMetrics = dataRegion.metrics();
-        this.dataRegCfg = dataRegion.config();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getAllocationRate() {
-        return memMetrics.getAllocationRate();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getEvictionRate() {
-        return memMetrics.getEvictionRate();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getLargeEntriesPagesPercentage() {
-        return memMetrics.getLargeEntriesPagesPercentage();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getPagesFillFactor() {
-        return memMetrics.getPagesFillFactor();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getTotalAllocatedPages() {
-        return memMetrics.getTotalAllocatedPages();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getTotalAllocatedSize() {
-        return memMetrics.getTotalAllocatedSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getTotalUsedPages() {
-        return memMetrics.getTotalUsedPages();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getTotalUsedSize() {
-        return memMetrics.getTotalUsedSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getDirtyPages() {
-        return memMetrics.getDirtyPages();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getPagesReplaceRate() {
-        return memMetrics.getPagesReplaceRate();
-    }
-
-    /** {@inheritDoc} */
-    @Override public float getPagesReplaceAge() {
-        return memMetrics.getPagesReplaceAge();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getPhysicalMemoryPages() {
-        return memMetrics.getPhysicalMemoryPages();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getPhysicalMemorySize() {
-        return memMetrics.getPhysicalMemorySize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getUsedCheckpointBufferPages() {
-        return memMetrics.getUsedCheckpointBufferPages();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getUsedCheckpointBufferSize() {
-        return memMetrics.getUsedCheckpointBufferSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getCheckpointBufferSize() {
-        return memMetrics.getCheckpointBufferSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getPageSize() {
-        return memMetrics.getPageSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void rateTimeInterval(long rateTimeInterval) {
-        if (rateTimeInterval < 1000)
-            throw new IllegalArgumentException("rateTimeInterval property must 
be positive " +
-                "and greater than 1_000 milliseconds (one second)");
-
-        memMetrics.rateTimeInterval(rateTimeInterval);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void subIntervals(int subInts) {
-        if (subInts <= 1)
-            throw new IllegalArgumentException("subIntervals property must be 
positive " +
-                "and greater than one");
-
-        memMetrics.subIntervals(subInts);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void enableMetrics() {
-        memMetrics.enableMetrics();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void disableMetrics() {
-        memMetrics.disableMetrics();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getName() {
-        return memMetrics.getName();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getInitialSize() {
-        return (int)(dataRegCfg.getInitialSize() / (1024 * 1024));
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getMaxSize() {
-        return (int)(dataRegCfg.getMaxSize() / (1024 * 1024));
-    }
-
-    /** {@inheritDoc} */
-    @Override public String getSwapPath() {
-        return dataRegCfg.getSwapPath();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getPagesRead() {
-        return memMetrics.getPagesRead();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getPagesWritten() {
-        return memMetrics.getPagesWritten();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getPagesReplaced() {
-        return memMetrics.getPagesReplaced();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffHeapSize() {
-        return memMetrics.getOffHeapSize();
-    }
-
-    /** {@inheritDoc} */
-    @Override public long getOffheapUsedSize() {
-        return memMetrics.getOffheapUsedSize();
-    }
-}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 12a5bff5e44..5d9a1e35c46 100755
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -1150,12 +1150,6 @@ public class GridCacheDatabaseSharedManager extends 
IgniteCacheDatabaseSharedMan
 
         super.onKernalStop0(cancel);
 
-        unregisterMetricsMBean(
-            cctx.gridConfig(),
-            MBEAN_GROUP,
-            MBEAN_NAME
-        );
-
         if (metaStorage != null)
             metaStorage.close();
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
index d8444fa0d85..2458224b351 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/IgniteCacheDatabaseSharedManager.java
@@ -30,7 +30,6 @@ import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
-import javax.management.InstanceNotFoundException;
 import org.apache.ignite.DataRegionMetrics;
 import org.apache.ignite.DataRegionMetricsProvider;
 import org.apache.ignite.IgniteCheckedException;
@@ -39,7 +38,6 @@ import org.apache.ignite.IgniteSystemProperties;
 import org.apache.ignite.configuration.DataPageEvictionMode;
 import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.configuration.DataStorageConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.WarmUpConfiguration;
 import org.apache.ignite.failure.FailureContext;
 import org.apache.ignite.failure.FailureType;
@@ -91,7 +89,6 @@ import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteClosure;
 import org.apache.ignite.lang.IgniteInClosure;
 import org.apache.ignite.lang.IgniteOutClosure;
-import org.apache.ignite.mxbean.DataRegionMetricsMXBean;
 import org.apache.ignite.spi.systemview.view.PagesListView;
 import org.jetbrains.annotations.Nullable;
 
@@ -150,9 +147,6 @@ public class IgniteCacheDatabaseSharedManager extends 
GridCacheSharedManagerAdap
     /** Stores memory providers eligible for reuse. */
     private final Map<String, DirectMemoryProvider> memProviderMap = new 
ConcurrentHashMap<>();
 
-    /** */
-    private static final String MBEAN_GROUP_NAME = "DataRegionMetrics";
-
     /** */
     protected volatile boolean dataRegionsInitialized;
 
@@ -248,90 +242,6 @@ public class IgniteCacheDatabaseSharedManager extends 
GridCacheSharedManagerAdap
         );
     }
 
-    /**
-     * @param cfg Ignite configuration.
-     * @param groupName Name of group.
-     * @param dataRegionName Metrics MBean name.
-     * @param impl Metrics implementation.
-     * @param clazz Metrics class type.
-     */
-    protected <T> void registerMetricsMBean(
-        IgniteConfiguration cfg,
-        String groupName,
-        String dataRegionName,
-        T impl,
-        Class<T> clazz
-    ) {
-        if (U.IGNITE_MBEANS_DISABLED)
-            return;
-
-        try {
-            U.registerMBean(
-                cfg.getMBeanServer(),
-                cfg.getIgniteInstanceName(),
-                groupName,
-                dataRegionName,
-                impl,
-                clazz);
-        }
-        catch (Throwable e) {
-            U.error(log, "Failed to register MBean with name: " + 
dataRegionName, e);
-        }
-    }
-
-    /**
-     * @param cfg Ignite configuration.
-     * @param groupName Name of group.
-     * @param name Name of MBean.
-     */
-    protected void unregisterMetricsMBean(
-        IgniteConfiguration cfg,
-        String groupName,
-        String name
-    ) {
-        if (U.IGNITE_MBEANS_DISABLED)
-            return;
-
-        assert cfg != null;
-
-        try {
-            cfg.getMBeanServer().unregisterMBean(
-                U.makeMBeanName(
-                    cfg.getIgniteInstanceName(),
-                    groupName,
-                    name
-                ));
-        }
-        catch (InstanceNotFoundException ignored) {
-            // We tried to unregister a non-existing MBean, not a big deal.
-        }
-        catch (Throwable e) {
-            U.error(log, "Failed to unregister MBean for memory metrics: " + 
name, e);
-        }
-    }
-
-    /**
-     * Registers MBeans for all DataRegionMetrics configured in this instance.
-     *
-     * @param cfg Ignite configuration.
-     */
-    protected void registerMetricsMBeans(IgniteConfiguration cfg) {
-        if (U.IGNITE_MBEANS_DISABLED)
-            return;
-
-        assert cfg != null;
-
-        for (DataRegion dataRegion : dataRegionMap.values()) {
-            registerMetricsMBean(
-                cfg,
-                MBEAN_GROUP_NAME,
-                dataRegion.config().getName(),
-                new DataRegionMetricsMXBeanImpl(dataRegion),
-                DataRegionMetricsMXBean.class
-            );
-        }
-    }
-
     /**
      * @param dbCfg Database config.
      * @throws IgniteCheckedException If failed.
@@ -1566,8 +1476,6 @@ public class IgniteCacheDatabaseSharedManager extends 
GridCacheSharedManagerAdap
 
         assert cfg != null;
 
-        registerMetricsMBeans(cctx.gridConfig());
-
         startDataRegions();
 
         initPageMemoryDataStructures(cfg);
@@ -1599,12 +1507,6 @@ public class IgniteCacheDatabaseSharedManager extends 
GridCacheSharedManagerAdap
 
             region.evictionTracker().stop();
 
-            unregisterMetricsMBean(
-                cctx.gridConfig(),
-                MBEAN_GROUP_NAME,
-                region.metrics().getName()
-            );
-
             region.metrics().remove();
         }
 
diff --git 
a/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java
 
b/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java
deleted file mode 100644
index 71e5c54d1a2..00000000000
--- 
a/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ignite.mxbean;
-
-import org.apache.ignite.DataRegionMetrics;
-import org.apache.ignite.configuration.DataRegionConfiguration;
-import org.apache.ignite.spi.metric.MetricExporterSpi;
-import org.apache.ignite.spi.metric.ReadOnlyMetricManager;
-import org.apache.ignite.spi.metric.ReadOnlyMetricRegistry;
-import org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi;
-
-/**
- * This interface defines a JMX view on {@link DataRegionMetrics}.
- *
- * @deprecated Check the {@link JmxMetricExporterSpi} with 
"name=io.dataregion.{data_region_name}" instead.
- *
- * @see ReadOnlyMetricManager
- * @see ReadOnlyMetricRegistry
- * @see JmxMetricExporterSpi
- * @see MetricExporterSpi
- */
-@Deprecated
-@MXBeanDescription("MBean that provides access to DataRegionMetrics of a local 
Apache Ignite node.")
-public interface DataRegionMetricsMXBean extends DataRegionMetrics {
-    /** {@inheritDoc} */
-    @MXBeanDescription("A name of a memory region the metrics are collected 
for.")
-    @Override public String getName();
-
-    /**
-     * Gets initial memory region size defined by its {@link 
DataRegionConfiguration}.
-     *
-     * @return Initial size in MB.
-     */
-    @MXBeanDescription("Initial memory region size defined by its data 
region.")
-    public int getInitialSize();
-
-    /**
-     * Maximum memory region size defined by its {@link 
DataRegionConfiguration}.
-     *
-     * @return Maximum size in MB.
-     */
-    @MXBeanDescription("Maximum memory region size defined by its data 
region.")
-    public int getMaxSize();
-
-    /**
-     * A path to the memory-mapped files the memory region defined by {@link 
DataRegionConfiguration} will be
-     * mapped to.
-     *
-     * @return Path to the memory-mapped files.
-     */
-    @MXBeanDescription("Path to the memory-mapped files.")
-    public String getSwapPath();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Total number of allocated pages.")
-    @Override public long getTotalAllocatedPages();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Total number of used pages.")
-    @Override public long getTotalUsedPages();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Allocation rate (pages per second) averaged across 
rateTimeInternal.")
-    @Override public float getAllocationRate();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Eviction rate (pages per second).")
-    @Override public float getEvictionRate();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Percentage of pages that are fully occupied by large 
entries that go beyond page size.")
-    @Override public float getLargeEntriesPagesPercentage();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("The percentage of the used space.")
-    @Override public float getPagesFillFactor();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Number of pages in memory not yet synchronized with 
persistent storage.")
-    @Override public long getDirtyPages();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Rate at which pages in memory are replaced with pages 
from persistent storage (pages per second).")
-    @Override public float getPagesReplaceRate();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Average age at which pages in memory are replaced with 
pages from persistent storage (milliseconds).")
-    @Override public float getPagesReplaceAge();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Number of pages residing in physical RAM.")
-    @Override public long getPhysicalMemoryPages();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Number of pages read from last restart.")
-    @Override public long getPagesRead();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Number of pages written from last restart.")
-    @Override public long getPagesWritten();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Number of pages replaced from last restart.")
-    @Override public long getPagesReplaced();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Offheap size in bytes.")
-    @Override public long getOffHeapSize();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Offheap used size in bytes.")
-    @Override public long getOffheapUsedSize();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("The size of the memory page in bytes.")
-    @Override public int getPageSize();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription(
-        "The total size of pages loaded to the RAM. When persistence is 
disabled, this metric is equal to TotalAllocatedSize."
-    )
-    @Override public long getPhysicalMemorySize();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("The used checkpoint buffer size in pages.")
-    @Override public long getUsedCheckpointBufferPages();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("The used checkpoint buffer size in bytes.")
-    @Override public long getUsedCheckpointBufferSize();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("The checkpoint buffer size in bytes.")
-    @Override public long getCheckpointBufferSize();
-
-    /**
-     * Enables memory metrics collection on an Apache Ignite node.
-     */
-    @MXBeanDescription("Enables memory metrics collection on an Apache Ignite 
node.")
-    public void enableMetrics();
-
-    /**
-     * Disables memory metrics collection on an Apache Ignite node.
-     */
-    @MXBeanDescription("Disables memory metrics collection on an Apache Ignite 
node.")
-    public void disableMetrics();
-
-    /**
-     * Sets time interval for {@link #getAllocationRate()} and {@link 
#getEvictionRate()} monitoring purposes.
-     * <p>
-     * For instance, after setting the interval to 60 seconds, subsequent 
calls to {@link #getAllocationRate()}
-     * will return average allocation rate (pages per second) for the last 
minute.
-     *
-     * @param rateTimeInterval Time interval (in milliseconds) used for 
allocation and eviction rates calculations.
-     * @deprecated Use {@link MetricsMxBean#configureHitRateMetric(String, 
long)} instead.
-     */
-    @MXBeanDescription(
-        "Sets time interval for pages allocation and eviction monitoring 
purposes."
-    )
-    @Deprecated
-    public void rateTimeInterval(
-        @MXBeanParameter(name = "rateTimeInterval", description = "Time 
interval (in milliseconds) to set.")
-            long rateTimeInterval
-    );
-
-    /**
-     * Sets a number of sub-intervals the whole {@link 
#rateTimeInterval(long)} will be split into to calculate
-     * {@link #getAllocationRate()} and {@link #getEvictionRate()} rates (5 by 
default).
-     * <p>
-     * Setting it to a bigger value will result in more precise calculation 
and smaller drops of
-     * {@link #getAllocationRate()} metric when next sub-interval has to be 
recycled but introduces bigger
-     * calculation overhead.
-     *
-     * @param subInts A number of sub-intervals.
-     * @deprecated Use {@link MetricsMxBean#configureHitRateMetric(String, 
long)} instead.
-     */
-    @MXBeanDescription(
-        "Sets a number of sub-intervals to calculate allocation and eviction 
rates metrics."
-    )
-    @Deprecated
-    public void subIntervals(
-        @MXBeanParameter(name = "subInts", description = "Number of 
subintervals to set.") int subInts
-    );
-}
diff --git 
a/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java 
b/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java
deleted file mode 100644
index cf3cd4360b9..00000000000
--- 
a/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ignite.mxbean;
-
-import org.apache.ignite.MemoryMetrics;
-import org.apache.ignite.configuration.MemoryPolicyConfiguration;
-
-/**
- * This interface defines a JMX view on {@link MemoryMetrics}.
- * @deprecated Part of old API. Metrics are accessible through {@link 
DataRegionMetricsMXBean}.
- */
-@MXBeanDescription("MBean that provides access to MemoryMetrics of a local 
Apache Ignite node.")
-@Deprecated
-public interface MemoryMetricsMXBean extends MemoryMetrics {
-    /** {@inheritDoc} */
-    @MXBeanDescription("A name of a memory region the metrics are collected 
for.")
-    @Override public String getName();
-
-    /**
-     * Gets initial memory region size defined by its {@link 
MemoryPolicyConfiguration}.
-     *
-     * @return Initial size in MB.
-     */
-    @MXBeanDescription("Initial memory region size defined by its memory 
policy.")
-    public int getInitialSize();
-
-    /**
-     * Maximum memory region size defined by its {@link 
MemoryPolicyConfiguration}.
-     *
-     * @return Maximum size in MB.
-     */
-    @MXBeanDescription("Maximum memory region size defined by its memory 
policy.")
-    public int getMaxSize();
-
-    /**
-     * A path to the memory-mapped files the memory region defined by {@link 
MemoryPolicyConfiguration} will be
-     * mapped to.
-     *
-     * @return Path to the memory-mapped files.
-     */
-    @MXBeanDescription("Path to the memory-mapped files.")
-    public String getSwapFilePath();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Total number of allocated pages.")
-    @Override public long getTotalAllocatedPages();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Allocation rate (pages per second) averaged across 
rateTimeInternal.")
-    @Override public float getAllocationRate();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Eviction rate (pages per second).")
-    @Override public float getEvictionRate();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Percentage of pages that are fully occupied by large 
entries that go beyond page size.")
-    @Override public float getLargeEntriesPagesPercentage();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Percentage of space that is still free and can be 
filled in.")
-    @Override public float getPagesFillFactor();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Number of pages in memory not yet synchronized with 
persistent storage.")
-    @Override public long getDirtyPages();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Rate at which pages in memory are replaced with pages 
from persistent storage (pages per second).")
-    @Override public float getPagesReplaceRate();
-
-    /** {@inheritDoc} */
-    @MXBeanDescription("Number of pages residing in physical RAM.")
-    @Override public long getPhysicalMemoryPages();
-
-    /**
-     * Enables memory metrics collection on an Apache Ignite node.
-     */
-    @MXBeanDescription("Enables memory metrics collection on an Apache Ignite 
node.")
-    public void enableMetrics();
-
-    /**
-     * Disables memory metrics collection on an Apache Ignite node.
-     */
-    @MXBeanDescription("Disables memory metrics collection on an Apache Ignite 
node.")
-    public void disableMetrics();
-
-    /**
-     * Sets time interval for {@link #getAllocationRate()} and {@link 
#getEvictionRate()} monitoring purposes.
-     * <p>
-     * For instance, after setting the interval to 60 seconds, subsequent 
calls to {@link #getAllocationRate()}
-     * will return average allocation rate (pages per second) for the last 
minute.
-     *
-     * @param rateTimeInterval Time interval (in milliseconds) used for 
allocation and eviction rates calculations.
-     */
-    @MXBeanDescription(
-        "Sets time interval for pages allocation and eviction monitoring 
purposes."
-    )
-    public void rateTimeInterval(
-        @MXBeanParameter(name = "rateTimeInterval", description = "Time 
interval (in milliseconds) to set.")
-            long rateTimeInterval
-    );
-
-    /**
-     * Sets a number of sub-intervals the whole {@link 
#rateTimeInterval(long)} will be split into to calculate
-     * {@link #getAllocationRate()} and {@link #getEvictionRate()} rates (5 by 
default).
-     * <p>
-     * Setting it to a bigger value will result in more precise calculation 
and smaller drops of
-     * {@link #getAllocationRate()} metric when next sub-interval has to be 
recycled but introduces bigger
-     * calculation overhead.
-     *
-     * @param subInts A number of sub-intervals.
-     */
-    @MXBeanDescription(
-        "Sets a number of sub-intervals to calculate allocation and eviction 
rates metrics."
-    )
-    public void subIntervals(
-        @MXBeanParameter(name = "subInts", description = "Number of 
subintervals to set.") int subInts
-    );
-}
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/GridMBeansTest.java 
b/modules/core/src/test/java/org/apache/ignite/internal/GridMBeansTest.java
index 27d980f4557..68ab5bf67fa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridMBeansTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridMBeansTest.java
@@ -104,7 +104,6 @@ public class GridMBeansTest extends GridCommonAbstractTest {
             "org.apache.ignite.internal.IgnitionMXBeanAdapter",
             "org.apache.ignite.internal.TransactionMetricsMxBeanImpl",
             "org.apache.ignite.internal.TransactionsMXBeanImpl",
-            
"org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsMXBeanImpl",
             
"org.apache.ignite.internal.processors.cache.persistence.DataStorageMXBeanImpl",
             
"org.apache.ignite.internal.processors.cache.persistence.diagnostic.pagelocktracker.PageLockTrackerMXBeanImpl",
             
"org.apache.ignite.internal.processors.cluster.BaselineAutoAdjustMXBeanImpl",


Reply via email to