Class IgniteMXBeanImpl
- java.lang.Object
-
- org.apache.ignite.internal.IgniteMXBeanImpl
-
- All Implemented Interfaces:
IgniteMXBean
public class IgniteMXBeanImpl extends Object implements IgniteMXBean
Implementation ofIgniteMXBean.
-
-
Field Summary
-
Fields inherited from interface org.apache.ignite.mxbean.IgniteMXBean
ACTIVE_DESC, CHECKPOINT_SPI_FORMATTED_DESC, CLUSTER_STATE_DESC, COLLISION_SPI_FORMATTED_DESC, COMMUNICATION_SPI_FORMATTED_DESC, COPYRIGHT_DESC, CUR_COORDINATOR_FORMATTED_DESC, DEPLOYMENT_SPI_FORMATTED_DESC, DISCOVERY_SPI_FORMATTED_DESC, EVT_STORAGE_SPI_FORMATTED_DESC, EXECUTOR_SRVC_FORMATTED_DESC, FAILOVER_SPI_FORMATTED_DESC, FULL_VER_DESC, GRID_LOG_FORMATTED_DESC, IGNITE_HOME_DESC, INSTANCE_NAME_DESC, IS_NODE_BASELINE_DESC, IS_PEER_CLS_LOADING_ENABLED_DESC, IS_REBALANCE_ENABLED_DESC, JDK_INFO_DESC, LAST_CLUSTER_STATE_CHANGE_TIME_DESC, LIFECYCLE_BEANS_FORMATTED_DESC, LOAD_BALANCING_SPI_FORMATTED_DESC, LOC_NODE_ID_DESC, LONG_JVM_PAUSE_LAST_EVENTS_DESC, LONG_JVM_PAUSES_CNT_DESC, LONG_JVM_PAUSES_TOTAL_DURATION_DESC, MBEAN_SERVER_FORMATTED_DESC, OS_INFO_DESC, OS_USER_DESC, READ_ONLY_MODE_DESC, READ_ONLY_MODE_DURATION_DESC, START_TIMESTAMP_DESC, START_TIMESTAMP_FORMATTED_DESC, UPTIME_DESC, UPTIME_FORMATTED_DESC, USER_ATTRS_FORMATTED_DESC, VM_NAME_DESC
-
-
Constructor Summary
Constructors Constructor Description IgniteMXBeanImpl(IgniteKernal kernal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanactive()Checks if Ignite grid is active.voidactive(boolean active)Changes Ignite grid state to active or inactive.voidclearNodeLocalMap()Clears node local map.StringclusterState()Checks cluster state.voidclusterState(String state)Changes current cluster state.voidclusterState(String state, boolean forceDeactivation)Changes current cluster state.voiddumpDebugInfo()Dumps debug information for the current node.StringexecuteTask(String taskName, String arg)A shortcut method that executes given task assuming singlejava.lang.Stringargument andjava.lang.Stringreturn type.StringgetCheckpointSpiFormatted()Gets a formatted instance of configured checkpoint SPI implementation.StringgetCollisionSpiFormatted()Gets a formatted instance of configured collision SPI implementations.StringgetCommunicationSpiFormatted()Gets a formatted instance of fully configured SPI communication implementation.StringgetCopyright()Gets copyright statement for Ignite product.StringgetCurrentCoordinatorFormatted()Gets a formatted properties of current coordinator.StringgetDeploymentSpiFormatted()Gets a formatted instance of fully configured deployment SPI implementation.StringgetDiscoverySpiFormatted()Gets a formatted instance of configured discovery SPI implementation.StringgetEventStorageSpiFormatted()Gets a formatted instance of fully configured event SPI implementation.StringgetExecutorServiceFormatted()Gets a formatted instance of fully configured thread pool that is used in grid.StringgetFailoverSpiFormatted()Gets a formatted instance of fully configured failover SPI implementations.StringgetFullVersion()Gets string presentation of the version.StringgetGridLoggerFormatted()Gets a formatted instance of logger that is in grid.StringgetIgniteHome()Gets Ignite installation home folder.StringgetInstanceName()Gets optional kernal instance name.StringgetJdkInformation()Gets JDK information.List<String>getLifecycleBeansFormatted()GetstoString()representation of of lifecycle beans configured with Ignite.StringgetLoadBalancingSpiFormatted()Gets a formatted instance of fully configured load balancing SPI implementations.UUIDgetLocalNodeId()Unique identifier for this node within grid.Map<Long,Long>getLongJVMPauseLastEvents()Gets long JVM pause last events.longgetLongJVMPausesCount()Gets long JVM pauses count.longgetLongJVMPausesTotalDuration()Gets long JVM pauses total duration.StringgetMBeanServerFormatted()Gets a formatted instance of MBean server instance.StringgetOsInformation()Gets OS information.StringgetOsUser()Gets OS user.longgetStartTimestamp()Get start timestamp of the kernal.StringgetStartTimestampFormatted()Gets string presentation of the kernal start timestamp.longgetUpTime()Gets up-time of the kernal.StringgetUpTimeFormatted()Gets string presentation of up-time for the kernal.List<String>getUserAttributesFormatted()Gets a list of formatted user-defined attributes added to this node.StringgetVmName()Gets VM name.booleanisNodeInBaseline()Gets a flag whether local node is in baseline.booleanisPeerClassLoadingEnabled()Returnstrueif peer class loading is enabled,falseotherwise.booleanisRebalanceEnabled()Gets rebalance enabled flag.longlastClusterStateChangeTime()Gets last cluster state change operation.booleanpingNode(String nodeId)Pings node with given node ID to see whether it is alive.booleanpingNodeByAddress(String host)Pings node with given host name to see if it is alive.voidprintLastErrors()Prints errors.voidrebalanceEnabled(boolean rebalanceEnabled)Enable or disable cache partition rebalance per node.booleanremoveCheckpoint(String key)This method allows manually remove the checkpoint with givenkey.voidrunIoTest(long warmup, long duration, int threads, long maxLatency, int rangesCnt, int payLoadSize, boolean procFromNioThread)Runs IO latency test against all remote server nodes in cluster.voidundeployTaskFromGrid(String taskName)Makes the best attempt to undeploy a task from the whole grid.
-
-
-
Constructor Detail
-
IgniteMXBeanImpl
public IgniteMXBeanImpl(IgniteKernal kernal)
- Parameters:
kernal- Ignite kernel to work with.
-
-
Method Detail
-
active
public boolean active()
Checks if Ignite grid is active. If Ignite grid is not active returnFalse.- Specified by:
activein interfaceIgniteMXBean- Returns:
Trueif grid is active.FalseIf grid is not active.
-
active
public void active(boolean active) throws JMExceptionChanges Ignite grid state to active or inactive.NOTE: Deactivation clears in-memory caches (without persistence) including the system caches.
- Specified by:
activein interfaceIgniteMXBean- Parameters:
active- Activate/DeActivate flag.- Throws:
JMException- if deactivation is forbidden or stopped.
-
getCopyright
public String getCopyright()
Gets copyright statement for Ignite product.- Specified by:
getCopyrightin interfaceIgniteMXBean- Returns:
- Copyright statement for Ignite product.
-
getStartTimestamp
public long getStartTimestamp()
Get start timestamp of the kernal.- Specified by:
getStartTimestampin interfaceIgniteMXBean- Returns:
- Start timestamp of the kernal.
-
getStartTimestampFormatted
public String getStartTimestampFormatted()
Gets string presentation of the kernal start timestamp.- Specified by:
getStartTimestampFormattedin interfaceIgniteMXBean- Returns:
- String presentation of the kernal start timestamp.
-
getUpTime
public long getUpTime()
Gets up-time of the kernal.- Specified by:
getUpTimein interfaceIgniteMXBean- Returns:
- Up-time of the kernal.
-
getLongJVMPausesCount
public long getLongJVMPausesCount()
Gets long JVM pauses count.- Specified by:
getLongJVMPausesCountin interfaceIgniteMXBean- Returns:
- Long JVM pauses count.
-
getLongJVMPausesTotalDuration
public long getLongJVMPausesTotalDuration()
Gets long JVM pauses total duration.- Specified by:
getLongJVMPausesTotalDurationin interfaceIgniteMXBean- Returns:
- Long JVM pauses total duration.
-
getLongJVMPauseLastEvents
public Map<Long,Long> getLongJVMPauseLastEvents()
Gets long JVM pause last events.- Specified by:
getLongJVMPauseLastEventsin interfaceIgniteMXBean- Returns:
- Long JVM pause last events.
-
getUpTimeFormatted
public String getUpTimeFormatted()
Gets string presentation of up-time for the kernal.- Specified by:
getUpTimeFormattedin interfaceIgniteMXBean- Returns:
- String presentation of up-time for the kernal.
-
getFullVersion
public String getFullVersion()
Gets string presentation of the version.- Specified by:
getFullVersionin interfaceIgniteMXBean- Returns:
- String presentation of the version.
-
getCheckpointSpiFormatted
public String getCheckpointSpiFormatted()
Gets a formatted instance of configured checkpoint SPI implementation.- Specified by:
getCheckpointSpiFormattedin interfaceIgniteMXBean- Returns:
- Grid checkpoint SPI implementation.
-
getCurrentCoordinatorFormatted
public String getCurrentCoordinatorFormatted()
Gets a formatted properties of current coordinator.- Specified by:
getCurrentCoordinatorFormattedin interfaceIgniteMXBean- Returns:
- String representation of current coordinator node.
-
isNodeInBaseline
public boolean isNodeInBaseline()
Gets a flag whether local node is in baseline. Returns false if baseline topology is not established.- Specified by:
isNodeInBaselinein interfaceIgniteMXBean- Returns:
- Return a baseline flag.
-
getCommunicationSpiFormatted
public String getCommunicationSpiFormatted()
Gets a formatted instance of fully configured SPI communication implementation.- Specified by:
getCommunicationSpiFormattedin interfaceIgniteMXBean- Returns:
- Grid communication SPI implementation.
-
getDeploymentSpiFormatted
public String getDeploymentSpiFormatted()
Gets a formatted instance of fully configured deployment SPI implementation.- Specified by:
getDeploymentSpiFormattedin interfaceIgniteMXBean- Returns:
- Grid deployment SPI implementation.
-
getDiscoverySpiFormatted
public String getDiscoverySpiFormatted()
Gets a formatted instance of configured discovery SPI implementation.- Specified by:
getDiscoverySpiFormattedin interfaceIgniteMXBean- Returns:
- Grid discovery SPI implementation.
-
getEventStorageSpiFormatted
public String getEventStorageSpiFormatted()
Gets a formatted instance of fully configured event SPI implementation.- Specified by:
getEventStorageSpiFormattedin interfaceIgniteMXBean- Returns:
- Grid event SPI implementation.
-
getCollisionSpiFormatted
public String getCollisionSpiFormatted()
Gets a formatted instance of configured collision SPI implementations.- Specified by:
getCollisionSpiFormattedin interfaceIgniteMXBean- Returns:
- Grid collision SPI implementations.
-
getFailoverSpiFormatted
public String getFailoverSpiFormatted()
Gets a formatted instance of fully configured failover SPI implementations.- Specified by:
getFailoverSpiFormattedin interfaceIgniteMXBean- Returns:
- Grid failover SPI implementations.
-
getLoadBalancingSpiFormatted
public String getLoadBalancingSpiFormatted()
Gets a formatted instance of fully configured load balancing SPI implementations.- Specified by:
getLoadBalancingSpiFormattedin interfaceIgniteMXBean- Returns:
- Grid load balancing SPI implementations.
-
getOsInformation
public String getOsInformation()
Gets OS information.- Specified by:
getOsInformationin interfaceIgniteMXBean- Returns:
- OS information.
-
getJdkInformation
public String getJdkInformation()
Gets JDK information.- Specified by:
getJdkInformationin interfaceIgniteMXBean- Returns:
- JDK information.
-
getOsUser
public String getOsUser()
Gets OS user.- Specified by:
getOsUserin interfaceIgniteMXBean- Returns:
- OS user name.
-
printLastErrors
public void printLastErrors()
Prints errors.- Specified by:
printLastErrorsin interfaceIgniteMXBean
-
getVmName
public String getVmName()
Gets VM name.- Specified by:
getVmNamein interfaceIgniteMXBean- Returns:
- VM name.
-
getInstanceName
public String getInstanceName()
Gets optional kernal instance name. It can benull.- Specified by:
getInstanceNamein interfaceIgniteMXBean- Returns:
- Optional kernal instance name.
-
getExecutorServiceFormatted
public String getExecutorServiceFormatted()
Gets a formatted instance of fully configured thread pool that is used in grid.- Specified by:
getExecutorServiceFormattedin interfaceIgniteMXBean- Returns:
- Thread pool implementation that is used in grid.
-
getIgniteHome
public String getIgniteHome()
Gets Ignite installation home folder.- Specified by:
getIgniteHomein interfaceIgniteMXBean- Returns:
- Ignite installation home.
-
getGridLoggerFormatted
public String getGridLoggerFormatted()
Gets a formatted instance of logger that is in grid.- Specified by:
getGridLoggerFormattedin interfaceIgniteMXBean- Returns:
- Logger that is used in grid.
-
getMBeanServerFormatted
public String getMBeanServerFormatted()
Gets a formatted instance of MBean server instance.- Specified by:
getMBeanServerFormattedin interfaceIgniteMXBean- Returns:
- MBean server instance.
-
getLocalNodeId
public UUID getLocalNodeId()
Unique identifier for this node within grid.- Specified by:
getLocalNodeIdin interfaceIgniteMXBean- Returns:
- Unique identifier for this node within grid.
-
getUserAttributesFormatted
public List<String> getUserAttributesFormatted()
Gets a list of formatted user-defined attributes added to this node.Note that grid will add all System properties and environment properties to grid node attributes also. SPIs may also add node attributes that are used for SPI implementation.
- Specified by:
getUserAttributesFormattedin interfaceIgniteMXBean- Returns:
- User defined attributes for this node.
-
isPeerClassLoadingEnabled
public boolean isPeerClassLoadingEnabled()
Returnstrueif peer class loading is enabled,falseotherwise. Default value istrue.When peer class loading is enabled and task is not deployed on local node, local node will try to load classes from the node that initiated task execution. This way, a task can be physically deployed only on one node and then internally penetrate to all other nodes.
- Specified by:
isPeerClassLoadingEnabledin interfaceIgniteMXBean- Returns:
trueif peer class loading is enabled,falseotherwise.
-
getLifecycleBeansFormatted
public List<String> getLifecycleBeansFormatted()
GetstoString()representation of of lifecycle beans configured with Ignite.- Specified by:
getLifecycleBeansFormattedin interfaceIgniteMXBean- Returns:
toString()representation of all lifecycle beans configured with Ignite.
-
clusterState
public String clusterState()
Checks cluster state.- Specified by:
clusterStatein interfaceIgniteMXBean- Returns:
- String representation of current cluster state.
See
ClusterState.
-
lastClusterStateChangeTime
public long lastClusterStateChangeTime()
Gets last cluster state change operation.- Specified by:
lastClusterStateChangeTimein interfaceIgniteMXBean- Returns:
- Unix time of last cluster state change operation.
-
removeCheckpoint
public boolean removeCheckpoint(String key)
This method allows manually remove the checkpoint with givenkey.- Specified by:
removeCheckpointin interfaceIgniteMXBean- Parameters:
key- Checkpoint key.- Returns:
trueif specified checkpoint was indeed removed,falseotherwise.
-
pingNode
public boolean pingNode(String nodeId)
Pings node with given node ID to see whether it is alive.- Specified by:
pingNodein interfaceIgniteMXBean- Parameters:
nodeId- String presentation of node ID. SeeUUID.fromString(String)for details on string formatting.- Returns:
- Whether or not node is alive.
-
undeployTaskFromGrid
public void undeployTaskFromGrid(String taskName) throws JMException
Makes the best attempt to undeploy a task from the whole grid. Note that this method returns immediately and does not wait until the task will actually be undeployed on every node.Note that Ignite maintains internal versions for grid tasks in case of redeployment. This method will attempt to undeploy all versions on the grid task with given name.
- Specified by:
undeployTaskFromGridin interfaceIgniteMXBean- Parameters:
taskName- Name of the task to undeploy. If task class hasComputeTaskNameannotation, then task was deployed under a name specified within annotation. Otherwise, full class name should be used as task's name.- Throws:
JMException- Thrown if undeploy failed.
-
executeTask
public String executeTask(String taskName, String arg) throws JMException
A shortcut method that executes given task assuming singlejava.lang.Stringargument andjava.lang.Stringreturn type.- Specified by:
executeTaskin interfaceIgniteMXBean- Parameters:
taskName- Name of the task to execute.arg- Single task execution argument (can benull).- Returns:
- Task return value (assumed of
java.lang.Stringtype). - Throws:
JMException- Thrown in case when execution failed.
-
pingNodeByAddress
public boolean pingNodeByAddress(String host) throws JMException
Pings node with given host name to see if it is alive.- Specified by:
pingNodeByAddressin interfaceIgniteMXBean- Parameters:
host- Host name or IP address of the node to ping.- Returns:
- Whether or not node is alive.
- Throws:
JMException- When ping failed.
-
dumpDebugInfo
public void dumpDebugInfo()
Dumps debug information for the current node.- Specified by:
dumpDebugInfoin interfaceIgniteMXBean
-
runIoTest
public void runIoTest(long warmup, long duration, int threads, long maxLatency, int rangesCnt, int payLoadSize, boolean procFromNioThread)Runs IO latency test against all remote server nodes in cluster.- Specified by:
runIoTestin interfaceIgniteMXBean- Parameters:
warmup- Warmup duration in milliseconds.duration- Test duration in milliseconds.threads- Thread count.maxLatency- Max latency in nanoseconds.rangesCnt- Ranges count in resulting histogram.payLoadSize- Payload size in bytes.procFromNioThread-Trueto process requests in NIO threads.
-
clearNodeLocalMap
public void clearNodeLocalMap()
Clears node local map.- Specified by:
clearNodeLocalMapin interfaceIgniteMXBean
-
clusterState
public void clusterState(String state) throws JMException
Changes current cluster state.NOTE: Deactivation clears in-memory caches (without persistence) including the system caches.
- Specified by:
clusterStatein interfaceIgniteMXBean- Parameters:
state- String representation of new cluster state.- Throws:
JMException- if deactivation is forbidden or stopped.
-
clusterState
public void clusterState(String state, boolean forceDeactivation) throws JMException
Changes current cluster state.NOTE: Deactivation clears in-memory caches (without persistence) including the system caches.
- Specified by:
clusterStatein interfaceIgniteMXBean- Parameters:
state- String representation of new cluster state.forceDeactivation- Iftrue, cluster deactivation will be forced.- Throws:
JMException- if deactivation is forbidden or stopped.
-
isRebalanceEnabled
public boolean isRebalanceEnabled()
Gets rebalance enabled flag.- Specified by:
isRebalanceEnabledin interfaceIgniteMXBean- Returns:
- Rebalance enabled flag.
-
rebalanceEnabled
public void rebalanceEnabled(boolean rebalanceEnabled)
Enable or disable cache partition rebalance per node.- Specified by:
rebalanceEnabledin interfaceIgniteMXBean- Parameters:
rebalanceEnabled- Iftruethen set rebalance to enabled state.
-
-