-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
Outdated
Show resolved
Hide resolved
LOAD_BALANCING_SPI_FORMATTED_DESC); | ||
} | ||
|
||
/** | ||
* @return String representation of version of current Ignite instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be inlined
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create mbean var, please
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this changed?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use kernal.active()
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
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
Behavior changes:
IgniteMXBean.active(false) and IgniteMXBean.state("inactive") now throw an exception if deactivation would clear in-memory data.
Major code changes:
Additionally, as discussed, improved comments
/** If {@code true}, cluster deactivation will be forced. */
to more complete descriptions.