[英]Is there a muti index container for the harddisk storage rather than memory?
I need a muti index container based on red-black trees (something like boost::multi_index::multi_index_container
) for the case of the harddisk storage. 对于硬盘存储,我需要一个基于红黑树的多索引容器(类似于
boost::multi_index::multi_index_container
)。 All data must be store on hard disk rather than in memory. 所有数据必须存储在硬盘上,而不是存储在内存中。
Is there an open source container such that described conditions hold? 是否有一个开放源容器,可以满足上述条件?
Note. 注意。 I use
C++
. 我使用
C++
。
如果您有内存中的解决方案,则可以使用内存映射文件和自定义分配器来实现持久存储。
I am afraid I don't know any. 恐怕我什么都不知道。
For hard-disk storage I can only recommend a look to STXXL , which proposes STL containers and algorithms adapted to data that can only fit on disk. 对于硬盘存储,我只能推荐一下STXXL ,它提出了STL容器和算法,适用于仅适合磁盘的数据。 They have implemented many things to allow for a smoother manipulation, essentially by caching in memory as much as possible and delaying disk access when possible.
他们实施了许多事情以实现更流畅的操作,实质上是通过尽可能多地在内存中进行缓存并在可能的情况下延迟磁盘访问。
Now that won't get you a multi index, but at least you'll have a STL :) 现在,您将不会获得多重索引,但至少您将拥有一个STL :)
Then, if you are determined, you can port multi-index to use the facilities provided by STXXL: they have decorrelated the IO access / memory caching from the containers themselves. 然后,如果确定,则可以移植多索引以使用STXXL提供的功能:它们已将容器本身的IO访问/内存缓存解相关。
Or you can simply write what you need based on their STL-compliant containers. 或者,您可以简单地根据其符合STL的容器编写所需的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.