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
GG-39034 [IGNITE-18546] Add cache clear command to control.sh #3139
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Mark Jackson <mark.jackson@gridgain.com>
Signed-off-by: Mark Jackson <mark.jackson@gridgain.com>
Signed-off-by: Mark Jackson <mark.jackson@gridgain.com>
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.ignite.internal.processors.cache; |
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.
It would be nice to move this class (ClearCachesTask
and ClearCachesTaskResult
as well) to the org.apache.ignite.internal.visor.cache
package.
Also, please add these classes to the classnames.properties
file https://github.com/gridgain/gridgain/blob/master/modules/core/src/main/resources/META-INF/classnames.properties
import org.apache.ignite.internal.visor.VisorDataTransferObject; | ||
|
||
/** Argument for {@link ClearCachesTask}. */ | ||
public class ClearCachesTaskArg extends VisorDataTransferObject { |
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.
Please use IgniteDataTransferObject
instead of VisorDataTransferObject
.
} | ||
|
||
/** */ | ||
@IgniteInstanceResource |
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.
You can annotate the field directly.
/** Local Ignite instance. */
@IgniteInstanceResource
private Ignite ignite;
Anyway, it's up to you.
if (ignCache == null) | ||
nonExistentCaches.add(cache); | ||
else { | ||
ignCache.clear(); |
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.
This operation may take a long time.
Perhaps, it makes sense to use https://www.gridgain.com/sdk/latest/javadoc/org/apache/ignite/compute/ComputeJobContinuation.html
@@ -1379,6 +1382,107 @@ public void testCacheDestroy() throws IgniteCheckedException { | |||
assertTrue("Caches must be destroyed: " + crd.cacheNames().toString(), crd.cacheNames().isEmpty()); | |||
} | |||
|
|||
/** */ | |||
@Test | |||
public void testCacheClear() { |
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.
Please check that GridCommandHandlerPasscodeAuthenticatorClusterByClassTest passed too.
It requires updating GridEntSecurityProcessor
No description provided.