简体   繁体   中英

Lucene RAMDirectory deprecated - how to keep Directory RAM-only anyway?

I'm currently using the class org.apache.lucene.store.RAMDirectory for a fast RAM-based index without the requirement of hard disk write permissions. RAM size & persistence is not a limiting factor. However, RAMDirectory is marked as deprecated and also seems to be problematic for large indexes according to its API .

So my question is, what is a RAM-only alternative for the deprecated RAMDirectory ?

Anything writing on hard disk is out of the question for me (read only) & also seems to be quite a bit slower on my own systems. I was thinking about using FSDDirectory with a RAMDisk but couldn't find a way to create said RAMDisk using java / the jar only (again requires changing the system).

ByteBuffersDirectory is the replacement for RAMDirectory .

The chart below makes it crystal clear why RAMDiretory was depreciated and then removed. BBDIR is ByteBuffersDirectory and RAMDIR is RAMDirectory .

在此处输入图片说明 Chart by Dawid Weiss. Source: LUCENE-8438 and shown under Apache 2.0 License. .

你也可以只创建一个ramdisk

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM