# Module rdht_tx_read

- Description
- Data Types
- Function Index
- Function Details

Part of replicated DHT implementation.

Copyright © 2009-2015 Zuse Institute Berlin

Version: $Id$

Behaviours: `gen_component`, `tx_op_beh`.

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

## Description

Part of replicated DHT implementation. The read operation.

## Data Types

### client_key()

    client_key() = [unicode_char()]

### client_version()

    client_version() = non_neg_integer()

### state()

    state() = {pos_integer(), pos_integer(), pos_integer(), atom()}

### unicode_char()

    unicode_char() = 0..55295 | 57344..65533 | 65536..1114111

## Function Index

abort/5 |
check_config/0 | Checks whether config parameters for rdht_tx_read exist and are valid.
commit/5 |
extract_from_tlog/4 | Get a result entry for a read from the given TLog entry.
extract_from_tlog_feeder/4 |
extract_from_value/3 | Performs the requested operation in the dht_node context.
init/1 |
on/2 |
start_gen_component/5 |
start_link/1 |
validate/3 |
validate_prefilter/1 |
work_phase/3 |
work_phase_key/5 |

## Function Details

### start_gen_component/5

    start_gen_component(Module :: module(),
                        Handler :: gen_component:handler(),
                        Args :: term(),
                        Options :: [gen_component:option()],
                        Self :: pid()) ->
                           no_return() | ok

### work_phase/3

    work_phase(ClientPid :: pid(),
               ReqId :: rdht_tx:req_id() | rdht_tx_write:req_id(),
               Request :: api_tx:request()) ->
                  ok

### work_phase_key/5

    work_phase_key(ClientPid :: comm:erl_local_pid(),
                   ReqId :: rdht_tx:req_id() | rdht_tx_write:req_id(),
                   Key :: client_key(),
                   HashedKey :: rt_chord:key(),
                   Op ::
                       76 |
                       77 |
                       81 |
                       {83,
                        Start :: pos_integer() | neg_integer(),
                        Len :: integer()}) ->
                      ok

### extract_from_value/3

    extract_from_value(Value :: rdht_tx:encoded_value(),
                       Version :: client_version(),
                       Op :: 76) ->
                          Result ::
                              {84,
                               rdht_tx:encoded_value(),
                               client_version()}

Performs the requested operation in the dht_node context.

### extract_from_tlog_feeder/4

    extract_from_tlog_feeder(Entry :: tx_tlog:tlog_entry(),
                             Key :: client_key(),
                             Op ::
                                 read |
                                 random_from_list |
                                 {sublist,
                                  Start ::
                                      pos_integer() | neg_integer(),
                                  Len :: integer()},
                             EnDecode :: boolean()) ->
                                {tx_tlog:tlog_entry(),
                                 client_key(),
                                 Op ::
                                     read |
                                     random_from_list |
                                     {sublist,
                                      Start ::
                                          pos_integer() |
                                          neg_integer(),
                                      Len :: integer()},
                                 EnDecode :: boolean()}

### extract_from_tlog/4

    extract_from_tlog(Entry :: tx_tlog:tlog_entry(),
                      Key :: client_key(),
                      Op :: read,
                      EnDecode :: boolean()) ->
                         {tx_tlog:tlog_entry(), api_tx:read_result()}

Get a result entry for a read from the given TLog entry.

### validate_prefilter/1

    validate_prefilter(TLogEntry :: tx_tlog:tlog_entry()) ->
                          [tx_tlog:tlog_entry()]

### validate/3

    validate(DB :: db_dht:db(),
             OwnSnapNumber :: tx_tlog:snap_number(),
             RTLogEntry :: tx_tlog:tlog_entry()) ->
                {db_dht:db(), 72 | 74}

### commit/5

    commit(DB :: db_dht:db(),
           RTLogEntry :: tx_tlog:tlog_entry(),
           OwnProposalWas :: 72 | 74,
           TMSnapNo :: tx_tlog:snap_number(),
           OwnSnapNo :: tx_tlog:snap_number()) ->
              db_dht:db()

### abort/5

    abort(DB :: db_dht:db(),
          RTLogEntry :: tx_tlog:tlog_entry(),
          OwnProposalWas :: 72 | 74,
          TMSnapNo :: tx_tlog:snap_number(),
          OwnSnapNo :: tx_tlog:snap_number()) ->
             db_dht:db()

### start_link/1

    start_link(DHTNodeGroup :: pid_groups:groupname()) -> {ok, pid()}

### init/1

    init(X1 :: []) -> state()

### on/2

    on(X1 :: comm:message(), State :: state()) -> state()

### check_config/0

    check_config() -> boolean()

Checks whether config parameters for rdht_tx_read exist and are valid.

Generated by EDoc, Apr 22 2017, 15:58:20.