简体   繁体   English

是否有用于硬盘存储而非存储器的多索引容器?

[英]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的容器编写所需的内容。

How about SQLite ? SQLite怎么样? It can use disk as backing store, and supports multiple indexes on data, as Boost Multi Index does. 它可以将磁盘用作后备存储,并且像Boost Multi Index一样支持数据的多个索引。

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

相关问题 这个例子不应该改变存储地址而不是改变那个存储地址的值吗? - should this example not alter the memory address rather than the value at that memory address? 将对象指针保存在STL容器中而不是对象本身会更好吗? - Is it better to save object pointer in STL container rather than object itself? 为什么我应该使用简单数组而不是容器类? - Why should I use simple arrays rather than container classes? STL算法将整个容器而不是.begin(),end()作为arg? - STL algorithms taking the whole container rather than .begin(), end() as arg? 使用 B+ 树索引实现内存存储 - Implementing an in memory storage with B+ tree index 指向数组元素的指针,该元素显示内存地址而不是元素的值 - Pointer to Elements of an Array printing the memory address rather than the value of the element 代码是打印对象的内存位置,而不是对象本身 - Code is printing memory location of object rather than the object itself 提高multi_index_container和内存碎片 - boost multi_index_container and memory fragmentation 将下载的torrent保存在内存中而不是文件libtorrent - Keeping the downloaded torrent in memory rather than file libtorrent 从磁盘而不是内存加密和解密文件? - Encrypt and decrypt a file from disk rather than memory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM