You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ni...@apache.org on 2022/11/22 10:02:11 UTC
[ignite] branch master updated: IGNITE-18214 Remove ThreadPoolMXBean (#10389)
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 c50e2c82135 IGNITE-18214 Remove ThreadPoolMXBean (#10389)
c50e2c82135 is described below
commit c50e2c821355b7371beb089dd474a16d85bcf984
Author: Nikolay <ni...@apache.org>
AuthorDate: Tue Nov 22 13:02:00 2022 +0300
IGNITE-18214 Remove ThreadPoolMXBean (#10389)
---
.../internal/StripedExecutorMXBeanAdapter.java | 96 ------------
.../ignite/internal/ThreadPoolMXBeanAdapter.java | 132 ----------------
.../internal/managers/IgniteMBeansManager.java | 2 -
.../internal/processors/pool/PoolProcessor.java | 72 ---------
.../ignite/mxbean/StripedExecutorMXBean.java | 100 ------------
.../org/apache/ignite/mxbean/ThreadPoolMXBean.java | 167 ---------------------
...rocessorCheckGlobalStateComputeRequestTest.java | 10 +-
.../org/apache/ignite/internal/GridMBeansTest.java | 27 ++--
8 files changed, 23 insertions(+), 583 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/StripedExecutorMXBeanAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/StripedExecutorMXBeanAdapter.java
deleted file mode 100644
index fc94a7ac8f4..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/StripedExecutorMXBeanAdapter.java
+++ /dev/null
@@ -1,96 +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;
-
-import java.util.concurrent.ExecutorService;
-import org.apache.ignite.internal.util.StripedExecutor;
-import org.apache.ignite.mxbean.StripedExecutorMXBean;
-
-/**
- * Adapter for {@link StripedExecutorMXBean} which delegates all method calls to the underlying
- * {@link ExecutorService} instance.
- */
-public class StripedExecutorMXBeanAdapter implements StripedExecutorMXBean {
- /** */
- private final StripedExecutor exec;
-
- /**
- * @param exec Executor service
- */
- public StripedExecutorMXBeanAdapter(StripedExecutor exec) {
- assert exec != null;
-
- this.exec = exec;
- }
-
- /** {@inheritDoc} */
- @Deprecated
- @Override public void checkStarvation() {
- exec.detectStarvation();
- }
-
- /** {@inheritDoc} */
- @Override public boolean detectStarvation() {
- return exec.detectStarvation();
- }
-
- /** {@inheritDoc} */
- @Override public int getStripesCount() {
- return exec.stripesCount();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isShutdown() {
- return exec.isShutdown();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isTerminated() {
- return exec.isTerminated();
- }
-
- /** {@inheritDoc} */
- @Override public int getTotalQueueSize() {
- return exec.queueSize();
- }
-
- /** {@inheritDoc} */
- @Override public long getTotalCompletedTasksCount() {
- return exec.completedTasks();
- }
-
- /** {@inheritDoc} */
- @Override public long[] getStripesCompletedTasksCounts() {
- return exec.stripesCompletedTasks();
- }
-
- /** {@inheritDoc} */
- @Override public int getActiveCount() {
- return exec.activeStripesCount();
- }
-
- /** {@inheritDoc} */
- @Override public boolean[] getStripesActiveStatuses() {
- return exec.stripesActiveStatuses();
- }
-
- /** {@inheritDoc} */
- @Override public int[] getStripesQueueSizes() {
- return exec.stripesQueueSizes();
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/ThreadPoolMXBeanAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/ThreadPoolMXBeanAdapter.java
deleted file mode 100644
index a1a15ee73ed..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/ThreadPoolMXBeanAdapter.java
+++ /dev/null
@@ -1,132 +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;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.RejectedExecutionHandler;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import org.apache.ignite.internal.util.typedef.internal.S;
-import org.apache.ignite.mxbean.ThreadPoolMXBean;
-
-/**
- * Adapter for {@link org.apache.ignite.mxbean.ThreadPoolMXBean} which delegates all method calls to the underlying
- * {@link ExecutorService} instance.
- */
-public class ThreadPoolMXBeanAdapter implements ThreadPoolMXBean {
- /** */
- private final ExecutorService exec;
-
- /**
- * Creates adapter.
- *
- * @param exec Executor service
- */
- public ThreadPoolMXBeanAdapter(ExecutorService exec) {
- assert exec != null;
-
- this.exec = exec;
- }
-
- /** {@inheritDoc} */
- @Override public int getActiveCount() {
- return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getActiveCount() : -1;
- }
-
- /** {@inheritDoc} */
- @Override public long getCompletedTaskCount() {
- return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getCompletedTaskCount() : -1;
- }
-
- /** {@inheritDoc} */
- @Override public int getCorePoolSize() {
- return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getCorePoolSize() : -1;
- }
-
- /** {@inheritDoc} */
- @Override public int getLargestPoolSize() {
- return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getLargestPoolSize() : -1;
- }
-
- /** {@inheritDoc} */
- @Override public int getMaximumPoolSize() {
- return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getMaximumPoolSize() : -1;
- }
-
- /** {@inheritDoc} */
- @Override public int getPoolSize() {
- return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getPoolSize() : -1;
- }
-
- /** {@inheritDoc} */
- @Override public long getTaskCount() {
- return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getTaskCount() : -1;
- }
-
- /** {@inheritDoc} */
- @Override public int getQueueSize() {
- return exec instanceof ThreadPoolExecutor ? ((ThreadPoolExecutor)exec).getQueue().size() : -1;
- }
-
- /** {@inheritDoc} */
- @Override public long getKeepAliveTime() {
- return exec instanceof ThreadPoolExecutor ?
- ((ThreadPoolExecutor)exec).getKeepAliveTime(TimeUnit.MILLISECONDS) : -1;
- }
-
- /** {@inheritDoc} */
- @Override public boolean isShutdown() {
- return exec.isShutdown();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isTerminated() {
- return exec.isTerminated();
- }
-
- /** {@inheritDoc} */
- @Override public boolean isTerminating() {
- return exec instanceof ThreadPoolExecutor && ((ThreadPoolExecutor)exec).isTerminating();
- }
-
- /** {@inheritDoc} */
- @Override public String getRejectedExecutionHandlerClass() {
- if (!(exec instanceof ThreadPoolExecutor))
- return "";
-
- RejectedExecutionHandler hnd = ((ThreadPoolExecutor)exec).getRejectedExecutionHandler();
-
- return hnd == null ? "" : hnd.getClass().getName();
- }
-
- /** {@inheritDoc} */
- @Override public String getThreadFactoryClass() {
- if (!(exec instanceof ThreadPoolExecutor))
- return "";
-
- ThreadFactory factory = ((ThreadPoolExecutor)exec).getThreadFactory();
-
- return factory == null ? "" : factory.getClass().getName();
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(ThreadPoolMXBeanAdapter.class, this, super.toString());
- }
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/IgniteMBeansManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/IgniteMBeansManager.java
index 4e256253c58..f204c0907b6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/IgniteMBeansManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/IgniteMBeansManager.java
@@ -152,8 +152,6 @@ public class IgniteMBeansManager {
MetricsMxBean metricsMxBean = new MetricsMxBeanImpl(ctx.metric(), log);
registerMBean("Metrics", metricsMxBean.getClass().getSimpleName(), metricsMxBean, MetricsMxBean.class);
- ctx.pools().registerMxBeans(this);
-
if (U.IGNITE_TEST_FEATURES_ENABLED) {
WorkersControlMXBean workerCtrlMXBean = new WorkersControlMXBeanImpl(ctx.workersRegistry());
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
index 7b72f035148..67ce29dcd65 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
@@ -38,9 +38,6 @@ import org.apache.ignite.failure.FailureContext;
import org.apache.ignite.failure.FailureType;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteComponentType;
-import org.apache.ignite.internal.StripedExecutorMXBeanAdapter;
-import org.apache.ignite.internal.ThreadPoolMXBeanAdapter;
-import org.apache.ignite.internal.managers.IgniteMBeansManager;
import org.apache.ignite.internal.managers.communication.GridIoPolicy;
import org.apache.ignite.internal.managers.systemview.walker.StripedExecutorTaskViewWalker;
import org.apache.ignite.internal.processors.GridProcessorAdapter;
@@ -59,8 +56,6 @@ import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.util.worker.GridWorkerListener;
import org.apache.ignite.internal.worker.WorkersRegistry;
import org.apache.ignite.lang.IgniteInClosure;
-import org.apache.ignite.mxbean.StripedExecutorMXBean;
-import org.apache.ignite.mxbean.ThreadPoolMXBean;
import org.apache.ignite.plugin.extensions.communication.IoPool;
import org.apache.ignite.spi.systemview.view.StripedExecutorTaskView;
import org.apache.ignite.thread.IgniteStripedThreadPoolExecutor;
@@ -943,73 +938,6 @@ public class PoolProcessor extends GridProcessorAdapter {
((MetricsAwareExecutorService)execSvc).registerMetrics(ctx.metric().registry(metricName(THREAD_POOLS, name)));
}
- /**
- * Register thread pool JMX beans.
- *
- * @param mbMgr Ignite MXBean manager.
- * @throws IgniteCheckedException On bean registration error.
- */
- public void registerMxBeans(IgniteMBeansManager mbMgr) throws IgniteCheckedException {
- registerExecutorMBean(mbMgr, "GridUtilityCacheExecutor", utilityCacheExecSvc);
- registerExecutorMBean(mbMgr, "GridExecutionExecutor", execSvc);
- registerExecutorMBean(mbMgr, "GridServicesExecutor", svcExecSvc);
- registerExecutorMBean(mbMgr, "GridSystemExecutor", sysExecSvc);
- registerExecutorMBean(mbMgr, "GridClassLoadingExecutor", p2pExecSvc);
- registerExecutorMBean(mbMgr, "GridManagementExecutor", mgmtExecSvc);
- registerExecutorMBean(mbMgr, "GridAffinityExecutor", affExecSvc);
- registerExecutorMBean(mbMgr, "GridCallbackExecutor", callbackExecSvc);
- registerExecutorMBean(mbMgr, "GridQueryExecutor", qryExecSvc);
- registerExecutorMBean(mbMgr, "GridSchemaExecutor", schemaExecSvc);
- registerExecutorMBean(mbMgr, "GridRebalanceExecutor", rebalanceExecSvc);
- registerExecutorMBean(mbMgr, "GridRebalanceStripedExecutor", rebalanceStripedExecSvc);
-
- registerStripedExecutorMBean(mbMgr, "GridDataStreamExecutor", dataStreamerExecSvc);
-
- if (idxExecSvc != null)
- registerExecutorMBean(mbMgr, "GridIndexingExecutor", idxExecSvc);
-
- if (ctx.config().getConnectorConfiguration() != null)
- registerExecutorMBean(mbMgr, "GridRestExecutor", restExecSvc);
-
- if (stripedExecSvc != null) {
- // striped executor uses a custom adapter
- registerStripedExecutorMBean(mbMgr, "StripedExecutor", stripedExecSvc);
- }
-
- if (snpExecSvc != null)
- registerExecutorMBean(mbMgr, "GridSnapshotExecutor", snpExecSvc);
-
- if (thinClientExec != null)
- registerExecutorMBean(mbMgr, "GridThinClientExecutor", thinClientExec);
-
- if (customExecs != null) {
- for (Map.Entry<String, ? extends ExecutorService> entry : customExecs.entrySet())
- registerExecutorMBean(mbMgr, entry.getKey(), entry.getValue());
- }
- }
-
- /**
- * Registers a {@link ThreadPoolMXBean} for an executor.
- *
- * @param name Mame of the bean to register.
- * @param exec Executor to register a bean for.
- * @throws IgniteCheckedException if registration fails.
- */
- private void registerExecutorMBean(IgniteMBeansManager mgr, String name, ExecutorService exec) throws IgniteCheckedException {
- mgr.registerMBean("Thread Pools", name, new ThreadPoolMXBeanAdapter(exec), ThreadPoolMXBean.class);
- }
-
- /**
- * Registers a {@link StripedExecutorMXBean} for an striped executor.
- *
- * @param name Mame of the bean to register.
- * @param exec Executor to register a bean for.
- * @throws IgniteCheckedException if registration fails.
- */
- private void registerStripedExecutorMBean(IgniteMBeansManager mgr, String name, StripedExecutor exec) throws IgniteCheckedException {
- mgr.registerMBean("Thread Pools", name, new StripedExecutorMXBeanAdapter(exec), StripedExecutorMXBean.class);
- }
-
/**
* Stops executor services if they has been started.
*
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/StripedExecutorMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/StripedExecutorMXBean.java
deleted file mode 100644
index d7e56a951ec..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/StripedExecutorMXBean.java
+++ /dev/null
@@ -1,100 +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;
-
-/**
- * MBean that provides access to information about striped executor service.
- */
-@MXBeanDescription("MBean that provides access to information about striped executor service.")
-public interface StripedExecutorMXBean {
- /**
- * Checks for starvation in striped pool, dumps in log information if potential starvation
- * was found.
- *
- * @deprecated Will be removed at 3.0.
- */
- @Deprecated
- @MXBeanDescription("Checks for starvation in striped pool.")
- public void checkStarvation();
-
- /**
- *
- * @return {@code True} if possible starvation in striped pool is detected.
- */
- @MXBeanDescription("True if possible starvation in striped pool is detected.")
- public boolean detectStarvation();
-
- /**
- * @return Stripes count.
- */
- @MXBeanDescription("Stripes count.")
- public int getStripesCount();
-
- /**
- *
- * @return {@code True} if this executor has been shut down.
- */
- @MXBeanDescription("True if this executor has been shut down.")
- public boolean isShutdown();
-
- /**
- * Note that
- * {@code isTerminated()} is never {@code true} unless either {@code shutdown()} or
- * {@code shutdownNow()} was called first.
- *
- * @return {@code True} if all tasks have completed following shut down.
- */
- @MXBeanDescription("True if all tasks have completed following shut down.")
- public boolean isTerminated();
-
- /**
- * @return Return total queue size of all stripes.
- */
- @MXBeanDescription("Total queue size of all stripes.")
- public int getTotalQueueSize();
-
- /**
- * @return Completed tasks count.
- */
- @MXBeanDescription("Completed tasks count of all stripes.")
- public long getTotalCompletedTasksCount();
-
- /**
- * @return Number of completed tasks per stripe.
- */
- @MXBeanDescription("Number of completed tasks per stripe.")
- public long[] getStripesCompletedTasksCounts();
-
- /**
- * @return Number of active tasks.
- */
- @MXBeanDescription("Number of active tasks of all stripes.")
- public int getActiveCount();
-
- /**
- * @return Number of active tasks per stripe.
- */
- @MXBeanDescription("Number of active tasks per stripe.")
- public boolean[] getStripesActiveStatuses();
-
- /**
- * @return Size of queue per stripe.
- */
- @MXBeanDescription("Size of queue per stripe.")
- public int[] getStripesQueueSizes();
-}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/ThreadPoolMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/ThreadPoolMXBean.java
deleted file mode 100644
index 117cdeccb93..00000000000
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/ThreadPoolMXBean.java
+++ /dev/null
@@ -1,167 +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.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 that provides access to information about executor service.
- *
- * @deprecated Check the {@link JmxMetricExporterSpi} with "name=threadPools.{thread_pool_name}" instead.
- *
- * @see ReadOnlyMetricManager
- * @see ReadOnlyMetricRegistry
- * @see JmxMetricExporterSpi
- * @see MetricExporterSpi
- */
-@MXBeanDescription("MBean that provides access to information about executor service.")
-@Deprecated
-public interface ThreadPoolMXBean {
- /**
- * Returns the approximate number of threads that are actively executing tasks.
- *
- * @return The number of threads.
- */
- @MXBeanDescription("Approximate number of threads that are actively executing tasks.")
- public int getActiveCount();
-
- /**
- * Returns the approximate total number of tasks that have completed execution.
- * Because the states of tasks and threads may change dynamically during
- * computation, the returned value is only an approximation, but one that
- * does not ever decrease across successive calls.
- *
- * @return The number of tasks.
- */
- @MXBeanDescription("Approximate total number of tasks that have completed execution.")
- public long getCompletedTaskCount();
-
- /**
- * Returns the core number of threads.
- *
- * @return The core number of threads.
- */
- @MXBeanDescription("The core number of threads.")
- public int getCorePoolSize();
-
- /**
- * Returns the largest number of threads that have ever
- * simultaneously been in the pool.
- *
- * @return The number of threads.
- */
- @MXBeanDescription("Largest number of threads that have ever simultaneously been in the pool.")
- public int getLargestPoolSize();
-
- /**
- * Returns the maximum allowed number of threads.
- *
- * @return The maximum allowed number of threads.
- */
- @MXBeanDescription("The maximum allowed number of threads.")
- public int getMaximumPoolSize();
-
- /**
- * Returns the current number of threads in the pool.
- *
- * @return The number of threads.
- */
- @MXBeanDescription("Current number of threads in the pool.")
- public int getPoolSize();
-
- /**
- * Returns the approximate total number of tasks that have been scheduled
- * for execution. Because the states of tasks and threads may change dynamically
- * during computation, the returned value is only an approximation, but
- * one that does not ever decrease across successive calls.
- *
- * @return The number of tasks.
- */
- @MXBeanDescription("Approximate total number of tasks that have been scheduled for execution.")
- public long getTaskCount();
-
- /**
- * Gets current size of the execution queue. This queue buffers local
- * executions when there are not threads available for processing in the pool.
- *
- * @return Current size of the execution queue.
- */
- @MXBeanDescription("Current size of the execution queue.")
- public int getQueueSize();
-
- /**
- * Returns the thread keep-alive time, which is the amount of time which threads
- * in excess of the core pool size may remain idle before being terminated.
- *
- * @return Keep alive time.
- */
- @MXBeanDescription("Thread keep-alive time, which is the amount of time which threads in excess of " +
- "the core pool size may remain idle before being terminated.")
- public long getKeepAliveTime();
-
- /**
- * Returns {@code true} if this executor has been shut down.
- *
- * @return {@code True} if this executor has been shut down.
- */
- @MXBeanDescription("True if this executor has been shut down.")
- public boolean isShutdown();
-
- /**
- * Returns {@code true} if all tasks have completed following shut down. Note that
- * {@code isTerminated()} is never {@code true} unless either {@code shutdown()} or
- * {@code shutdownNow()} was called first.
- *
- * @return {@code True} if all tasks have completed following shut down.
- */
- @MXBeanDescription("True if all tasks have completed following shut down.")
- public boolean isTerminated();
-
- /**
- * Returns {@code true} if this executor is in the process of terminating after
- * {@code shutdown()} or {@code shutdownNow()} but has not completely terminated.
- * This method may be useful for debugging. A return of {@code true} reported a
- * sufficient period after shutdown may indicate that submitted tasks have ignored
- * or suppressed interruption, causing this executor not to properly terminate.
- *
- * @return {@code True} if terminating but not yet terminated.
- */
- @MXBeanDescription("True if terminating but not yet terminated.")
- public boolean isTerminating();
-
- /**
- * The class name of the handler for tasks that cannot be executed.
- * This may occur when no more threads or queue slots are available because their bounds would be exceeded,
- * or upon shutdown of the Executor.
- *
- * @return Class name of the handler for tasks that cannot be executed by the thread pool.
- */
- @MXBeanDescription("Returns the class name of the handler for tasks that cannot be executed by the thread pool.")
- public String getRejectedExecutionHandlerClass();
-
- /**
- * Returns the class name of thread factory used to create new threads.
- *
- * @return Class name of thread factory used to create new threads.
- */
- @MXBeanDescription("Class name of thread factory used to create new threads.")
- public String getThreadFactoryClass();
-}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/ClusterProcessorCheckGlobalStateComputeRequestTest.java b/modules/core/src/test/java/org/apache/ignite/internal/ClusterProcessorCheckGlobalStateComputeRequestTest.java
index 971657c6ee8..3238fbce1c6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/ClusterProcessorCheckGlobalStateComputeRequestTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/ClusterProcessorCheckGlobalStateComputeRequestTest.java
@@ -21,9 +21,12 @@ import javax.management.ObjectName;
import org.apache.ignite.Ignite;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
+import static org.apache.ignite.internal.processors.pool.PoolProcessor.THREAD_POOLS;
+
/**
* Tests that the GridInternal annotation for GridClusterStateProcessor.CheckGlobalStateComputeRequest works correctly.
*/
@@ -31,6 +34,9 @@ public class ClusterProcessorCheckGlobalStateComputeRequestTest extends GridComm
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ cfg.setMetricExporterSpi(new JmxMetricExporterSpi());
+
if (igniteInstanceName.equalsIgnoreCase("daemon"))
cfg.setDaemon(true);
@@ -49,12 +55,12 @@ public class ClusterProcessorCheckGlobalStateComputeRequestTest extends GridComm
for (int i = 0; i < 100; i++)
daemon.cluster().active();
- checkBeanAttribute(daemon, "Thread Pools", "GridManagementExecutor", "TaskCount", 100L);
+ checkBeanAttribute(daemon, THREAD_POOLS, "GridManagementExecutor", "TaskCount", 100L);
for (int i = 0; i < 100; i++)
grid(0).cluster().active();
- checkBeanAttribute(grid(0), "Thread Pools", "GridManagementExecutor", "TaskCount", 100L);
+ checkBeanAttribute(grid(0), THREAD_POOLS, "GridManagementExecutor", "TaskCount", 100L);
}
/**
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 c5a44a47b5c..27d980f4557 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
@@ -22,9 +22,12 @@ import org.apache.ignite.configuration.ExecutorConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.util.IgniteUtils;
import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
+import static org.apache.ignite.internal.processors.pool.PoolProcessor.THREAD_POOLS;
+
/**
* Tests for the standard JMX beans registered by the kernal.
*/
@@ -51,6 +54,8 @@ public class GridMBeansTest extends GridCommonAbstractTest {
cfg.setExecutorConfiguration(new ExecutorConfiguration(CUSTOM_EXECUTOR_0),
new ExecutorConfiguration(CUSTOM_EXECUTOR_1));
+ cfg.setMetricExporterSpi(new JmxMetricExporterSpi());
+
return cfg;
}
@@ -66,18 +71,18 @@ public class GridMBeansTest extends GridCommonAbstractTest {
@Test
public void testExecutorBeans() throws Exception {
// standard executors
- checkBean("Thread Pools", "GridExecutionExecutor", "Terminated", false);
- checkBean("Thread Pools", "GridSystemExecutor", "Terminated", false);
- checkBean("Thread Pools", "GridManagementExecutor", "Terminated", false);
- checkBean("Thread Pools", "GridClassLoadingExecutor", "Terminated", false);
- checkBean("Thread Pools", "GridQueryExecutor", "Terminated", false);
- checkBean("Thread Pools", "GridSchemaExecutor", "Terminated", false);
- checkBean("Thread Pools", "GridThinClientExecutor", "Terminated", false);
- checkBean("Thread Pools", "StripedExecutor", "Terminated", false);
+ checkBean(THREAD_POOLS, "GridExecutionExecutor", "Terminated", false);
+ checkBean(THREAD_POOLS, "GridSystemExecutor", "Terminated", false);
+ checkBean(THREAD_POOLS, "GridManagementExecutor", "Terminated", false);
+ checkBean(THREAD_POOLS, "GridClassLoadingExecutor", "Terminated", false);
+ checkBean(THREAD_POOLS, "GridQueryExecutor", "Terminated", false);
+ checkBean(THREAD_POOLS, "GridSchemaExecutor", "Terminated", false);
+ checkBean(THREAD_POOLS, "GridThinClientExecutor", "Terminated", false);
+ checkBean(THREAD_POOLS, "StripedExecutor", "Terminated", false);
// custom executors
- checkBean("Thread Pools", CUSTOM_EXECUTOR_0, "Terminated", false);
- checkBean("Thread Pools", CUSTOM_EXECUTOR_1, "Terminated", false);
+ checkBean(THREAD_POOLS, CUSTOM_EXECUTOR_0, "Terminated", false);
+ checkBean(THREAD_POOLS, CUSTOM_EXECUTOR_1, "Terminated", false);
}
/** Checks that a bean with the specified group and name is available and has the expected attribute */
@@ -97,8 +102,6 @@ public class GridMBeansTest extends GridCommonAbstractTest {
"org.apache.ignite.internal.ClusterMetricsMXBeanImpl",
"org.apache.ignite.internal.IgniteMXBeanImpl",
"org.apache.ignite.internal.IgnitionMXBeanAdapter",
- "org.apache.ignite.internal.StripedExecutorMXBeanAdapter",
- "org.apache.ignite.internal.ThreadPoolMXBeanAdapter",
"org.apache.ignite.internal.TransactionMetricsMxBeanImpl",
"org.apache.ignite.internal.TransactionsMXBeanImpl",
"org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsMXBeanImpl",