Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
GEN_ETS is an generic wrapper for Erlang Term Storage with a callback interface for a backend implementation.
Erlang

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
include
src
test/qc
.gitignore
.travis.yml
LICENSE
Makefile
README.md
THANKS
rebar
rebar.config
rebar.config.doc

README.md

GEN_ETS - GEN(eric) Erlang Term Storage

Copyright (c) 2011-2014 by Joseph Wayne Norton

Authors: Joseph Wayne Norton (norton@alum.mit.edu).

GEN_ETS is an generic wrapper for Erlang Term Storage with a callback interface for a backend implementation.

GEN_ETS is not intended to be an exact clone of ETS. The currently supported ETS APIs are:

  • all/0

  • delete/1

  • delete/2

  • delete_all_objects/1

  • first/1

  • foldl/3

  • foldr/3

  • info/1 only a subset of items

  • info/2 only a subset of items

  • insert/2

  • insert_new/2

  • last/1

  • lookup/2

  • lookup_element/3

  • match/1

  • match/2

  • match/3

  • match_delete/2

  • match_object/1

  • match_object/2

  • match_object/3

  • member/2

  • new/2

  • next/2

  • prev/2

  • select/1

  • select/2

  • select/3

  • select_count/2

  • select_delete/2

  • select_reverse/1

  • select_reverse/2

  • select_reverse/3

  • tab2list/1

In particular, GEN_ETS differs from ETS in the following ways:

  • The name of a table can be any Erlang term.

  • All APIs require a namespace. A namespace must be a unique, reserved atom. Due to limitiations of the current implementation of GEN_ETS, this reserved atom is used to register a local named process and to create a named ets table.

    Caution Choose your application's namespace(s) wisely.

For convience and testing purposes, GEN_ETS provides a default namespace wrapper and backend implementation based on ETS. See gen_ets and gen_ets_impl_ets for further details.

This repository is experimental in nature - use at your own risk and please contribute if you find GEN_ETS useful.

Quick Start Recipe

To download and build the gen_ets application in one shot, please follow this recipe:

$ mkdir working-directory-name
$ cd working-directory-name
$ git clone https://github.com/norton/gen-ets.git gen_ets
$ cd gen_ets
$ make deps clean compile

OR if QuickCheck is available then follow this recipe:

$ mkdir working-directory-name
$ cd working-directory-name
$ git clone https://github.com/norton/gen-ets.git gen_ets
$ cd gen_ets
$ make deps clean compile-for-eqc
$ (cd .qc; erl -smp +A 5 -pz ../deps/qc/ebin)

1> qc_statem_gen_ets:qc_run(500).
  :
  :
OK, passed 500 tests

100.0% {1,attempts}

7.10% {delete,ok}
7.01% {new,ok}
3.76% {select_count,ok}
3.65% {select,ok}
3.57% {match_object,ok}
3.56% {match31,ok}
3.54% {select_reverse31,ok}
3.54% {insert,ok}
3.54% {select_reverse,ok}
3.52% {last,ok}
3.47% {match_delete,ok}
3.46% {tab2list,ok}
3.46% {lookup,ok}
3.45% {foldl,ok}
3.44% {insert_new,ok}
3.43% {member,ok}
3.41% {match,ok}
3.40% {match_object31,ok}
3.35% {foldr,ok}
3.34% {first,ok}
3.33% {all,ok}
3.32% {select_delete,ok}
3.30% {delete_all_objects,ok}
3.28% {select31,ok}
2.40% {lookup_element,{error,badarg}}
2.09% {next,ok}
1.90% {prev,ok}
1.38% {next,{error,badarg}}
1.36% {prev,{error,badarg}}
0.66% {lookup_element,ok}
true

Documentation

Where should I start?

This README is the only bit of documentation right now.

The QC (a.k.a. QuickCheck) tests underneath the "tests/qc" directory should be helpful for understanding the specification and behavior of ETS and GEN_ETS. NIF-based implementations.

What is ETS and DETS?

ETS and DETS are Erlang/OTP's standard library modules for Erlang term storage. ETS is a memory-based implementation. DETS is a disk-based implementation.

See http://www.erlang.org/doc/man/ets.html and http://www.erlang.org/doc/man/dets.html for further details.

Tools

For further information and help for related tools, please refer to the following links:

Roadmap

N/A

Modules

gen_ets
gen_ets_impl_ets
gen_ets_lib
gen_ets_ns
gen_ets_reg
Something went wrong with that request. Please try again.