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

GG-39034 [IGNITE-18546] Add cache clear command to control.sh #3139

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kingnoskcaj
Copy link
Contributor

No description provided.

timoninmaxim and others added 4 commits April 8, 2024 22:27
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;
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

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();
Copy link
Contributor

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() {
Copy link
Contributor

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

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

3 participants