绑定完请刷新页面
取消
刷新

分享好友

×
取消 复制
hazelcast mysql,使用Hazelcast在磁盘上保留数据
2022-05-23 10:58:40

I have installed HazelCast 2.5. I want to persist my records into disk. I learned that MapStore does this job. However i'm not sure how to implement MapStore.

Code I've written so far:

public class MyMaps implements MapStore {

public static Map mapCustomers = Hazelcast.getMap("customers");

public static void main(String[] args) {

{

mapCustomers.put(1, "Ram");

mapCustomers.put(2, "David");

mapCustomers.put(3, "Arun");

}

}

}

How do i put all these entries into disk.

Is it necessary to have a back-end like MySQL or PostgreSQL to use this class?

I believe the following function can be used:

public void delete(String arg0);

public void deleteAll(String arg0);

public void store(String arg0);

public void storeAll(String arg0);

I need a sample snippet of how to implement MapStore.

Please provide me with sample code.

解决方案

Hazelcast has two * of distributed objects in terms of their partitioning strategies:

Data structures where each partition stores a part of the instance, namely partitioned data structures.

Data structures where a single partition stores the whole instance, namely non-partitioned data structures.

Partitioned Hazelcast data structures persistence data to local file system is not supported,need a centralized system that is accessible from all hazelcast members,like mysql or mongodb.

You can get code from hazelcast-code-samples.

分享好友

分享这个小栈给你的朋友们,一起进步吧。

Hazelcast
创建时间:2022-04-18 14:01:59
Hazelcast
展开
订阅须知

• 所有用户可根据关注领域订阅专区或所有专区

• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询

• 专区发布评论属默认订阅所评论专区(除付费小栈外)

技术专家

查看更多
  • 飘絮絮絮丶
    专家
戳我,来吐槽~