Package org.apache.ignite.internal

## Class IgniteMXBeanImpl

- java.lang.Object
- - org.apache.ignite.internal.IgniteMXBeanImpl

All Implemented Interfaces:
  `IgniteMXBean`

    public class IgniteMXBeanImpl
    extends Object
    implements IgniteMXBean

Implementation of `IgniteMXBean`.

### 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
`IgniteMXBeanImpl​(IgniteKernal kernal)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `active()` Checks if Ignite grid is active.
`void` `active​(boolean active)` Changes Ignite grid state to active or inactive.
`void` `clearNodeLocalMap()` Clears node local map.
`String` `clusterState()` Checks cluster state.
`void` `clusterState​(String state)` Changes current cluster state.
`void` `clusterState​(String state, boolean forceDeactivation)` Changes current cluster state.
`void` `dumpDebugInfo()` Dumps debug information for the current node.
`String` `executeTask​(String taskName, String arg)` A shortcut method that executes given task assuming single `java.lang.String` argument and `java.lang.String` return type.
`String` `getCheckpointSpiFormatted()` Gets a formatted instance of configured checkpoint SPI implementation.
`String` `getCollisionSpiFormatted()` Gets a formatted instance of configured collision SPI implementations.
`String` `getCommunicationSpiFormatted()` Gets a formatted instance of fully configured SPI communication implementation.
`String` `getCopyright()` Gets copyright statement for Ignite product.
`String` `getCurrentCoordinatorFormatted()` Gets a formatted properties of current coordinator.
`String` `getDeploymentSpiFormatted()` Gets a formatted instance of fully configured deployment SPI implementation.
`String` `getDiscoverySpiFormatted()` Gets a formatted instance of configured discovery SPI implementation.
`String` `getEventStorageSpiFormatted()` Gets a formatted instance of fully configured event SPI implementation.
`String` `getExecutorServiceFormatted()` Gets a formatted instance of fully configured thread pool that is used in grid.
`String` `getFailoverSpiFormatted()` Gets a formatted instance of fully configured failover SPI implementations.
`String` `getFullVersion()` Gets string presentation of the version.
`String` `getGridLoggerFormatted()` Gets a formatted instance of logger that is in grid.
`String` `getIgniteHome()` Gets Ignite installation home folder.
`String` `getInstanceName()` Gets optional kernal instance name.
`String` `getJdkInformation()` Gets JDK information.
`List<String>` `getLifecycleBeansFormatted()` Gets `toString()` representation of of lifecycle beans configured with Ignite.
`String` `getLoadBalancingSpiFormatted()` Gets a formatted instance of fully configured load balancing SPI implementations.
`UUID` `getLocalNodeId()` Unique identifier for this node within grid.
`Map<Long,​Long>` `getLongJVMPauseLastEvents()` Gets long JVM pause last events.
`long` `getLongJVMPausesCount()` Gets long JVM pauses count.
`long` `getLongJVMPausesTotalDuration()` Gets long JVM pauses total duration.
`String` `getMBeanServerFormatted()` Gets a formatted instance of MBean server instance.
`String` `getOsInformation()` Gets OS information.
`String` `getOsUser()` Gets OS user.
`long` `getStartTimestamp()` Get start timestamp of the kernal.
`String` `getStartTimestampFormatted()` Gets string presentation of the kernal start timestamp.
`long` `getUpTime()` Gets up-time of the kernal.
`String` `getUpTimeFormatted()` Gets string presentation of up-time for the kernal.
`List<String>` `getUserAttributesFormatted()` Gets a list of formatted user-defined attributes added to this node.
`String` `getVmName()` Gets VM name.
`boolean` `isNodeInBaseline()` Gets a flag whether local node is in baseline.
`boolean` `isPeerClassLoadingEnabled()` Returns `true` if peer class loading is enabled, `false` otherwise.
`boolean` `isRebalanceEnabled()` Gets rebalance enabled flag.
`long` `lastClusterStateChangeTime()` Gets last cluster state change operation.
`boolean` `pingNode​(String nodeId)` Pings node with given node ID to see whether it is alive.
`boolean` `pingNodeByAddress​(String host)` Pings node with given host name to see if it is alive.
`void` `printLastErrors()` Prints errors.
`void` `rebalanceEnabled​(boolean rebalanceEnabled)` Enable or disable cache partition rebalance per node.
`boolean` `removeCheckpoint​(String key)` This method allows manually remove the checkpoint with given `key`.
`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.
`void` `undeployTaskFromGrid​(String taskName)` Makes the best attempt to undeploy a task from the whole grid.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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 return `False`.

Specified by:
  `active` in interface `IgniteMXBean`
Returns:
  `True` if grid is active. `False` If grid is not active.

#### active

    public void active​(boolean active)
                throws JMException

Changes Ignite grid state to active or inactive.

NOTE: Deactivation clears in-memory caches (without persistence) including the system caches.

Specified by:
  `active` in interface `IgniteMXBean`
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:
  `getCopyright` in interface `IgniteMXBean`
Returns:
  Copyright statement for Ignite product.

#### getStartTimestamp

    public long getStartTimestamp()

Get start timestamp of the kernal.

Specified by:
  `getStartTimestamp` in interface `IgniteMXBean`
Returns:
  Start timestamp of the kernal.

#### getStartTimestampFormatted

    public String getStartTimestampFormatted()

Gets string presentation of the kernal start timestamp.

Specified by:
  `getStartTimestampFormatted` in interface `IgniteMXBean`
Returns:
  String presentation of the kernal start timestamp.

#### getUpTime

    public long getUpTime()

Gets up-time of the kernal.

Specified by:
  `getUpTime` in interface `IgniteMXBean`
Returns:
  Up-time of the kernal.

#### getLongJVMPausesCount

    public long getLongJVMPausesCount()

Gets long JVM pauses count.

Specified by:
  `getLongJVMPausesCount` in interface `IgniteMXBean`
Returns:
  Long JVM pauses count.

#### getLongJVMPausesTotalDuration

    public long getLongJVMPausesTotalDuration()

Gets long JVM pauses total duration.

Specified by:
  `getLongJVMPausesTotalDuration` in interface `IgniteMXBean`
Returns:
  Long JVM pauses total duration.

#### getLongJVMPauseLastEvents

    public Map<Long,​Long> getLongJVMPauseLastEvents()

Gets long JVM pause last events.

Specified by:
  `getLongJVMPauseLastEvents` in interface `IgniteMXBean`
Returns:
  Long JVM pause last events.

#### getUpTimeFormatted

    public String getUpTimeFormatted()

Gets string presentation of up-time for the kernal.

Specified by:
  `getUpTimeFormatted` in interface `IgniteMXBean`
Returns:
  String presentation of up-time for the kernal.

#### getFullVersion

    public String getFullVersion()

Gets string presentation of the version.

Specified by:
  `getFullVersion` in interface `IgniteMXBean`
Returns:
  String presentation of the version.

#### getCheckpointSpiFormatted

    public String getCheckpointSpiFormatted()

Gets a formatted instance of configured checkpoint SPI implementation.

Specified by:
  `getCheckpointSpiFormatted` in interface `IgniteMXBean`
Returns:
  Grid checkpoint SPI implementation.

#### getCurrentCoordinatorFormatted

    public String getCurrentCoordinatorFormatted()

Gets a formatted properties of current coordinator.

Specified by:
  `getCurrentCoordinatorFormatted` in interface `IgniteMXBean`
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:
  `isNodeInBaseline` in interface `IgniteMXBean`
Returns:
  Return a baseline flag.

#### getCommunicationSpiFormatted

    public String getCommunicationSpiFormatted()

Gets a formatted instance of fully configured SPI communication implementation.

Specified by:
  `getCommunicationSpiFormatted` in interface `IgniteMXBean`
Returns:
  Grid communication SPI implementation.

#### getDeploymentSpiFormatted

    public String getDeploymentSpiFormatted()

Gets a formatted instance of fully configured deployment SPI implementation.

Specified by:
  `getDeploymentSpiFormatted` in interface `IgniteMXBean`
Returns:
  Grid deployment SPI implementation.

#### getDiscoverySpiFormatted

    public String getDiscoverySpiFormatted()

Gets a formatted instance of configured discovery SPI implementation.

Specified by:
  `getDiscoverySpiFormatted` in interface `IgniteMXBean`
Returns:
  Grid discovery SPI implementation.

#### getEventStorageSpiFormatted

    public String getEventStorageSpiFormatted()

Gets a formatted instance of fully configured event SPI implementation.

Specified by:
  `getEventStorageSpiFormatted` in interface `IgniteMXBean`
Returns:
  Grid event SPI implementation.

#### getCollisionSpiFormatted

    public String getCollisionSpiFormatted()

Gets a formatted instance of configured collision SPI implementations.

Specified by:
  `getCollisionSpiFormatted` in interface `IgniteMXBean`
Returns:
  Grid collision SPI implementations.

#### getFailoverSpiFormatted

    public String getFailoverSpiFormatted()

Gets a formatted instance of fully configured failover SPI implementations.

Specified by:
  `getFailoverSpiFormatted` in interface `IgniteMXBean`
Returns:
  Grid failover SPI implementations.

#### getLoadBalancingSpiFormatted

    public String getLoadBalancingSpiFormatted()

Gets a formatted instance of fully configured load balancing SPI implementations.

Specified by:
  `getLoadBalancingSpiFormatted` in interface `IgniteMXBean`
Returns:
  Grid load balancing SPI implementations.

#### getOsInformation

    public String getOsInformation()

Gets OS information.

Specified by:
  `getOsInformation` in interface `IgniteMXBean`
Returns:
  OS information.

#### getJdkInformation

    public String getJdkInformation()

Gets JDK information.

Specified by:
  `getJdkInformation` in interface `IgniteMXBean`
Returns:
  JDK information.

#### getOsUser

    public String getOsUser()

Gets OS user.

Specified by:
  `getOsUser` in interface `IgniteMXBean`
Returns:
  OS user name.

#### printLastErrors

    public void printLastErrors()

Prints errors.

Specified by:
  `printLastErrors` in interface `IgniteMXBean`

#### getVmName

    public String getVmName()

Gets VM name.

Specified by:
  `getVmName` in interface `IgniteMXBean`
Returns:
  VM name.

#### getInstanceName

    public String getInstanceName()

Gets optional kernal instance name. It can be `null`.

Specified by:
  `getInstanceName` in interface `IgniteMXBean`
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:
  `getExecutorServiceFormatted` in interface `IgniteMXBean`
Returns:
  Thread pool implementation that is used in grid.

#### getIgniteHome

    public String getIgniteHome()

Gets Ignite installation home folder.

Specified by:
  `getIgniteHome` in interface `IgniteMXBean`
Returns:
  Ignite installation home.

#### getGridLoggerFormatted

    public String getGridLoggerFormatted()

Gets a formatted instance of logger that is in grid.

Specified by:
  `getGridLoggerFormatted` in interface `IgniteMXBean`
Returns:
  Logger that is used in grid.

#### getMBeanServerFormatted

    public String getMBeanServerFormatted()

Gets a formatted instance of MBean server instance.

Specified by:
  `getMBeanServerFormatted` in interface `IgniteMXBean`
Returns:
  MBean server instance.

#### getLocalNodeId

    public UUID getLocalNodeId()

Unique identifier for this node within grid.

Specified by:
  `getLocalNodeId` in interface `IgniteMXBean`
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:
  `getUserAttributesFormatted` in interface `IgniteMXBean`
Returns:
  User defined attributes for this node.

#### isPeerClassLoadingEnabled

    public boolean isPeerClassLoadingEnabled()

Returns `true` if peer class loading is enabled, `false` otherwise. Default value is `true`.

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:
  `isPeerClassLoadingEnabled` in interface `IgniteMXBean`
Returns:
  `true` if peer class loading is enabled, `false` otherwise.

#### getLifecycleBeansFormatted

    public List<String> getLifecycleBeansFormatted()

Gets `toString()` representation of of lifecycle beans configured with Ignite.

Specified by:
  `getLifecycleBeansFormatted` in interface `IgniteMXBean`
Returns:
  `toString()` representation of all lifecycle beans configured with Ignite.

#### clusterState

    public String clusterState()

Checks cluster state.

Specified by:
  `clusterState` in interface `IgniteMXBean`
Returns:
  String representation of current cluster state. See `ClusterState`.

#### lastClusterStateChangeTime

    public long lastClusterStateChangeTime()

Gets last cluster state change operation.

Specified by:
  `lastClusterStateChangeTime` in interface `IgniteMXBean`
Returns:
  Unix time of last cluster state change operation.

#### removeCheckpoint

    public boolean removeCheckpoint​(String key)

This method allows manually remove the checkpoint with given `key`.

Specified by:
  `removeCheckpoint` in interface `IgniteMXBean`
Parameters:
  `key` - Checkpoint key.
Returns:
  `true` if specified checkpoint was indeed removed, `false` otherwise.

#### pingNode

    public boolean pingNode​(String nodeId)

Pings node with given node ID to see whether it is alive.

Specified by:
  `pingNode` in interface `IgniteMXBean`
Parameters:
  `nodeId` - String presentation of node ID. See `UUID.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:
  `undeployTaskFromGrid` in interface `IgniteMXBean`
Parameters:
  `taskName` - Name of the task to undeploy. If task class has `ComputeTaskName` annotation, 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 single `java.lang.String` argument and `java.lang.String` return type.

Specified by:
  `executeTask` in interface `IgniteMXBean`
Parameters:
  `taskName` - Name of the task to execute.
  `arg` - Single task execution argument (can be `null`).
Returns:
  Task return value (assumed of `java.lang.String` type).
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:
  `pingNodeByAddress` in interface `IgniteMXBean`
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:
  `dumpDebugInfo` in interface `IgniteMXBean`

#### 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:
  `runIoTest` in interface `IgniteMXBean`
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` - `True` to process requests in NIO threads.

#### clearNodeLocalMap

    public void clearNodeLocalMap()

Clears node local map.

Specified by:
  `clearNodeLocalMap` in interface `IgniteMXBean`

#### 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:
  `clusterState` in interface `IgniteMXBean`
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:
  `clusterState` in interface `IgniteMXBean`
Parameters:
  `state` - String representation of new cluster state.
  `forceDeactivation` - If `true`, cluster deactivation will be forced.
Throws:
  `JMException` - if deactivation is forbidden or stopped.

#### isRebalanceEnabled

    public boolean isRebalanceEnabled()

Gets rebalance enabled flag.

Specified by:
  `isRebalanceEnabled` in interface `IgniteMXBean`
Returns:
  Rebalance enabled flag.

#### rebalanceEnabled

    public void rebalanceEnabled​(boolean rebalanceEnabled)

Enable or disable cache partition rebalance per node.

Specified by:
  `rebalanceEnabled` in interface `IgniteMXBean`
Parameters:
  `rebalanceEnabled` - If `true` then set rebalance to enabled state.