# Module prbr

- Description
- Data Types
- Function Index
- Function Details

Generic paxos round based register (prbr) implementation.

Copyright © 2012-2016 Zuse Institute Berlin,

Version: $Id$

Authors: Florian Schintke (`schintke@zib.de`).

## Description

Generic paxos round based register (prbr) implementation. The read/write store alias acceptor.

## Data Types

### entry()

    entry() = {any(), pr:pr(), pr:pr(), any()}

### message()

    message() =
        {prbr,
         read,
         DB :: dht_node_state:db_selector(),
         WasConsistentLookup :: boolean(),
         Proposer :: comm:mypid(),
         rt_chord:key(),
         DataType :: module(),
         InRound :: pr:pr(),
         read_filter()} |
        {prbr,
         write,
         DB :: dht_node_state:db_selector(),
         WasConsistentLookup :: boolean(),
         Proposer :: comm:mypid(),
         rt_chord:key(),
         DataType :: module(),
         InRound :: pr:pr(),
         Value :: term(),
         PassedToUpdate :: term(),
         write_filter()} |
        {prbr,
         delete_key,
         DB :: dht_node_state:db_selector(),
         Client :: comm:mypid(),
         Key :: rt_chord:key()} |
        {prbr,
         tab2list_raw,
         DB :: dht_node_state:db_selector(),
         Client :: comm:mypid()}

### read_filter()

    read_filter() = fun((term()) -> term())

### state()

    state() = db_prbr:db()

### write_filter()

    write_filter() =
        fun((term(), term(), term()) -> {term(), term()})

## Function Index

check_config/0 | Checks whether config parameters exist and are valid.
close/1 | Closes the given DB (it may be recoverable using open/1 depending on the DB back-end).
close_and_delete/1 | Closes the given DB and deletes all contents (this DB can thus not be re-opened using open/1).
delete_entry/2 |
entry_key/1 |
entry_set_val/2 |
entry_val/1 |
get_entry/2 |
get_load/1 |
init/1 |
new/2 |
noop_read_filter/1 |
noop_write_filter/3 |
on/2 |
set_entry/2 |
tab2list/1 |
tab2list_raw_unittest/1 |
tester_create_write_filter/1 |

## Function Details

### noop_read_filter/1

    noop_read_filter(X :: term()) -> term()

### noop_write_filter/3

    noop_write_filter(Old :: term(), WF :: term(), Val :: term()) ->
                         {term(), none}

### init/1

    init(DBName :: atom() | tuple()) -> state()

### close/1

    close(State :: state()) -> true

Closes the given DB (it may be recoverable using open/1 depending on the DB back-end).

### close_and_delete/1

    close_and_delete(State :: state()) -> true

Closes the given DB and deletes all contents (this DB can thus not be re-opened using open/1).

### on/2

    on(X1 :: message(), TableName :: state()) -> state()

### get_entry/2

    get_entry(Id :: any(), TableName :: state()) -> entry()

### set_entry/2

    set_entry(NewEntry :: entry(), TableName :: state()) -> state()

### delete_entry/2

    delete_entry(TableName :: state(), Entry :: entry()) ->
                    db_prbr:db()

### get_load/1

    get_load(State :: state()) -> non_neg_integer()

### tab2list/1

    tab2list(State :: state()) -> [{any(), any()}]

### tab2list_raw_unittest/1

    tab2list_raw_unittest(State :: state()) -> [entry()]

### new/2

    new(Key :: any(), Val :: any()) -> entry()

### entry_key/1

    entry_key(Entry :: entry()) -> any()

### entry_val/1

    entry_val(Entry :: entry()) -> any()

### entry_set_val/2

    entry_set_val(Entry :: entry(), Value :: any()) -> entry()

### check_config/0

    check_config() -> true

Checks whether config parameters exist and are valid.

### tester_create_write_filter/1

    tester_create_write_filter(X1 :: 0) -> write_filter()

Generated by EDoc, Feb 29 2016, 16:12:13.