简体   繁体   English

Java的轻量级B树库?

[英]Lightweight B-tree library for Java?

Can anyone recommend a lightweight, fast, and hopefully stable B-tree (or similar) library for Java? 任何人都可以为Java推荐一个轻量级,快速且有希望稳定的B树(或类似)库吗?

Essentially I'm looking for an on-disk map; 基本上我正在寻找磁盘上的地图; something along the lines of BerkeleyDB JE, except I don't need transactions, am fine with read-only concurrency, and need it to be about 1/10th the size (BSD or Apache license would be nice, too). BerkeleyDB JE除了我不需要事务之外,对于只读并发很好,需要大约1/10大小(BSD或Apache许可证也很好)。

Needs to be pure-Java, so no Tokyo/Kyoto Cabinets. 需要纯Java,所以没有东京/京都机柜。

Implementing relevant Collections interfaces would be a plus (alternatively, templated interfaces for primitive types would be nice too). 实现相关的Collections接口将是一个加号(或者,原始类型的模板化接口也会很好)。

JDBM looks pretty good, but it seems to have been abandoned in 2005 (at 1.0, no less). JDBM看起来相当不错,但它似乎在2005年被放弃了(1.0,不低于)。

There's also DiskBackedMap , but they released an alpha a year ago, and nothing since. 还有DiskBackedMap ,但他们一年前发布了一个alpha版本,此后一无所获。

Anything else out there? 还有别的吗? Or any experiences with the above-mentioned ones? 或者上述任何经历?

Things I'm NOT looking for: 想要的东西:

  • In-process relational DBs (so no H2, Derby, SQLite, etc) 进程间关系数据库(所以没有H2,Derby,SQLite等)
  • Distributed key-value stores (no Redis, Memcachedb, Cassandra, Voldemort, Dumbledore, or whatever) 分布式键值存储(没有Redis,Memcachedb,Cassandra,Voldemort,Dumbledore等)

There is a fork of JDBM that might be of interest to you. 有一个JDBM的分支可能是您感兴趣的。

See http://www.kotek.net/blog/jdbm_2.1_and_beyond 请参阅http://www.kotek.net/blog/jdbm_2.1_and_beyond

GitHub: https://github.com/jankotek/JDBM3 GitHub: https//github.com/jankotek/JDBM3

Also, 也,

Email: jdbm@googlegroups.com 电子邮件:jdbm@googlegroups.com

Web: http://groups.google.com/group/jdbm 网址: http//groups.google.com/group/jdbm

RSS: http://groups.google.com/group/jdbm/feed/rss_v2_0_msgs.xml RSS: http//groups.google.com/group/jdbm/feed/rss_v2_0_msgs.xml

EDIT: 编辑:

JDBM4 was renamed to MapDB JDBM4已重命名为MapDB

Modern projects worth mentioning: 值得一提的现代项目:

  • LMDBJava allows to use LMDB from Java. LMDBJava允许从Java使用LMDB LMDB is not exactly B-tree, but it's a tree-like structure, ie always sorted. LMDB不完全是B树,但它是一个树状结构,即总是排序。
  • If you don't the sorted property, Chronicle Map is the most efficient random-access unordered persisted off-heap key-value store for Java now 如果您没有排序属性, Chronicle Map现在是Java中最有效的随机访问无序持久性堆外键值存储

https://github.com/jankotek/MapDB might do part of what you want. https://github.com/jankotek/MapDB可能会做你想要的一部分。 That library provides several persistent list, set and map implementations, including a b-tree map. 该库提供了几个持久的列表,集合和映射实现,包括b树映射。

A late contribution, I know. 我知道,这是一个迟来的贡献。 I myself don't need the excitement of choosing a Java DBM library. 我自己不需要选择Java DBM库的兴奋。 I need one merely to minimize memory usage in certain cases. 在某些情况下,我只需要最小化内存使用量。 (For actual persistence I'd use JPA.) There currently are 4 different JDBM projects in various states. (对于实际的持久性,我使用JPA。)目前在各种状态下有4个不同的JDBM项目。

Luckily the Apache directory server comes with a JDBM library and my exciting times seem to be gone forever! 幸运的是,Apache目录服务器附带了一个JDBM库,我的激动人心的时刻似乎永远消失了! The library can be used separately and it seems to be based on one of the four implementations. 该库可以单独使用,它似乎基于四种实现之一。 It's also on MVNRepository . 它也在MVNRepository上

<dependency>
    <groupId>org.apache.directory.server</groupId>
    <artifactId>apacheds-jdbm</artifactId>
    <version>2.0.0-M5</version>
</dependency>

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

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