# Module tx_tm_rtm

- Description
- Data Types
- Function Index
- Function Details

Part of a generic implementation of transactions using Paxos Commit - the roles of the (replicated) transaction manager TM and RTM.

Copyright © 2009-2015 Zuse Institute Berlin,

Version: $Id$

Behaviours: `gen_component`.

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

## Description

Part of a generic implementation of transactions using Paxos Commit - the roles of the (replicated) transaction manager TM and RTM.

## Data Types

### paxos_id()

abstract datatype: `paxos_id()`

### rtm()

    rtm() =
        {rt_chord:key(),
         {comm:mypid()} | unknown,
         Role :: pos_integer(),
         {Acceptor :: comm:mypid()} | unknown}

### rtms()

    rtms() = [rtm()]

### state()

    state() =
        {RTMs :: rtms(),
         TableName :: pdb:tableid(),
         Role :: pid_groups:pidname(),
         LocalAcceptor :: pid(),
         GLocalLearner :: comm:mypid(),
         OpenTxNum :: non_neg_integer(),
         LocalSnapNo :: non_neg_integer()}

### tx_id()

    tx_id() = {67, uid:global_uid()}

### tx_item_id()

    tx_item_id() =
        {68, TLogUid :: uid:global_uid(), ItemId :: non_neg_integer()}

## Function Index

check_config/0 | Checks whether config parameters for tx_tm_rtm exist and are valid.
commit/4 |
get_my/2 |
init/1 |
msg_commit_reply/3 |
on/2 |
on_init/2 |
rm_send_update/5 | Notifies the tx_tm_rtm of a changed node ID.
start_gen_component/5 |
start_link/2 |

## 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

### msg_commit_reply/3

    msg_commit_reply(Client :: comm:mypid(),
                     ClientsID :: any(),
                     Result :: any()) ->
                        ok

### commit/4

    commit(TM :: comm:erl_local_pid(),
           Client :: comm:mypid(),
           ClientsID :: any(),
           TLog :: tx_tlog:tlog()) ->
              ok

### rm_send_update/5

    rm_send_update(Subscriber :: pid(),
                   Tag :: tx_tm_rtm,
                   OldNeighbors :: nodelist:neighborhood(),
                   NewNeighbors :: nodelist:neighborhood(),
                   Reason :: rm_loop:reason()) ->
                      ok

Notifies the tx_tm_rtm of a changed node ID.

### start_link/2

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

### init/1

    init(X1 :: []) ->
            state() |
            {'$gen_component',
             [{on_handler, gen_component:handler()}, ...],
             state()}

### on/2

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

### on_init/2

    on_init(Msg :: comm:message(), State :: state()) ->
               state() |
               {'$gen_component',
                [{on_handler, Handler :: gen_component:handler()}],
                State :: state()}

### get_my/2

    get_my(Role :: pid_groups:pidname(), PaxosRole :: atom()) ->
              pid() | failed

### check_config/0

    check_config() -> boolean()

Checks whether config parameters for tx_tm_rtm exist and are valid.

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