基于磁盘的HashMap [英] Disk based HashMap
问题描述
Java是否有(或者是否有可用的库)允许我拥有基于磁盘的HashMap?它不需要是原子或任何东西,但它将通过多个线程访问,如果两个同时访问同一个元素,则不应该崩溃。
Does Java have (or is there a library available) that allows me to have a disk based HashMap? It doesn't need to be atomic or anything, but it will be accessed via multiple threads and shouldn't crash if two are accessing the same element at the same time.
任何人都知道什么?
推荐答案
属性文件或 Berkeley DB 可能正是您所需要的。 java.util.Properties
本身实现 java.util.Map
并提供方法加载
来自和将
存储到文件中。 Berkeley DB通常被推荐为轻量级键值对数据存储区。
Either properties files or Berkeley DB might be what you're looking for. The java.util.Properties
itself implements java.util.Map
and provides methods to load
from and store
to a file. The Berkeley DB is often been recommended as a lightweight key-value pair datastore.
这篇关于基于磁盘的HashMap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!