简体   繁体   中英

Apache Ignite programmatically destroy persistent cache

I am developing a Java application that uses Apache Ignite caches with persistent storage.

Since I am still in development, I occasionally need to change some of the cached classes and, when I do this, the Ignite cluster fails to start. At these times, I need to go into my file system and delete the persistent cache.

Is there any way to do this automatically in my program? Ideally, I would like to:

  • Try to start the Ignite cluster
  • If there is some kind of problem
    • destroy the persistent cache
    • try to start the Ignite cluster again

I'd like to do this via Ignite APIs (eg not just using Java to delete the files).

How can I do this?

You will have to remove marshaller/ , db/ and wal/ directories via Java file APIs, since Ignite does not have corresponding calls.

In fact it does, but only in tests running code. So you will have to implement it yourself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM