如何在 Apache Ignite 2.0 上存储堆外数据

How to store off heap data on Apache Ignite 2.0

CacheConfiguration<String, JSONObject> conf = new CacheConfiguration<String, JSONObject>();
conf.setName("ABC");
conf.setWriteThrough(true);
conf.setReadThrough(true);
conf.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
conf.setOffHeapMaxMemory(0);

这是我在 ignite 1.9 中的缓存配置,但是当我将 Apache Ignite 从 1.9 升级到 2.0 时,最后两行配置出现错误。

从 2.0 版本开始,Ignite 默认配置将条目存储在堆外,不再有像 setMemoryMode 这样的方法。

您可以阅读新的内存架构并找到新的配置参数here