351351-type offset_entry () :: {offset (), osiris :entry ()}.
352352-type offset_spec () :: osiris :offset_spec ().
353353-type retention_spec () :: osiris :retention_spec ().
354+ -type chunk_iterator () :: osiris_log_read :chunk_iterator ().
354355-type header_map () ::
355356 #{chunk_id => offset (),
356357 epoch => epoch (),
@@ -758,15 +759,6 @@ counters_ref(#?MODULE{cfg = #cfg{counter = C}}) ->
758759read_header (State ) ->
759760 osiris_log_read :read_header (State ).
760761
761- -record (iterator , {fd :: file :io_device (),
762- next_offset :: offset (),
763- % % entries left
764- num_left :: non_neg_integer (),
765- % % any trailing data from last read
766- % % we try to capture at least the size of the next record
767- data :: undefined | binary (),
768- next_record_pos :: non_neg_integer ()}).
769- -opaque chunk_iterator () :: # iterator {}.
770762-define (REC_MATCH_SIMPLE (Len , Rem ),
771763 <<0 :1 , Len :31 /unsigned , Rem /binary >>).
772764-define (REC_MATCH_SUBBATCH (CompType , NumRec , UncompLen , Len , Rem ),
@@ -781,21 +773,21 @@ read_header(State) ->
781773
782774
783775-spec chunk_iterator (state ()) ->
784- {ok , header_map (), chunk_iterator (), state ()} |
776+ {ok , header_map (), osiris_log_read : chunk_iterator (), state ()} |
785777 {end_of_stream , state ()} |
786778 {error , {invalid_chunk_header , term ()}}.
787779chunk_iterator (State ) ->
788780 chunk_iterator (State , 1 ).
789781
790782-spec chunk_iterator (state (), pos_integer () | all ) ->
791- {ok , header_map (), chunk_iterator (), state ()} |
783+ {ok , header_map (), osiris_log_read : chunk_iterator (), state ()} |
792784 {end_of_stream , state ()} |
793785 {error , {invalid_chunk_header , term ()}}.
794786chunk_iterator (State , CreditHint ) ->
795787 osiris_log_read :chunk_iterator (State , CreditHint ).
796788
797- -spec iterator_next (chunk_iterator ()) ->
798- end_of_chunk | {offset_entry (), chunk_iterator ()}.
789+ -spec iterator_next (osiris_log_read : chunk_iterator ()) ->
790+ end_of_chunk | {offset_entry (), osiris_log_read : chunk_iterator ()}.
799791iterator_next (Iter ) ->
800792 osiris_log_read :iterator_next (Iter ).
801793
0 commit comments