简体   繁体   English

Apache Ignite以编程方式破坏持久性缓存

[英]Apache Ignite programmatically destroy persistent cache

I am developing a Java application that uses Apache Ignite caches with persistent storage. 我正在开发一个使用Apache Ignite缓存和持久性存储的Java应用程序。

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. 由于我仍在开发中,因此有时需要更改某些缓存的类,并且这样做时,Ignite群集无法启动。 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 尝试启动Ignite群集
  • If there is some kind of problem 如果有什么问题
    • destroy the persistent cache 销毁持久缓存
    • try to start the Ignite cluster again 尝试再次启动Ignite群集

I'd like to do this via Ignite APIs (eg not just using Java to delete the files). 我想通过Ignite API来执行此操作(例如,不仅仅使用Java删除文件)。

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. 您将必须通过Java文件API删除marshaller/db/wal/目录,因为Ignite没有相应的调用。

In fact it does, but only in tests running code. 实际上确实如此,但仅在运行代码的测试中有效。 So you will have to implement it yourself. 因此,您将必须自己实施。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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