use of org.apache.ignite.mxbean.FailureHandlingMxBean in project ignite by apache.
the class IgniteMBeansManager method registerMBeansAfterNodeStarted.
/**
* Registers kernal MBeans (for kernal, metrics, thread pools) after node start.
*
* @throws IgniteCheckedException if fails to register any of the MBeans.
*/
public void registerMBeansAfterNodeStarted() throws IgniteCheckedException {
if (U.IGNITE_MBEANS_DISABLED)
return;
// Kernal
IgniteMXBean kernalMXBean = new IgniteMXBeanImpl(kernal);
registerMBean("Kernal", IgniteKernal.class.getSimpleName(), kernalMXBean, IgniteMXBean.class);
// Metrics
ClusterMetricsMXBean locMetricsBean = new ClusterLocalNodeMetricsMXBeanImpl(ctx.discovery());
registerMBean("Kernal", locMetricsBean.getClass().getSimpleName(), locMetricsBean, ClusterMetricsMXBean.class);
ClusterMetricsMXBean metricsBean = new ClusterMetricsMXBeanImpl(kernal.cluster(), ctx);
registerMBean("Kernal", metricsBean.getClass().getSimpleName(), metricsBean, ClusterMetricsMXBean.class);
// Transaction metrics
TransactionMetricsMxBean txMetricsMXBean = new TransactionMetricsMxBeanImpl(ctx.cache().transactions().metrics());
registerMBean("TransactionMetrics", txMetricsMXBean.getClass().getSimpleName(), txMetricsMXBean, TransactionMetricsMxBean.class);
// Transactions
TransactionsMXBean txMXBean = new TransactionsMXBeanImpl(ctx);
registerMBean("Transactions", txMXBean.getClass().getSimpleName(), txMXBean, TransactionsMXBean.class);
// Queries management
QueryMXBean qryMXBean = new QueryMXBeanImpl(ctx);
registerMBean("Query", qryMXBean.getClass().getSimpleName(), qryMXBean, QueryMXBean.class);
// Compute task management
ComputeMXBean computeMXBean = new ComputeMXBeanImpl(ctx);
registerMBean("Compute", computeMXBean.getClass().getSimpleName(), computeMXBean, ComputeMXBean.class);
// Service management
ServiceMXBean serviceMXBean = new ServiceMXBeanImpl(ctx);
registerMBean("Service", serviceMXBean.getClass().getSimpleName(), serviceMXBean, ServiceMXBean.class);
// Data storage
DataStorageMXBean dataStorageMXBean = new DataStorageMXBeanImpl(ctx);
registerMBean("DataStorage", dataStorageMXBean.getClass().getSimpleName(), dataStorageMXBean, DataStorageMXBean.class);
// Baseline configuration
BaselineAutoAdjustMXBean baselineAutoAdjustMXBean = new BaselineAutoAdjustMXBeanImpl(ctx);
registerMBean("Baseline", baselineAutoAdjustMXBean.getClass().getSimpleName(), baselineAutoAdjustMXBean, BaselineAutoAdjustMXBean.class);
// Encryption
EncryptionMXBean encryptionMXBean = new EncryptionMXBeanImpl(ctx);
registerMBean("Encryption", encryptionMXBean.getClass().getSimpleName(), encryptionMXBean, EncryptionMXBean.class);
// Snapshot.
SnapshotMXBean snpMXBean = new SnapshotMXBeanImpl(ctx);
registerMBean("Snapshot", snpMXBean.getClass().getSimpleName(), snpMXBean, SnapshotMXBean.class);
// Defragmentation.
DefragmentationMXBean defragMXBean = new DefragmentationMXBeanImpl(ctx);
registerMBean("Defragmentation", defragMXBean.getClass().getSimpleName(), defragMXBean, DefragmentationMXBean.class);
// Metrics configuration
MetricsMxBean metricsMxBean = new MetricsMxBeanImpl(ctx.metric(), log);
registerMBean("Metrics", metricsMxBean.getClass().getSimpleName(), metricsMxBean, MetricsMxBean.class);
ctx.pools().registerMxBeans(this);
if (U.IGNITE_TEST_FEATURES_ENABLED) {
WorkersControlMXBean workerCtrlMXBean = new WorkersControlMXBeanImpl(ctx.workersRegistry());
registerMBean("Kernal", workerCtrlMXBean.getClass().getSimpleName(), workerCtrlMXBean, WorkersControlMXBean.class);
}
FailureHandlingMxBean blockOpCtrlMXBean = new FailureHandlingMxBeanImpl(ctx.workersRegistry(), ctx.cache().context().database());
registerMBean("Kernal", blockOpCtrlMXBean.getClass().getSimpleName(), blockOpCtrlMXBean, FailureHandlingMxBean.class);
if (ctx.query().moduleEnabled())
ctx.query().getIndexing().registerMxBeans(this);
PerformanceStatisticsMBeanImpl performanceStatMbean = new PerformanceStatisticsMBeanImpl(ctx);
registerMBean("PerformanceStatistics", performanceStatMbean.getClass().getSimpleName(), performanceStatMbean, PerformanceStatisticsMBean.class);
}
use of org.apache.ignite.mxbean.FailureHandlingMxBean in project ignite by apache.
the class FailureHandlingConfigurationTest method testPartialCfgParamsPropagation.
/**
* @throws Exception If failed.
*/
@Test
public void testPartialCfgParamsPropagation() throws Exception {
sysWorkerBlockedTimeout = 30_000L;
checkpointReadLockTimeout = null;
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
WorkersRegistry reg = ignite.context().workersRegistry();
IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
FailureHandlingMxBean mBean = getMBean();
assertEquals(sysWorkerBlockedTimeout.longValue(), reg.getSystemWorkerBlockedTimeout());
assertEquals(sysWorkerBlockedTimeout.longValue(), dbMgr.checkpointReadLockTimeout());
assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getSystemWorkerBlockedTimeout());
assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getCheckpointReadLockTimeout());
}
use of org.apache.ignite.mxbean.FailureHandlingMxBean in project ignite by apache.
the class FailureHandlingConfigurationTest method testCfgParamsPropagation.
/**
* @throws Exception If failed.
*/
@Test
public void testCfgParamsPropagation() throws Exception {
sysWorkerBlockedTimeout = 30_000L;
checkpointReadLockTimeout = 20_000L;
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
WorkersRegistry reg = ignite.context().workersRegistry();
IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
FailureHandlingMxBean mBean = getMBean();
assertEquals(sysWorkerBlockedTimeout.longValue(), reg.getSystemWorkerBlockedTimeout());
assertEquals(checkpointReadLockTimeout.longValue(), dbMgr.checkpointReadLockTimeout());
assertEquals(sysWorkerBlockedTimeout.longValue(), mBean.getSystemWorkerBlockedTimeout());
assertEquals(checkpointReadLockTimeout.longValue(), mBean.getCheckpointReadLockTimeout());
}
use of org.apache.ignite.mxbean.FailureHandlingMxBean in project ignite by apache.
the class FailureHandlingConfigurationTest method testMBeanParamsChanging.
/**
* @throws Exception If failed.
*/
@Test
public void testMBeanParamsChanging() throws Exception {
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
FailureHandlingMxBean mBean = getMBean();
mBean.setSystemWorkerBlockedTimeout(80_000L);
assertEquals(80_000L, ignite.context().workersRegistry().getSystemWorkerBlockedTimeout());
mBean.setCheckpointReadLockTimeout(90_000L);
assertEquals(90_000L, ignite.context().cache().context().database().checkpointReadLockTimeout());
assertTrue(mBean.getLivenessCheckEnabled());
mBean.setLivenessCheckEnabled(false);
assertFalse(ignite.context().workersRegistry().livenessCheckEnabled());
ignite.context().workersRegistry().livenessCheckEnabled(true);
assertTrue(mBean.getLivenessCheckEnabled());
}
use of org.apache.ignite.mxbean.FailureHandlingMxBean in project ignite by apache.
the class FailureHandlingConfigurationTest method testOverridingBySysProps.
/**
* @throws Exception If failed.
*/
@Test
@WithSystemProperty(key = IGNITE_SYSTEM_WORKER_BLOCKED_TIMEOUT, value = "80000")
@WithSystemProperty(key = IGNITE_CHECKPOINT_READ_LOCK_TIMEOUT, value = "90000")
public void testOverridingBySysProps() throws Exception {
sysWorkerBlockedTimeout = 1L;
checkpointReadLockTimeout = 2L;
IgniteEx ignite = startGrid(0);
ignite.cluster().active(true);
WorkersRegistry reg = ignite.context().workersRegistry();
IgniteCacheDatabaseSharedManager dbMgr = ignite.context().cache().context().database();
FailureHandlingMxBean mBean = getMBean();
assertEquals(sysWorkerBlockedTimeout, ignite.configuration().getSystemWorkerBlockedTimeout());
assertEquals(checkpointReadLockTimeout, ignite.configuration().getDataStorageConfiguration().getCheckpointReadLockTimeout());
long workerPropVal = Long.getLong(IGNITE_SYSTEM_WORKER_BLOCKED_TIMEOUT);
long checkpointPropVal = Long.getLong(IGNITE_CHECKPOINT_READ_LOCK_TIMEOUT);
assertEquals(workerPropVal, reg.getSystemWorkerBlockedTimeout());
assertEquals(checkpointPropVal, dbMgr.checkpointReadLockTimeout());
assertEquals(workerPropVal, mBean.getSystemWorkerBlockedTimeout());
assertEquals(checkpointPropVal, mBean.getCheckpointReadLockTimeout());
}
Aggregations