# Module ra_log_reader

- Data Types
- Function Index
- Function Details

## Data Types

### access_pattern()

    access_pattern() = sequential | random

holds static or rarely changing fields

### segment_ref()

    segment_ref() =
        {From :: ra_index(), To :: ra_index(), File :: string()}

### state()

abstract datatype: `state()`

## Function Index

init/6 |
init/8 |
close/1 |
update_segments/2 |
handle_log_update/2 |
update_first_index/2 |
segment_refs/1 |
num_open_segments/1 |
read/3 |
read/4 |
sparse_read/3 |
fetch_term/2 |
delete_closed_mem_table_object/2 |
closed_mem_tables/1 |
open_mem_table_lookup/1 |

## Function Details

### init/6

    init(UId :: ra_uid(),
         Dir :: file:filename(),
         FirstIdx :: ra_index(),
         MaxOpen :: non_neg_integer(),
         SegRefs :: [segment_ref()],
         Names :: ra_system:names()) ->
            state()

### init/8

    init(UId :: ra_uid(),
         Dir :: file:filename(),
         FirstIdx :: ra_index(),
         MaxOpen :: non_neg_integer(),
         AccessPattern :: access_pattern(),
         SegRefs :: [segment_ref()],
         X7 :: ra_system:names(),
         Counter :: undefined | counters:counters_ref()) ->
            state()

### close/1

    close(X1 :: state()) -> ok

### update_segments/2

    update_segments(NewSegmentRefs :: [segment_ref()],
                    State :: state()) ->
                       state()

### handle_log_update/2

    handle_log_update(X1 ::
                          {ra_log_update,
                           undefined | pid(),
                           ra_index(),
                           [segment_ref()]},
                      State :: state()) ->
                         state()

### update_first_index/2

    update_first_index(Idx :: ra_index(), State :: state()) ->
                          {state(), [segment_ref()]}

### segment_refs/1

    segment_refs(X1 :: state()) -> [segment_ref()]

### num_open_segments/1

    num_open_segments(X1 :: state()) -> non_neg_integer()

### read/3

    read(From :: ra_index(), To :: ra_index(), State :: state()) ->
            {[log_entry()], NumRead :: non_neg_integer(), state()}

### read/4

    read(From :: ra_index(),
         To :: ra_index(),
         State :: state(),
         Entries :: [log_entry()]) ->
            {[log_entry()], NumRead :: non_neg_integer(), state()}

### sparse_read/3

    sparse_read(State :: state(),
                Indexes0 :: [ra_index()],
                Entries0 :: [log_entry()]) ->
                   {[log_entry()], state()}

### fetch_term/2

    fetch_term(Idx :: ra_index(), State0 :: state()) ->
                  {ra_index(), state()}

### delete_closed_mem_table_object/2

    delete_closed_mem_table_object(X1 :: state(), Id :: term()) ->
                                      true

### closed_mem_tables/1

    closed_mem_tables(X1 :: state()) -> list()

### open_mem_table_lookup/1

    open_mem_table_lookup(X1 :: state()) -> list()

Generated by EDoc