Erlang LevelDB API

Erlang LevelDB API

Github stars Tracking Chart

eleveldb - LevelDB 数据存储的 Erlang 绑定

建设状态

这个存储库遵循2013年11月28日的Basho分支管理标准。这个标准可以在这里找到:https://github.com/basho/riak/wiki/Basho-repositor...

总的来说,"develop" 分支包含了最近审查过的工程工作,"master" 分支包含了最近发布的工作,即作为 Riak 版本的一部分发布。而 "master" 分支则包含了最近发布的工作,即作为Riak发布的一部分。

迭代记录

高级迭代器接口

leleveldb 的大多数客户端在对存储在 leveldb 中的一组记录进行迭代时应该使用的接口是 fold,因为这很符合 Erlang 的做事方式。

对于那些需要对记录迭代过程进行更多控制的人,你可以使用直接的迭代器动作。使用它们时要非常小心。

直接迭代器动作

seek/next/prev

  • seek:移动迭代器到一个新的位置。
  • next:向前移动一个位置并返回值,不做其他事情。向前移动一个位置并返回值,不做其他操作。
  • prev:向后移动一个位置并返回值,不做其他操作。

prefetc/prefetch_stop

  • prefetc:执行一个下一个动作,然后在Erlang处理当前下一个动作的同时,为后续的下一个动作启动一个并行调用。后续的预取可能会带着已经检索到的值立即返回。
  • prefetch_stop:停止一连串的预取调用。如果有一个并行的预取调用待定,取消它,因为我们即将移动指针。

警告:如果有并行的预取调用,则取消它,因为我们即将移动指针。

可以使用 prefetch/prefetch_stop 或 next/prev。 不要混合使用 prefetch 和 next/prev。 在使用任何其他操作(seek、next、prev)之前,你必须在一个或多个预取操作之后 prefetch_stop。


Main metrics

Overview
Name With Ownerbasho/eleveldb
Primary LanguageC++
Program languageMakefile (Language Count: 3)
PlatformLinux, Mac, Windows
License:
所有者活动
Created At2011-05-14 03:40:34
Pushed At2023-11-23 13:57:37
Last Commit At
Release Count99
Last Release Nameriak_kv-3.0.12 (Posted on )
First Release Name1.0 (Posted on 2011-09-06 20:05:13)
用户参与
Stargazers Count262
Watchers Count90
Fork Count179
Commits Count718
Has Issues Enabled
Issues Count69
Issue Open Count22
Pull Requests Count154
Pull Requests Open Count7
Pull Requests Close Count49
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

eleveldb - Erlang bindings to LevelDB datastore

Build Status

This repository follows the Basho standard for branch management
as of November 28, 2013. The standard is found here:

https://github.com/basho/riak/wiki/Basho-repository-management

In summary, the "develop" branch contains the most recently reviewed
engineering work. The "master" branch contains the most recently
released work, i.e. distributed as part of a Riak release.

Iterating Records

High-level Iterator Interface

The interface that most clients of eleveldb should use when iterating over a set of records stored in leveldb is fold, since this fits nicely with the Erlang way of doing things.

For those who need more control over the process of iterating over records, you can use direct iterator actions. Use them with great care.

Direct Iterator Actions

seek/next/prev

  • seek: Move iterator to a new position.

  • next: Move forward one position and return the value; do nothing else.

  • prev: Move backward one position and return the value; do nothing else.

prefetc/prefetch_stop

  • prefetch: Perform a next action and then start a parallel call for the subsequent next while Erlang processes the current next. The subsequent prefetch may return immediately with the value already retrieved.

  • prefetch_stop: Stop a sequence of prefetch calls. If there is a parallel prefetch pending, cancel it, since we are about to move the pointer.

Warning

Either use prefetch/prefetch_stop or next/prev. Do not intermix prefetch and next/prev. You must prefetch_stop after one or more prefetch operations before using any of the other operations (seek, next, prev).