Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-12779 : Split implementations of Ignite and IgniteMXBean, make behavior of their active(boolean) different #7531

Merged
merged 17 commits into from
Sep 16, 2021

Conversation

Vladsz83
Copy link
Contributor

@Vladsz83 Vladsz83 commented Mar 13, 2020

Behavior changes:

IgniteMXBean.active(false) and IgniteMXBean.state("inactive") now throw an exception if deactivation would clear in-memory data.

Major code changes:

  • Implementation of IgniteMXBean extracted from IgniteKernal and put in IgniteMXBeanImpl.
  • Added IgniteMXBean.state(String, boolean)
  • Deprecated IgniteMXBean.active(boolean) and IgniteMXBean.state(ClusterState)

Additionally, as discussed, improved comments

/** If {@code true}, cluster deactivation will be forced. */

to more complete descriptions.

@Vladsz83 Vladsz83 changed the title IGNITE-12779 : Split Ignite and IgniteMXBean, make different behavior of the active(boolean) IGNITE-12779 : Split implementations of Ignite and IgniteMXBean, make different behavior of their active(boolean) Mar 13, 2020
@Vladsz83 Vladsz83 changed the title IGNITE-12779 : Split implementations of Ignite and IgniteMXBean, make different behavior of their active(boolean) IGNITE-12779 : Split implementations of Ignite and IgniteMXBean, make behavior of their active(boolean) different Mar 13, 2020
LOAD_BALANCING_SPI_FORMATTED_DESC);
}

/**
* @return String representation of version of current Ignite instance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be inlined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -131,7 +132,7 @@ public void registerAllMBeans(
return;

// Kernal
registerMBean("Kernal", IgniteKernal.class.getSimpleName(), kernal, IgniteMXBean.class);
registerMBean("Kernal", IgniteKernal.class.getSimpleName(), new IgniteMXBeanImpl(kernal), IgniteMXBean.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create mbean var, please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -455,9 +455,6 @@

/**
* Changes Ignite grid state to active or inactive.
* <p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miss-puss. Fixed.


/** {@inheritDoc} */
@Override public void printLastErrors() {
kernal.context().exceptionRegistry().printErrors(log);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets create printLastErrors in the kerrnal like osUser methods. Log will not be needed.


/** {@inheritDoc} */
@Override public boolean isRebalanceEnabled() {
return kernal.context().cache().context().isRebalanceEnabled();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use isRebalanceEnabled from kernal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

kernal.context().gateway().readLock();

try {
return kernal.context().state().publicApiActiveState(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use kernal.active()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.


/** {@inheritDoc} */
@Override public void rebalanceEnabled(boolean rebalanceEnabled) {
kernal.context().cache().context().rebalanceEnabled(rebalanceEnabled);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets use kernal.rebalanceEnabled(rebalanceEnabled);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/managers/IgniteMBeansManager.java
#	modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClusterActivateDeactivateTest.java
#	modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/impl/HadoopJobTrackerSelfTest.java
@NSAmelchev NSAmelchev merged commit 097773c into apache:master Sep 16, 2021
@Vladsz83 Vladsz83 deleted the IGNITE-12779 branch October 4, 2021 11:20
xintrian pushed a commit to xintrian/ignite that referenced this pull request May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants