You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2020/02/18 14:28:36 UTC
[ignite] branch master updated: IGNITE-10698 Introduced
@MXBeanParameter annotation which replaces @MXBeanParametersNames and
@MXBeanParametersDescriptions annotations.
This is an automated email from the ASF dual-hosted git repository.
agura 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 27ed424 IGNITE-10698 Introduced @MXBeanParameter annotation which replaces @MXBeanParametersNames and @MXBeanParametersDescriptions annotations.
27ed424 is described below
commit 27ed4240dca9d5d89a1bca850a0306ef3a12fa61
Author: l4ndsc4pe <le...@gmail.com>
AuthorDate: Tue Feb 18 17:28:06 2020 +0300
IGNITE-10698 Introduced @MXBeanParameter annotation which replaces @MXBeanParametersNames and @MXBeanParametersDescriptions annotations.
Signed-off-by: Andrey Gura <ag...@apache.org>
---
.../internal/mxbean/IgniteStandardMXBean.java | 93 +++-
.../ignite/mxbean/BaselineAutoAdjustMXBean.java | 12 +-
.../ignite/mxbean/ClientProcessorMXBean.java | 10 +-
.../apache/ignite/mxbean/ClusterMetricsMXBean.java | 19 +-
.../ignite/mxbean/DataRegionMetricsMXBean.java | 21 +-
.../apache/ignite/mxbean/DataStorageMXBean.java | 6 +-
.../ignite/mxbean/DataStorageMetricsMXBean.java | 21 +-
.../org/apache/ignite/mxbean/EncryptionMXBean.java | 6 +-
.../org/apache/ignite/mxbean/IgniteMXBean.java | 107 ++--
.../org/apache/ignite/mxbean/IgnitionMXBean.java | 72 +--
...etersDescriptions.java => MXBeanParameter.java} | 16 +-
.../mxbean/MXBeanParametersDescriptions.java | 3 +
.../ignite/mxbean/MXBeanParametersNames.java | 3 +
.../apache/ignite/mxbean/MemoryMetricsMXBean.java | 21 +-
.../org/apache/ignite/mxbean/MetricsMxBean.java | 20 +-
.../ignite/mxbean/PersistenceMetricsMXBean.java | 21 +-
.../ignite/mxbean/TransactionMetricsMxBean.java | 6 +-
.../apache/ignite/mxbean/TransactionsMXBean.java | 95 ++--
.../apache/ignite/mxbean/WorkersControlMXBean.java | 30 +-
.../spi/discovery/tcp/TcpDiscoverySpiMBean.java | 18 +-
.../internal/mxbean/IgniteStandardMXBeanTest.java | 585 +++++++++++++++++++++
.../ignite/internal/mxbean/package-info.java} | 23 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 5 +-
.../ignite/internal/mxbean/SqlQueryMXBean.java | 18 +-
24 files changed, 877 insertions(+), 354 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/mxbean/IgniteStandardMXBean.java b/modules/core/src/main/java/org/apache/ignite/internal/mxbean/IgniteStandardMXBean.java
index 3fdc89a..b0db8a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/mxbean/IgniteStandardMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/mxbean/IgniteStandardMXBean.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.mxbean;
import java.lang.reflect.Method;
+import java.lang.reflect.Parameter;
import java.util.HashMap;
import java.util.Map;
import javax.management.MBeanAttributeInfo;
@@ -28,6 +29,7 @@ import javax.management.NotCompliantMBeanException;
import javax.management.StandardMBean;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.mxbean.MXBeanDescription;
+import org.apache.ignite.mxbean.MXBeanParameter;
import org.apache.ignite.mxbean.MXBeanParametersDescriptions;
import org.apache.ignite.mxbean.MXBeanParametersNames;
@@ -36,6 +38,24 @@ import org.apache.ignite.mxbean.MXBeanParametersNames;
* annotation based descriptions.
*/
public class IgniteStandardMXBean extends StandardMBean {
+ /** */
+ private static final String DESC_MUST_START_WITH_UPP_CASE = "Description must start with upper case: ";
+
+ /** */
+ private static final String DESC_MUST_END_WITH_PERIOD = "Description must end with period: ";
+
+ /** */
+ private static final String DESC_MUST_BE_NOT_NULL = "Description must be not null: ";
+
+ /** */
+ private static final String DESC_MUST_BE_NOT_EMPTY = "Description must be not empty: ";
+
+ /** */
+ private static final String NAME_MUST_BE_NOT_NULL = "Parameter name must be not null: ";
+
+ /** */
+ private static final String NAME_MUST_BE_NOT_EMPTY = "Parameter name must be not empty: ";
+
/**
* Objects maps from primitive classes to primitive object classes.
*/
@@ -98,10 +118,8 @@ public class IgniteStandardMXBean extends StandardMBean {
assert !str.trim().isEmpty() : "Method description cannot be empty: " + mtd;
// Enforce proper English.
- assert Character.isUpperCase(str.charAt(0)) == true :
- "Description must start with upper case: " + str;
-
- assert str.charAt(str.length() - 1) == '.' : "Description must end with period: " + str;
+ assert Character.isUpperCase(str.charAt(0)) : DESC_MUST_START_WITH_UPP_CASE + str;
+ assert str.charAt(str.length() - 1) == '.' : DESC_MUST_END_WITH_PERIOD + str;
}
}
}
@@ -126,8 +144,8 @@ public class IgniteStandardMXBean extends StandardMBean {
assert !str.trim().isEmpty();
// Enforce proper English.
- assert Character.isUpperCase(str.charAt(0)) == true : str;
- assert str.charAt(str.length() - 1) == '.' : str;
+ assert Character.isUpperCase(str.charAt(0)) : DESC_MUST_START_WITH_UPP_CASE + str;
+ assert str.charAt(str.length() - 1) == '.' : DESC_MUST_END_WITH_PERIOD + str;
}
return str;
@@ -149,8 +167,8 @@ public class IgniteStandardMXBean extends StandardMBean {
assert !str.trim().isEmpty();
// Enforce proper English.
- assert Character.isUpperCase(str.charAt(0)) == true : str;
- assert str.charAt(str.length() - 1) == '.' : str;
+ assert Character.isUpperCase(str.charAt(0)) : DESC_MUST_START_WITH_UPP_CASE + str;
+ assert str.charAt(str.length() - 1) == '.' : DESC_MUST_END_WITH_PERIOD + str;
}
}
catch (SecurityException | ClassNotFoundException ignored) {
@@ -175,12 +193,26 @@ public class IgniteStandardMXBean extends StandardMBean {
str = decsAnn.value()[seq];
- assert str != null;
- assert !str.trim().isEmpty();
+ assert str != null : DESC_MUST_BE_NOT_NULL + str;
+ assert !str.trim().isEmpty() : DESC_MUST_BE_NOT_EMPTY + str;
// Enforce proper English.
- assert Character.isUpperCase(str.charAt(0)) == true : str;
- assert str.charAt(str.length() - 1) == '.' : str;
+ assert Character.isUpperCase(str.charAt(0)) : DESC_MUST_START_WITH_UPP_CASE + str;
+ assert str.charAt(str.length() - 1) == '.' : DESC_MUST_END_WITH_PERIOD + str;
+ }
+ else {
+ MXBeanParameter argInfoAnnotation = getMXBeanParameterAnnotation(m, seq);
+
+ if (argInfoAnnotation != null) {
+ str = argInfoAnnotation.description();
+
+ assert str != null : DESC_MUST_BE_NOT_NULL + str;
+ assert !str.trim().isEmpty() : DESC_MUST_BE_NOT_EMPTY + str;
+
+ // Enforce proper English.
+ assert Character.isUpperCase(str.charAt(0)) : DESC_MUST_START_WITH_UPP_CASE + str;
+ assert str.charAt(str.length() - 1) == '.' : DESC_MUST_END_WITH_PERIOD + str;
+ }
}
}
catch (SecurityException | ClassNotFoundException ignored) {
@@ -205,8 +237,18 @@ public class IgniteStandardMXBean extends StandardMBean {
str = namesAnn.value()[seq];
- assert str != null;
- assert !str.trim().isEmpty();
+ assert str != null : NAME_MUST_BE_NOT_NULL + str;
+ assert !str.trim().isEmpty() : NAME_MUST_BE_NOT_EMPTY + str;
+ }
+ else {
+ MXBeanParameter argInfoAnnotation = getMXBeanParameterAnnotation(m, seq);
+
+ if (argInfoAnnotation != null) {
+ str = argInfoAnnotation.name();
+
+ assert str != null : NAME_MUST_BE_NOT_NULL + str;
+ assert !str.trim().isEmpty() : NAME_MUST_BE_NOT_EMPTY + str;
+ }
}
}
catch (SecurityException | ClassNotFoundException ignored) {
@@ -217,6 +259,23 @@ public class IgniteStandardMXBean extends StandardMBean {
}
/**
+ * Gets {@link MXBeanParameter} annotation instance from method if possible, otherwise returns {@code null}.
+ *
+ * @param m Method instance.
+ * @param seq The sequence number of the argument considered ("0" for the first parameter,
+ * "1" for the second parameter, etc...)
+ * @return {@link MXBeanParameter} annotation instance.
+ */
+ private MXBeanParameter getMXBeanParameterAnnotation(Method m, int seq) {
+ Parameter[] params = m.getParameters();
+
+ if (seq < params.length)
+ return params[seq].getAnnotation(MXBeanParameter.class);
+
+ return null;
+ }
+
+ /**
* Gets method by operation info.
*
* @param op MBean operation info.
@@ -225,7 +284,7 @@ public class IgniteStandardMXBean extends StandardMBean {
* @throws SecurityException Thrown if method access is not allowed.
*/
private Method getMethod(MBeanOperationInfo op) throws ClassNotFoundException, SecurityException {
- String methodName = op.getName();
+ String mtdName = op.getName();
MBeanParameterInfo[] signature = op.getSignature();
@@ -241,7 +300,7 @@ public class IgniteStandardMXBean extends StandardMBean {
params[i] = type;
}
- return findMethod(getMBeanInterface(), methodName, params);
+ return findMethod(getMBeanInterface(), mtdName, params);
}
/**
@@ -254,7 +313,7 @@ public class IgniteStandardMXBean extends StandardMBean {
*/
@SuppressWarnings("unchecked")
private Method findMethod(Class itf, String methodName, Class[] params) {
- assert itf.isInterface() == true;
+ assert itf.isInterface() : itf + " must represent the interface";
Method res = null;
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/BaselineAutoAdjustMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/BaselineAutoAdjustMXBean.java
index 661ab22..468eb5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/BaselineAutoAdjustMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/BaselineAutoAdjustMXBean.java
@@ -41,13 +41,13 @@ public interface BaselineAutoAdjustMXBean {
/** */
@MXBeanDescription("Enable/disable baseline autoadjustment feature.")
- @MXBeanParametersNames("enabled")
- @MXBeanParametersDescriptions("Enable/disable flag.")
- public void setAutoAdjustmentEnabled(boolean enabled);
+ public void setAutoAdjustmentEnabled(
+ @MXBeanParameter(name = "enabled", description = "Enable/disable flag.") boolean enabled
+ );
/** */
@MXBeanDescription("Set baseline autoadjustment timeout value.")
- @MXBeanParametersNames("timeout")
- @MXBeanParametersDescriptions("Timeout value.")
- public void setAutoAdjustmentTimeout(long timeout);
+ public void setAutoAdjustmentTimeout(
+ @MXBeanParameter(name = "timeout", description = "Timeout value.") long timeout
+ );
}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/ClientProcessorMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/ClientProcessorMXBean.java
index d71ec01..5da7eee 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/ClientProcessorMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/ClientProcessorMXBean.java
@@ -45,11 +45,7 @@ public interface ClientProcessorMXBean {
* @return {@code True} if connection has been dropped successfully, {@code false} otherwise.
*/
@MXBeanDescription("Drop client connection by ID.")
- @MXBeanParametersNames(
- "id"
- )
- @MXBeanParametersDescriptions(
- "Client connection ID."
- )
- public boolean dropConnection(long id);
+ public boolean dropConnection(
+ @MXBeanParameter(name = "id", description = "Client connection ID.") long id
+ );
}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/ClusterMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/ClusterMetricsMXBean.java
index 5dd5ebc..e1355f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/ClusterMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/ClusterMetricsMXBean.java
@@ -314,9 +314,9 @@ public interface ClusterMetricsMXBean extends ClusterMetrics {
* @param attrName Attribute name.
*/
@MXBeanDescription("Distinct attribute values for given nodes projection.")
- @MXBeanParametersNames("attrName")
- @MXBeanParametersDescriptions("Attribute name.")
- public Set<String> attributeValues(String attrName);
+ public Set<String> attributeValues(
+ @MXBeanParameter(name = "attrName", description = "Attribute name.") String attrName
+ );
/**
* Get node IDs with the given attribute value.
@@ -327,11 +327,10 @@ public interface ClusterMetricsMXBean extends ClusterMetrics {
* @param includeClients Include client nodes.
*/
@MXBeanDescription("Get node IDs with the given attribute value.")
- @MXBeanParametersNames(
- {"attrName", "attrValue", "includeSrvs", "includeClients"}
- )
- @MXBeanParametersDescriptions(
- {"Attribute name.", "Attribute value.", "Include server nodes.", "Include client nodes."}
- )
- public Set<UUID> nodeIdsForAttribute(String attrName, String attrVal, boolean includeSrvs, boolean includeClients);
+ public Set<UUID> nodeIdsForAttribute(
+ @MXBeanParameter(name = "attrName", description = "Attribute name.") String attrName,
+ @MXBeanParameter(name = "attrValue", description = "Attribute value.") String attrVal,
+ @MXBeanParameter(name = "includeSrvs", description = "Include server nodes.") boolean includeSrvs,
+ @MXBeanParameter(name = "includeClients", description = "Include client nodes.") boolean includeClients
+ );
}
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
index 65fbf4e..fe5f386 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/DataRegionMetricsMXBean.java
@@ -141,14 +141,11 @@ public interface DataRegionMetricsMXBean extends DataRegionMetrics {
@MXBeanDescription(
"Sets time interval for pages allocation and eviction monitoring purposes."
)
- @MXBeanParametersNames(
- "rateTimeInterval"
- )
- @MXBeanParametersDescriptions(
- "Time interval (in milliseconds) to set."
- )
@Deprecated
- public void rateTimeInterval(long rateTimeInterval);
+ 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
@@ -164,12 +161,8 @@ public interface DataRegionMetricsMXBean extends DataRegionMetrics {
@MXBeanDescription(
"Sets a number of sub-intervals to calculate allocation and eviction rates metrics."
)
- @MXBeanParametersNames(
- "subInts"
- )
- @MXBeanParametersDescriptions(
- "Number of subintervals to set."
- )
@Deprecated
- public void subIntervals(int subInts);
+ 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/DataStorageMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMXBean.java
index 850b886..4149d91 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMXBean.java
@@ -33,7 +33,7 @@ public interface DataStorageMXBean {
* @param walCompactionLevel ZIP compression level.
*/
@MXBeanDescription("Sets ZIP compression level to WAL compaction.")
- @MXBeanParametersNames("walCompactionLevel")
- @MXBeanParametersDescriptions("ZIP compression level.")
- void setWalCompactionLevel(int walCompactionLevel);
+ void setWalCompactionLevel(
+ @MXBeanParameter(name = "walCompactionLevel", description = "ZIP compression level.") int walCompactionLevel
+ );
}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMetricsMXBean.java
index 7034d8c..278ef75 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/DataStorageMetricsMXBean.java
@@ -154,14 +154,11 @@ public interface DataStorageMetricsMXBean extends DataStorageMetrics {
@MXBeanDescription(
"Sets time interval for pages allocation and eviction monitoring purposes."
)
- @MXBeanParametersNames(
- "rateTimeInterval"
- )
- @MXBeanParametersDescriptions(
- "Time interval (in milliseconds) to set."
- )
@Deprecated
- public void rateTimeInterval(long rateTimeInterval);
+ 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
@@ -174,14 +171,10 @@ public interface DataStorageMetricsMXBean extends DataStorageMetrics {
@MXBeanDescription(
"Sets a number of sub-intervals to calculate allocation and eviction rates metrics."
)
- @MXBeanParametersNames(
- "subInts"
- )
- @MXBeanParametersDescriptions(
- "Number of subintervals to set."
- )
@Deprecated
- public void subIntervals(int subInts);
+ public void subIntervals(
+ @MXBeanParameter(name = "subInts", description = "Number of subintervals to set.") int subInts
+ );
/** {@inheritDoc} */
@MXBeanDescription("Storage space allocated, in bytes.")
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/EncryptionMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/EncryptionMXBean.java
index 131af31..9db1049 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/EncryptionMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/EncryptionMXBean.java
@@ -40,7 +40,7 @@ public interface EncryptionMXBean {
* @see IgniteEncryption#changeMasterKey(String)
*/
@MXBeanDescription("Change master key name.")
- @MXBeanParametersNames("masterKeyName")
- @MXBeanParametersDescriptions("Master key name.")
- public void changeMasterKey(String masterKeyName);
+ public void changeMasterKey(
+ @MXBeanParameter(name = "masterKeyName", description = "Master key name.") String masterKeyName
+ );
}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
index 79dfe61..47bb925 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgniteMXBean.java
@@ -363,13 +363,9 @@ public interface IgniteMXBean {
*/
@MXBeanDescription("This method allows manually remove the checkpoint with given key. Return true " +
"if specified checkpoint was indeed removed, false otherwise.")
- @MXBeanParametersNames(
- "key"
- )
- @MXBeanParametersDescriptions(
- "Checkpoint key to remove."
- )
- public boolean removeCheckpoint(String key);
+ public boolean removeCheckpoint(
+ @MXBeanParameter(name = "key", description = "Checkpoint key to remove.") String key
+ );
/**
* Pings node with given node ID to see whether it is alive.
@@ -380,13 +376,10 @@ public interface IgniteMXBean {
*/
@MXBeanDescription("Pings node with given node ID to see whether it is alive. " +
"Returns whether or not node is alive.")
- @MXBeanParametersNames(
- "nodeId"
- )
- @MXBeanParametersDescriptions(
- "String presentation of node ID. See java.util.UUID class for details."
- )
- public boolean pingNode(String nodeId);
+ public boolean pingNode(
+ @MXBeanParameter(name = "nodeId",
+ description = "String presentation of node ID. See java.util.UUID class for details.") String nodeId
+ );
/**
* @param active Activate/DeActivate flag.
@@ -424,13 +417,9 @@ public interface IgniteMXBean {
* @throws JMException Thrown if undeploy failed.
*/
@MXBeanDescription("Makes the best attempt to undeploy a task from the whole grid.")
- @MXBeanParametersNames(
- "taskName"
- )
- @MXBeanParametersDescriptions(
- "Name of the task to undeploy."
- )
- public void undeployTaskFromGrid(String taskName) throws JMException;
+ public void undeployTaskFromGrid(
+ @MXBeanParameter(name = "taskName", description = "Name of the task to undeploy.") String taskName
+ ) throws JMException;
/**
* A shortcut method that executes given task assuming single {@code java.lang.String} argument
@@ -443,19 +432,10 @@ public interface IgniteMXBean {
*/
@MXBeanDescription("A shortcut method that executes given task assuming single " +
"String argument and String return type. Returns Task return value (assumed of String type).")
- @MXBeanParametersNames(
- {
- "taskName",
- "arg"
- }
- )
- @MXBeanParametersDescriptions(
- {
- "Name of the task to execute.",
- "Single task execution argument (can be null)."
- }
- )
- public String executeTask(String taskName, String arg) throws JMException;
+ public String executeTask(
+ @MXBeanParameter(name = "taskName", description = "Name of the task to execute.") String taskName,
+ @MXBeanParameter(name = "arg", description = "Single task execution argument (can be null).") String arg
+ ) throws JMException;
/**
* Pings node with given host name to see if it is alive.
@@ -465,13 +445,9 @@ public interface IgniteMXBean {
*/
@MXBeanDescription("Pings node with given host name to see if it is alive. " +
"Returns whether or not node is alive.")
- @MXBeanParametersNames(
- "host"
- )
- @MXBeanParametersDescriptions(
- "Host name or IP address of the node to ping."
- )
- public boolean pingNodeByAddress(String host);
+ public boolean pingNodeByAddress(
+ @MXBeanParameter(name = "host", description = "Host name or IP address of the node to ping.") String host
+ );
/**
* Gets a formatted instance of configured discovery SPI implementation.
@@ -646,36 +622,21 @@ public interface IgniteMXBean {
* @param procFromNioThread {@code True} to process requests in NIO threads.
*/
@MXBeanDescription("Runs IO latency test against all remote server nodes in cluster.")
- @MXBeanParametersNames(
- {
- "warmup",
- "duration",
- "threads",
- "maxLatency",
- "rangesCnt",
- "payLoadSize",
- "procFromNioThread"
- }
- )
- @MXBeanParametersDescriptions(
- {
- "Warmup duration (millis).",
- "Test duration (millis).",
- "Threads count.",
- "Maximum latency expected (nanos).",
- "Ranges count for histogram.",
- "Payload size (bytes).",
- "Process requests in NIO-threads flag."
- }
- )
void runIoTest(
- long warmup,
- long duration,
- int threads,
- long maxLatency,
- int rangesCnt,
- int payLoadSize,
- boolean procFromNioThread
+ @MXBeanParameter(name = "warmup", description = "Warmup duration (millis).")
+ long warmup,
+ @MXBeanParameter(name = "duration", description = "Test duration (millis).")
+ long duration,
+ @MXBeanParameter(name = "threads", description = "Threads count.")
+ int threads,
+ @MXBeanParameter(name = "maxLatency", description = "Maximum latency expected (nanos).")
+ long maxLatency,
+ @MXBeanParameter(name = "rangesCnt", description = "Ranges count for histogram.")
+ int rangesCnt,
+ @MXBeanParameter(name = "payLoadSize", description = "Payload size (bytes).")
+ int payLoadSize,
+ @MXBeanParameter(name = "procFromNioThread", description = "Process requests in NIO-threads flag.")
+ boolean procFromNioThread
);
/**
@@ -702,9 +663,9 @@ public interface IgniteMXBean {
* See {@link ClusterState}
*/
@MXBeanDescription("Changes current cluster state.")
- @MXBeanParametersNames("state")
- @MXBeanParametersDescriptions("New cluster state.")
- public void clusterState(String state);
+ public void clusterState(
+ @MXBeanParameter(name = "state", description = "New cluster state.") String state
+ );
/**
* Gets last cluster state change operation.
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMXBean.java
index 01f25be..dc8caaf 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/IgnitionMXBean.java
@@ -39,13 +39,9 @@ public interface IgnitionMXBean {
* @see org.apache.ignite.Ignition#state(String)
*/
@MXBeanDescription("Gets state for a given grid instance. Returns state of grid instance with given name.")
- @MXBeanParametersNames(
- "name"
- )
- @MXBeanParametersDescriptions(
- "Name of grid instance."
- )
- public String getState(String name);
+ public String getState(
+ @MXBeanParameter(name = "name", description = "Name of grid instance.") String name
+ );
/**
* Stops default grid instance.
@@ -60,13 +56,10 @@ public interface IgnitionMXBean {
*/
@MXBeanDescription("Stops default grid instance. Return true if default grid instance was " +
"indeed stopped, false otherwise (if it was not started).")
- @MXBeanParametersNames(
- "cancel"
- )
- @MXBeanParametersDescriptions(
- "If true then all jobs currently executing on default grid will be cancelled."
- )
- public boolean stop(boolean cancel);
+ public boolean stop(
+ @MXBeanParameter(name = "cancel",
+ description = "If true then all jobs currently executing on default grid will be cancelled.") boolean cancel
+ );
/**
* Stops named Ignite instance. If {@code cancel} flag is set to {@code true} then
@@ -89,18 +82,12 @@ public interface IgnitionMXBean {
*/
@MXBeanDescription("Stops Ignite instance by name. Cancels running jobs if cancel is true. Returns true if named " +
"Ignite instance was indeed found and stopped, false otherwise.")
- @MXBeanParametersNames(
- {
- "name",
- "cancel"
- })
- @MXBeanParametersDescriptions(
- {
- "Grid instance name to stop.",
- "Whether or not running jobs should be cancelled."
- }
- )
- public boolean stop(String name, boolean cancel);
+ public boolean stop(
+ @MXBeanParameter(name = "name", description = "Grid instance name to stop.")
+ String name,
+ @MXBeanParameter(name = "cancel", description = "Whether or not running jobs should be cancelled.")
+ boolean cancel
+ );
/**
* Stops <b>all</b> started grids. If {@code cancel} flag is set to {@code true} then
@@ -118,13 +105,13 @@ public interface IgnitionMXBean {
* @see org.apache.ignite.Ignition#stopAll(boolean)
*/
@MXBeanDescription("Stops all started grids.")
- @MXBeanParametersNames(
- "cancel"
- )
- @MXBeanParametersDescriptions(
- "If true then all jobs currently executing on all grids will be cancelled."
- )
- public void stopAll(boolean cancel);
+ public void stopAll(
+ @MXBeanParameter(
+ name = "cancel",
+ description = "If true then all jobs currently executing on all grids will be cancelled."
+ )
+ boolean cancel
+ );
/**
* Restart JVM.
@@ -136,16 +123,11 @@ public interface IgnitionMXBean {
* @see org.apache.ignite.Ignition#stopAll(boolean)
*/
@MXBeanDescription("Restart JVM.")
- @MXBeanParametersNames(
- {
- "cancel",
- "wait"
- })
- @MXBeanParametersDescriptions(
- {
- "If true then all jobs currently executing on default grid will be cancelled.",
- "If true then method will wait for all task being executed until they finish their execution."
- }
- )
- public void restart(boolean cancel);
+ public void restart(
+ @MXBeanParameter(
+ name = "cancel",
+ description = "If true then all jobs currently executing on default grid will be cancelled."
+ )
+ boolean cancel
+ );
}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersDescriptions.java b/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParameter.java
similarity index 81%
copy from modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersDescriptions.java
copy to modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParameter.java
index cf9681e..56f1218 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersDescriptions.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParameter.java
@@ -24,15 +24,19 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Provides MBean method parameters description.
+ * Provides name and description for MBean method parameter.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.METHOD})
-public @interface MXBeanParametersDescriptions {
+@Target({ElementType.PARAMETER})
+public @interface MXBeanParameter {
/**
- *
- * Array of descriptions for parameters.
+ * Parameter name.
*/
- public String[] value();
+ String name();
+
+ /**
+ * Parameter description.
+ */
+ String description();
}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersDescriptions.java b/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersDescriptions.java
index cf9681e..2786253 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersDescriptions.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersDescriptions.java
@@ -25,7 +25,10 @@ import java.lang.annotation.Target;
/**
* Provides MBean method parameters description.
+ *
+ * @deprecated Use {@link MXBeanParameter} instead.
*/
+@Deprecated
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersNames.java b/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersNames.java
index 6b9c9c0..22ac7c0 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersNames.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersNames.java
@@ -25,7 +25,10 @@ import java.lang.annotation.Target;
/**
* Provides MBean method parameters names.
+ *
+ * @deprecated Use {@link MXBeanParameter} instead.
*/
+@Deprecated
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
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
index e547536..cf3cd43 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/MemoryMetricsMXBean.java
@@ -110,13 +110,10 @@ public interface MemoryMetricsMXBean extends MemoryMetrics {
@MXBeanDescription(
"Sets time interval for pages allocation and eviction monitoring purposes."
)
- @MXBeanParametersNames(
- "rateTimeInterval"
- )
- @MXBeanParametersDescriptions(
- "Time interval (in milliseconds) to set."
- )
- public void rateTimeInterval(long rateTimeInterval);
+ 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
@@ -131,11 +128,7 @@ public interface MemoryMetricsMXBean extends MemoryMetrics {
@MXBeanDescription(
"Sets a number of sub-intervals to calculate allocation and eviction rates metrics."
)
- @MXBeanParametersNames(
- "subInts"
- )
- @MXBeanParametersDescriptions(
- "Number of subintervals to set."
- )
- public void subIntervals(int subInts);
+ 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/MetricsMxBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/MetricsMxBean.java
index 803546b..23f2aef 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/MetricsMxBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/MetricsMxBean.java
@@ -32,9 +32,9 @@ public interface MetricsMxBean {
* @param registry Metrics registry name.
*/
@MXBeanDescription("Resets metrics of a given registry.")
- @MXBeanParametersNames("registry")
- @MXBeanParametersDescriptions("Metrics registry.")
- public void resetMetrics(String registry);
+ public void resetMetrics(
+ @MXBeanParameter(name = "registry", description = "Metrics registry.") String registry
+ );
/**
* Change {@link HitRateMetric} configuration.
@@ -45,9 +45,10 @@ public interface MetricsMxBean {
* @throws IgniteException If some error occured.
*/
@MXBeanDescription("Configure hitrate metric.")
- @MXBeanParametersNames({"name", "cfg"})
- @MXBeanParametersDescriptions({"Metric name.", "New rate time interval."})
- public void configureHitRateMetric(String name, long rateTimeInterval) throws IgniteException;
+ public void configureHitRateMetric(
+ @MXBeanParameter(name = "name", description = "Metric name.") String name,
+ @MXBeanParameter(name = "cfg", description = "New rate time interval.") long rateTimeInterval
+ ) throws IgniteException;
/**
* Change {@link HistogramMetric} configuration.
@@ -58,7 +59,8 @@ public interface MetricsMxBean {
* @throws IgniteException If some error occured.
*/
@MXBeanDescription("Configure histogram metric.")
- @MXBeanParametersNames({"name", "cfg"})
- @MXBeanParametersDescriptions({"Metric name.", "New bounds."})
- public void configureHistogramMetric(String name, long[] bounds) throws IgniteException;
+ public void configureHistogramMetric(
+ @MXBeanParameter(name = "name", description = "Metric name.") String name,
+ @MXBeanParameter(name = "cfg", description = "New bounds.") long[] bounds
+ ) throws IgniteException;
}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java
index 0c16640..634494b 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/PersistenceMetricsMXBean.java
@@ -95,13 +95,10 @@ public interface PersistenceMetricsMXBean extends PersistenceMetrics {
@MXBeanDescription(
"Sets time interval for pages allocation and eviction monitoring purposes."
)
- @MXBeanParametersNames(
- "rateTimeInterval"
- )
- @MXBeanParametersDescriptions(
- "Time interval (in milliseconds) to set."
- )
- public void rateTimeInterval(long rateTimeInterval);
+ 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
@@ -113,11 +110,7 @@ public interface PersistenceMetricsMXBean extends PersistenceMetrics {
@MXBeanDescription(
"Sets a number of sub-intervals to calculate allocation and eviction rates metrics."
)
- @MXBeanParametersNames(
- "subInts"
- )
- @MXBeanParametersDescriptions(
- "Number of subintervals to set."
- )
- public void subIntervals(int subInts);
+ 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/TransactionMetricsMxBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/TransactionMetricsMxBean.java
index a9b5e42..ce16aed 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/TransactionMetricsMxBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/TransactionMetricsMxBean.java
@@ -43,9 +43,9 @@ public interface TransactionMetricsMxBean extends TransactionMetrics {
* @return near transactions.
*/
@MXBeanDescription("Long running near transactions.")
- @MXBeanParametersNames("duration")
- @MXBeanParametersDescriptions("Duration, at least (ms).")
- @Override public Map<String, String> getLongRunningOwnerTransactions(int duration);
+ @Override public Map<String, String> getLongRunningOwnerTransactions(
+ @MXBeanParameter(name = "duration", description = "Duration, at least (ms).") int duration
+ );
/**
* The number of transactions which were committed.
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/TransactionsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/TransactionsMXBean.java
index 245d9c0..f7f8831 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/TransactionsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/TransactionsMXBean.java
@@ -37,36 +37,28 @@ public interface TransactionsMXBean {
* @param kill Kill.
*/
@MXBeanDescription("Returns or kills transactions matching the filter conditions.")
- @MXBeanParametersNames(
- {
- "minDuration",
- "minSize",
- "prj",
- "consistentIds",
- "xid",
- "lbRegex",
- "limit",
- "order",
- "detailed",
- "kill"
- }
- )
- @MXBeanParametersDescriptions(
- {
- "Minimum duration (seconds).",
- "Minimum size.",
- "Projection (servers|clients).",
- "Consistent ids (separated by comma).",
- "Transaction XID.",
- "Label regexp.",
- "Limit a number of transactions collected on each node.",
- "Order by DURATION|SIZE.",
- "Show detailed description, otherwise only count.",
- "Kill matching transactions (be careful)."
- }
- )
- public String getActiveTransactions(Long minDuration, Integer minSize, String prj,
- String consistentIds, String xid, String lbRegex, Integer limit, String order, boolean detailed, boolean kill);
+ public String getActiveTransactions(
+ @MXBeanParameter(name = "minDuration", description = "Minimum duration (seconds).")
+ Long minDuration,
+ @MXBeanParameter(name = "minSize", description = "Minimum size.")
+ Integer minSize,
+ @MXBeanParameter(name = "prj", description = "Projection (servers|clients).")
+ String prj,
+ @MXBeanParameter(name = "consistentIds", description = "Consistent ids (separated by comma).")
+ String consistentIds,
+ @MXBeanParameter(name = "xid", description = "Transaction XID.")
+ String xid,
+ @MXBeanParameter(name = "lbRegex", description = "Label regexp.")
+ String lbRegex,
+ @MXBeanParameter(name = "limit", description = "Limit a number of transactions collected on each node.")
+ Integer limit,
+ @MXBeanParameter(name = "order", description = "Order by DURATION|SIZE.")
+ String order,
+ @MXBeanParameter(name = "detailed", description = "Show detailed description, otherwise only count.")
+ boolean detailed,
+ @MXBeanParameter(name = "kill", description = "Kill matching transactions (be careful).")
+ boolean kill
+ );
/**
* Gets transaction timeout on partition map exchange.
@@ -89,13 +81,10 @@ public interface TransactionsMXBean {
* @param timeout Transaction timeout on partition map exchange in milliseconds.
*/
@MXBeanDescription("Sets transaction timeout on partition map exchange in milliseconds.")
- @MXBeanParametersNames(
- "timeout"
- )
- @MXBeanParametersDescriptions(
- "Transaction timeout on partition map exchange in milliseconds."
- )
- public void setTxTimeoutOnPartitionMapExchange(long timeout);
+ public void setTxTimeoutOnPartitionMapExchange(
+ @MXBeanParameter(name = "timeout",
+ description = "Transaction timeout on partition map exchange in milliseconds.") long timeout
+ );
/**
* Shows if dump requests from local node to near node are allowed, when long running transaction
@@ -123,11 +112,9 @@ public interface TransactionsMXBean {
"when long running transaction is found. If allowed, the compute request to near " +
"node will be made to get thread dump of transaction owner thread."
)
- @MXBeanParametersNames("allowed")
- @MXBeanParametersDescriptions(
- "whether to allow"
- )
- public void setTxOwnerDumpRequestsAllowed(boolean allowed);
+ public void setTxOwnerDumpRequestsAllowed(
+ @MXBeanParameter(name = "allowed", description = "Whether to allow.") boolean allowed
+ );
/**
* Returns threshold timeout in milliseconds for long transactions, if transaction exceeds it,
@@ -163,9 +150,9 @@ public interface TransactionsMXBean {
"and user time (time when client node runs some code while holding transaction). " +
"Can be set to 0 - no transactions will be dumped in log in this case."
)
- @MXBeanParametersNames("threshold")
- @MXBeanParametersDescriptions("threshold timeout")
- public void setLongTransactionTimeDumpThreshold(long threshold);
+ public void setLongTransactionTimeDumpThreshold(
+ @MXBeanParameter(name = "threshold", description = "Threshold timeout.") long threshold
+ );
/**
* Returns the coefficient for samples of completed transactions that will be dumped in log.
@@ -185,9 +172,9 @@ public interface TransactionsMXBean {
@MXBeanDescription(
"Sets the coefficient for samples of completed transactions that will be dumped in log."
)
- @MXBeanParametersNames("coefficient")
- @MXBeanParametersDescriptions("Samples coefficient.")
- public void setTransactionTimeDumpSamplesCoefficient(double coefficient);
+ public void setTransactionTimeDumpSamplesCoefficient(
+ @MXBeanParameter(name = "coefficient", description = "Samples coefficient.") double coefficient
+ );
/**
* Returns the limit of samples of completed transactions that will be dumped in log per second,
@@ -215,9 +202,9 @@ public interface TransactionsMXBean {
"if {@link #getTransactionTimeDumpSamplesCoefficient} is above <code>0.0</code>. " +
"Must be integer value greater than <code>0</code>."
)
- @MXBeanParametersNames("limit")
- @MXBeanParametersDescriptions("Samples per second limit.")
- public void setTransactionTimeDumpSamplesPerSecondLimit(int limit);
+ public void setTransactionTimeDumpSamplesPerSecondLimit(
+ @MXBeanParameter(name = "limit", description = "Samples per second limit.") int limit
+ );
/**
* Setting a timeout (in millis) for printing long-running transactions as
@@ -230,9 +217,9 @@ public interface TransactionsMXBean {
"Setting a timeout (in millis) for printing long-running transactions as well as transactions that cannot " +
"receive locks for all their keys for a long time. Set less than or equal {@code 0} to disable."
)
- @MXBeanParametersNames("timeout")
- @MXBeanParametersDescriptions("Long operations dump timeout.")
- void setLongOperationsDumpTimeout(long timeout);
+ void setLongOperationsDumpTimeout(
+ @MXBeanParameter(name = "timeout", description = "Long operations dump timeout.") long timeout
+ );
/**
* Returns a timeout (in millis) for printing long-running transactions as
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/WorkersControlMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/WorkersControlMXBean.java
index b999ab7..e4e2d29 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/WorkersControlMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/WorkersControlMXBean.java
@@ -39,13 +39,9 @@ public interface WorkersControlMXBean {
* @return {@code True} if worker has been terminated successfully, {@code false} otherwise.
*/
@MXBeanDescription("Terminates worker.")
- @MXBeanParametersNames(
- "name"
- )
- @MXBeanParametersDescriptions(
- "Name of worker to terminate."
- )
- public boolean terminateWorker(String name);
+ public boolean terminateWorker(
+ @MXBeanParameter(name = "name", description = "Name of worker to terminate.") String name
+ );
/**
* Stops thread by {@code name}, if exists and unique.
@@ -54,13 +50,9 @@ public interface WorkersControlMXBean {
* @return {@code True} if thread has been stopped successfully, {@code false} otherwise.
*/
@MXBeanDescription("Stops thread by unique name.")
- @MXBeanParametersNames(
- "name"
- )
- @MXBeanParametersDescriptions(
- "Name of thread to stop."
- )
- public boolean stopThreadByUniqueName(String name);
+ public boolean stopThreadByUniqueName(
+ @MXBeanParameter(name = "name", description = "Name of thread to stop.") String name
+ );
/**
* Stops thread by {@code id}, if exists.
@@ -69,11 +61,7 @@ public interface WorkersControlMXBean {
* @return {@code True} if thread has been stopped successfully, {@code false} otherwise.
*/
@MXBeanDescription("Stops thread by id.")
- @MXBeanParametersNames(
- "id"
- )
- @MXBeanParametersDescriptions(
- "Id of thread to stop."
- )
- public boolean stopThreadById(long id);
+ public boolean stopThreadById(
+ @MXBeanParameter(name = "id", description = "Id of thread to stop.") long id
+ );
}
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java
index 9cd03c2..cee4a4d 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiMBean.java
@@ -20,8 +20,7 @@ package org.apache.ignite.spi.discovery.tcp;
import java.util.Map;
import java.util.UUID;
import org.apache.ignite.mxbean.MXBeanDescription;
-import org.apache.ignite.mxbean.MXBeanParametersDescriptions;
-import org.apache.ignite.mxbean.MXBeanParametersNames;
+import org.apache.ignite.mxbean.MXBeanParameter;
import org.apache.ignite.spi.IgniteSpiManagementMBean;
import org.apache.ignite.spi.discovery.DiscoverySpiMBean;
import org.jetbrains.annotations.Nullable;
@@ -278,17 +277,10 @@ public interface TcpDiscoverySpiMBean extends IgniteSpiManagementMBean, Discover
* @param maxHops Maximum hops for the message (3 * TOTAL_NODE_CNT is recommended).
*/
@MXBeanDescription("Check ring latency.")
- @MXBeanParametersNames(
- {
- "maxHops"
- }
- )
- @MXBeanParametersDescriptions(
- {
- "Maximum hops for the message (3 * TOTAL_NODE_CNT is recommended)."
- }
- )
- public void checkRingLatency(int maxHops);
+ public void checkRingLatency(
+ @MXBeanParameter(name = "maxHops",
+ description = "Maximum hops for the message (3 * TOTAL_NODE_CNT is recommended).") int maxHops
+ );
/**
* Current topology version.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/mxbean/IgniteStandardMXBeanTest.java b/modules/core/src/test/java/org/apache/ignite/internal/mxbean/IgniteStandardMXBeanTest.java
new file mode 100644
index 0000000..77f3e8a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/mxbean/IgniteStandardMXBeanTest.java
@@ -0,0 +1,585 @@
+/*
+ * 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.mxbean;
+
+import java.lang.reflect.Method;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
+import javax.management.NotCompliantMBeanException;
+import org.apache.ignite.mxbean.MXBeanParameter;
+import org.apache.ignite.mxbean.MXBeanParametersDescriptions;
+import org.apache.ignite.mxbean.MXBeanParametersNames;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Contains tests for {@link IgniteStandardMXBean} methods.
+ */
+public class IgniteStandardMXBeanTest {
+ /** */
+ private static final String NAME = "Name";
+
+ /** */
+ private static final String TYPE = "Type";
+
+ /** */
+ private static final String OPERATION_INFO_DESCRIPTION = "Operation info description";
+
+ /** */
+ private static final String PARAMETER_INFO_DESCRIPTION = "Parameter info description";
+
+ /** */
+ private static final String EMPTY_STRING = "";
+
+ /** */
+ private static final String TEST_METHOD_1 = "testMethod1";
+
+ /** */
+ private static final String TEST_METHOD_2 = "testMethod2";
+
+ /** */
+ private static final String TEST_METHOD_3 = "testMethod3";
+
+ /** */
+ private static final String TEST_METHOD_4 = "testMethod4";
+
+ /** */
+ private static final String TEST_METHOD_5 = "testMethod5";
+
+ /** */
+ private static final String TEST_METHOD_6 = "testMethod6";
+
+ /** */
+ private static final String TEST_METHOD_7 = "testMethod7";
+
+ /** */
+ private static final String TEST_METHOD_8 = "testMethod8";
+
+ /** */
+ private static final String TEST_METHOD_9 = "testMethod9";
+
+ /** */
+ private static final String TEST_METHOD_10 = "testMethod10";
+
+ /** */
+ private static final String FIRST_DESCRIPTION_PARAM_ANNOTATION = "First description parameter annotation.";
+
+ /** */
+ private static final String FIRST_DESCRIPTION_METHOD_ANNOTATION = "First description method annotation.";
+
+ /** */
+ private static final String SECOND_DESCRIPTION_PARAM_ANNOTATION = "Second description parameter annotation.";
+
+ /** */
+ private static final String SECOND_DESCRIPTION_METHOD_ANNOTATION = "Second description method annotation.";
+
+ /** */
+ private static final String FIRST_NAME_PARAM_ANNOTATION = "First name parameter annotation";
+
+ /** */
+ private static final String FIRST_NAME_METHOD_ANNOTATION = "First name method annotation";
+
+ /** */
+ private static final String SECOND_NAME_PARAM_ANNOTATION = "Second name parameter annotation";
+
+ /** */
+ private static final String SECOND_NAME_METHOD_ANNOTATION = "Second name method annotation";
+
+ /** */
+ private static final String FIRST_LOWERCASE_LETTER = "first lowercase letter.";
+
+ /** */
+ private static final String NO_DOT_AT_THE_END_OF_THE_STRING = "No dot at the end of the string";
+
+ /** */
+ private static final int ZERO_INDEX = 0;
+
+ /** */
+ private static final int FIRST_INDEX = 1;
+
+ /**
+ * Instance of {@link IgniteStandardMXBean}.
+ */
+ private final IgniteStandardMXBean igniteStandardMXBean;
+
+ /**
+ * Instance of {@link MBeanParameterInfo}.
+ */
+ private final MBeanParameterInfo paramInfo;
+
+ /**
+ * Public constructor that initializes instances of IgniteStandardMXBean and MBeanParameterInfo classes.
+ */
+ public IgniteStandardMXBeanTest() throws NotCompliantMBeanException {
+ TestInterfaceImpl testItfImpl = new TestInterfaceImpl();
+
+ igniteStandardMXBean = new IgniteStandardMXBean(testItfImpl, TestInterface.class);
+
+ paramInfo = new MBeanParameterInfo(NAME, TYPE, PARAMETER_INFO_DESCRIPTION);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * All annotation parameters are valid.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test
+ public void getDescription_OldAnnotation() throws NoSuchMethodException {
+ String actualRes = getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_1, FIRST_INDEX);
+
+ assertEquals(SECOND_DESCRIPTION_METHOD_ANNOTATION, actualRes);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * An empty array is used as parameters in the annotation resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getDescription_OldAnnotationEmptyValueArray() throws NoSuchMethodException {
+ getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_2, FIRST_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * An array whose length is less than transmitted parameter index is used as a parameter
+ * resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getDescription_OldAnnotationValueLengthLessThenParamIndex() throws NoSuchMethodException {
+ getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_3, FIRST_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * Empty description parameter value resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getDescription_OldAnnotationEmptyParamValue() throws NoSuchMethodException {
+ getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_4, ZERO_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * Description parameter without a dot at the end of the sentence resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getDescription_OldAnnotationNoDotAtTheEndOfTheString() throws NoSuchMethodException {
+ getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_5, ZERO_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * Description parameter starts with a lowercase letter resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getDescription_OldAnnotationFirstLowercaseLetter() throws NoSuchMethodException {
+ getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_5, FIRST_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only new annotations.
+ * All annotation parameters are valid.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test
+ public void getDescription_NewAnnotation() throws NoSuchMethodException {
+ String actualRes = getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_6, FIRST_INDEX);
+
+ assertEquals(SECOND_DESCRIPTION_PARAM_ANNOTATION, actualRes);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only new annotations.
+ * Empty description parameter value resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getDescription_NewAnnotationEmptyParamValue() throws NoSuchMethodException {
+ getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_7, ZERO_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only new annotation.
+ * Description parameter without a dot at the end of the sentence resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getDescription_NewAnnotationNoDotAtTheEndOfTheString() throws NoSuchMethodException {
+ getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_8, ZERO_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only new annotations.
+ * Description parameter starts with a lowercase letter resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getDescription_NewAnnotationFirstLowercaseLetter() throws NoSuchMethodException {
+ getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_8, FIRST_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has both old and new annotations.
+ * All annotations parameters are valid.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test
+ public void getDescription_BothOldAndNewAnnotations() throws NoSuchMethodException {
+ String actualRes = getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_9, FIRST_INDEX);
+
+ assertEquals(SECOND_DESCRIPTION_METHOD_ANNOTATION, actualRes);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has no annotations at all.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test
+ public void getDescription_NoAnnotations() throws NoSuchMethodException {
+ String actualRes = getDescriptionWithMethodNameAndParamIndex(TEST_METHOD_10, FIRST_INDEX);
+
+ assertEquals(PARAMETER_INFO_DESCRIPTION, actualRes);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only the old annotation.
+ * All annotation parameters are valid.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test
+ public void getParameterName_OldAnnotation() throws NoSuchMethodException {
+ String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_1, FIRST_INDEX);
+
+ assertEquals(SECOND_NAME_METHOD_ANNOTATION, actualRes);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * An empty array is used as parameters in the annotation resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getParameterName_OldAnnotationEmptyValueArray() throws NoSuchMethodException {
+ getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_2, FIRST_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * An array whose length is less than transmitted parameter index is used as a parameter
+ * resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getParameterName_OldAnnotationValueLengthLessThenParamIndex() throws NoSuchMethodException {
+ getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_3, FIRST_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only old annotation.
+ * Empty parameter name value resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getParameterName_OldAnnotationEmptyParamValue() throws NoSuchMethodException {
+ getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_4, ZERO_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only new annotations.
+ * All annotation parameters are valid.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test
+ public void getParameterName_NewAnnotation() throws NoSuchMethodException {
+ String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_6, FIRST_INDEX);
+
+ assertEquals(SECOND_NAME_PARAM_ANNOTATION, actualRes);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has only new annotations.
+ * Empty parameter name value resulting in an AssertionError.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test(expected = AssertionError.class)
+ public void getParameterName_NewAnnotationEmptyParamValue() throws NoSuchMethodException {
+ getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_7, ZERO_INDEX);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has both old and new annotations.
+ * All annotations parameters are valid.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test
+ public void getParameterName_BothOldAndNewAnnotations() throws NoSuchMethodException {
+ String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_9, FIRST_INDEX);
+
+ assertEquals(SECOND_NAME_METHOD_ANNOTATION, actualRes);
+ }
+
+ /**
+ * A test method that represents a situation in which the method has no annotations at all.
+ *
+ * @throws NoSuchMethodException if method is not found.
+ */
+ @Test
+ public void getParameterName_NoAnnotations() throws NoSuchMethodException {
+ String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_10, FIRST_INDEX);
+
+ assertEquals(NAME, actualRes);
+ }
+
+ /**
+ * Utility method that returns the description for method argument by method name and parameter index.
+ *
+ * @param mName method name from interface TestInterface.
+ * @param paramIdx the sequence number of the argument considered.
+ * @return the description for method argument.
+ * @throws NoSuchMethodException if a matching method is not found.
+ */
+ private String getDescriptionWithMethodNameAndParamIndex(String mName, int paramIdx)
+ throws NoSuchMethodException {
+ MBeanOperationInfo operationInfo = getMBeanOperationInfoWithMehtodName(mName);
+ return igniteStandardMXBean.getDescription(operationInfo, paramInfo, paramIdx);
+ }
+
+ /**
+ * Utility method that returns the name for method argument by method name and parameter index.
+ *
+ * @param mName method name from interface TestInterface.
+ * @param paramIdx the sequence number of the argument considered.
+ * @return the name for method argument.
+ * @throws NoSuchMethodException if a matching method is not found.
+ */
+ private String getParameterNameWithMethodNameAndParamIndex(String mName, int paramIdx)
+ throws NoSuchMethodException {
+ MBeanOperationInfo operationInfo = getMBeanOperationInfoWithMehtodName(mName);
+ return igniteStandardMXBean.getParameterName(operationInfo, paramInfo, paramIdx);
+ }
+
+ /**
+ * Utility method for getting instance of MBeanOperationInfo constructed with default description from TestInterface
+ * by its method name.
+ *
+ * @param mName method name from interface TestInterface.
+ * @return MBeanOperationInfo.
+ * @throws NoSuchMethodException if a matching method is not found.
+ */
+ private MBeanOperationInfo getMBeanOperationInfoWithMehtodName(String mName) throws NoSuchMethodException {
+ Method m = TestInterface.class.getDeclaredMethod(mName, String.class, String.class);
+ return new MBeanOperationInfo(OPERATION_INFO_DESCRIPTION, m);
+ }
+
+ /**
+ * Interface used for testing.
+ */
+ public static interface TestInterface {
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ @MXBeanParametersNames({FIRST_NAME_METHOD_ANNOTATION, SECOND_NAME_METHOD_ANNOTATION})
+ @MXBeanParametersDescriptions({FIRST_DESCRIPTION_METHOD_ANNOTATION, SECOND_DESCRIPTION_METHOD_ANNOTATION})
+ void testMethod1(String firstParam, String secondParam);
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ @MXBeanParametersNames({})
+ @MXBeanParametersDescriptions({})
+ void testMethod2(String firstParam, String secondParam);
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ @MXBeanParametersNames({FIRST_NAME_METHOD_ANNOTATION})
+ @MXBeanParametersDescriptions({FIRST_DESCRIPTION_METHOD_ANNOTATION})
+ void testMethod3(String firstParam, String secondParam);
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ @MXBeanParametersNames({EMPTY_STRING})
+ @MXBeanParametersDescriptions({EMPTY_STRING})
+ void testMethod4(String firstParam, String secondParam);
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ @MXBeanParametersNames({FIRST_NAME_METHOD_ANNOTATION, SECOND_NAME_METHOD_ANNOTATION})
+ @MXBeanParametersDescriptions({NO_DOT_AT_THE_END_OF_THE_STRING, FIRST_LOWERCASE_LETTER})
+ void testMethod5(String firstParam, String secondParam);
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ void testMethod6(
+ @MXBeanParameter(name = FIRST_NAME_PARAM_ANNOTATION, description = FIRST_DESCRIPTION_PARAM_ANNOTATION)
+ String firstParam,
+ @MXBeanParameter(name = SECOND_NAME_PARAM_ANNOTATION, description = SECOND_DESCRIPTION_PARAM_ANNOTATION)
+ String secondParam
+ );
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ void testMethod7(
+ @MXBeanParameter(name = EMPTY_STRING, description = EMPTY_STRING)
+ String firstParam,
+ @MXBeanParameter(name = SECOND_NAME_PARAM_ANNOTATION, description = SECOND_DESCRIPTION_PARAM_ANNOTATION)
+ String secondParam
+ );
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ void testMethod8(
+ @MXBeanParameter(name = FIRST_NAME_PARAM_ANNOTATION, description = NO_DOT_AT_THE_END_OF_THE_STRING)
+ String firstParam,
+ @MXBeanParameter(name = SECOND_NAME_PARAM_ANNOTATION, description = FIRST_LOWERCASE_LETTER)
+ String secondParam
+ );
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ @MXBeanParametersNames({FIRST_NAME_METHOD_ANNOTATION, SECOND_NAME_METHOD_ANNOTATION})
+ @MXBeanParametersDescriptions({FIRST_DESCRIPTION_METHOD_ANNOTATION, SECOND_DESCRIPTION_METHOD_ANNOTATION})
+ void testMethod9(
+ @MXBeanParameter(name = FIRST_NAME_PARAM_ANNOTATION, description = NO_DOT_AT_THE_END_OF_THE_STRING)
+ String firstParam,
+ @MXBeanParameter(name = SECOND_NAME_PARAM_ANNOTATION, description = FIRST_LOWERCASE_LETTER)
+ String secondParam
+ );
+
+ /**
+ * Method used for testing.
+ *
+ * @param firstParam first string method parameter.
+ * @param secondParam second string method parameter.
+ */
+ void testMethod10(String firstParam, String secondParam);
+ }
+
+ /**
+ * Test interface implementation.
+ */
+ private static class TestInterfaceImpl implements TestInterface {
+ /** {@inheritDoc} */
+ @Override public void testMethod1(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod2(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod3(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod4(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod5(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod6(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod7(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod8(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod9(String firstParam, String secondParam) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testMethod10(String firstParam, String secondParam) {
+ // No-op.
+ }
+ }
+}
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersNames.java b/modules/core/src/test/java/org/apache/ignite/internal/mxbean/package-info.java
similarity index 62%
copy from modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersNames.java
copy to modules/core/src/test/java/org/apache/ignite/internal/mxbean/package-info.java
index 6b9c9c0..e474186 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/MXBeanParametersNames.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/mxbean/package-info.java
@@ -15,24 +15,9 @@
* limitations under the License.
*/
-package org.apache.ignite.mxbean;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
/**
- * Provides MBean method parameters names.
+ * <!-- Package description. -->
+ * Contains internal tests for mxbeans stuff.
*/
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.METHOD})
-public @interface MXBeanParametersNames {
- /**
- *
- * Array of parameter names in MBean.
- */
- public String[] value();
-}
+
+package org.apache.ignite.internal.mxbean;
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
index 44a01a6..aeead5f 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBasicTestSuite.java
@@ -50,6 +50,7 @@ import org.apache.ignite.internal.managers.IgniteDiagnosticMessagesMultipleConne
import org.apache.ignite.internal.managers.IgniteDiagnosticMessagesTest;
import org.apache.ignite.internal.managers.communication.GridIoManagerFileTransmissionSelfTest;
import org.apache.ignite.internal.managers.discovery.IncompleteDeserializationExceptionTest;
+import org.apache.ignite.internal.mxbean.IgniteStandardMXBeanTest;
import org.apache.ignite.internal.pagemem.wal.record.WALRecordSerializationTest;
import org.apache.ignite.internal.pagemem.wal.record.WALRecordTest;
import org.apache.ignite.internal.processors.DeadLockOnNodeLeftExchangeTest;
@@ -283,7 +284,9 @@ import org.junit.runners.Suite;
IncompleteDeserializationExceptionTest.class,
- GridIoManagerFileTransmissionSelfTest.class
+ GridIoManagerFileTransmissionSelfTest.class,
+
+ IgniteStandardMXBeanTest.class
})
public class IgniteBasicTestSuite {
}
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/mxbean/SqlQueryMXBean.java b/modules/indexing/src/main/java/org/apache/ignite/internal/mxbean/SqlQueryMXBean.java
index 6380393..b8639d1 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/mxbean/SqlQueryMXBean.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/mxbean/SqlQueryMXBean.java
@@ -18,8 +18,7 @@
package org.apache.ignite.internal.mxbean;
import org.apache.ignite.mxbean.MXBeanDescription;
-import org.apache.ignite.mxbean.MXBeanParametersDescriptions;
-import org.apache.ignite.mxbean.MXBeanParametersNames;
+import org.apache.ignite.mxbean.MXBeanParameter;
/**
* An MX bean allowing to monitor and tune SQL queries.
@@ -40,9 +39,11 @@ public interface SqlQueryMXBean {
* @param longQueryWarningTimeout Timeout in milliseconds after which long query warning will be printed.
*/
@MXBeanDescription("Sets timeout in milliseconds after which long query warning will be printed.")
- @MXBeanParametersNames("longQueryWarningTimeout")
- @MXBeanParametersDescriptions("Timeout in milliseconds after which long query warning will be printed.")
- void setLongQueryWarningTimeout(long longQueryWarningTimeout);
+ void setLongQueryWarningTimeout(
+ @MXBeanParameter(name = "longQueryWarningTimeout",
+ description = "Timeout in milliseconds after which long query warning will be printed.")
+ long longQueryWarningTimeout
+ );
/**
* @return Long query timeout multiplier.
@@ -65,7 +66,8 @@ public interface SqlQueryMXBean {
@MXBeanDescription("Sets long query timeout multiplier. The warning will be printed after: timeout, " +
"timeout * multiplier, timeout * multiplier * multiplier, etc. " +
"If the multiplier <= 1, the warning message is printed once.")
- @MXBeanParametersNames("longQueryTimeoutMultiplier")
- @MXBeanParametersDescriptions("Long query timeout multiplier.")
- void setLongQueryTimeoutMultiplier(int longQueryTimeoutMultiplier);
+ void setLongQueryTimeoutMultiplier(
+ @MXBeanParameter(name = "longQueryTimeoutMultiplier", description = "Long query timeout multiplier.")
+ int longQueryTimeoutMultiplier
+ );
}