@@ -448,9 +448,9 @@ init(#{dir := Dir,
448448 MaxSizeChunks = application :get_env (osiris , max_segment_size_chunks ,
449449 ? DEFAULT_MAX_SEGMENT_SIZE_C ),
450450 Retention = maps :get (retention , Config , []),
451- ? INFO (" Stream: ~s will use ~s for osiris log data directory" ,
451+ ? INFO (" Stream: ~ts will use ~ts for osiris log data directory" ,
452452 [Name , Dir ]),
453- ? DEBUG (" osiris_log:init/1 stream ~s max_segment_size_bytes: ~b ,
453+ ? DEBUG (" osiris_log:init/1 stream ~ts max_segment_size_bytes: ~b ,
454454 max_segment_size_chunks ~b , retention ~w " ,
455455 [Name , MaxSizeBytes , MaxSizeChunks , Retention ]),
456456 ok = filelib :ensure_dir (Dir ),
@@ -523,7 +523,7 @@ init(#{dir := Dir,
523523 counters :put (Cnt , ? C_SEGMENTS , NumSegments ),
524524 osiris_log_shared :set_first_chunk_id (Shared , FstChId ),
525525 osiris_log_shared :set_last_chunk_id (Shared , LastChId ),
526- ? DEBUG (" ~s :~s /~b : ~s next offset ~b first offset ~b " ,
526+ ? DEBUG (" ~s :~s /~b : ~ts next offset ~b first offset ~b " ,
527527 [? MODULE ,
528528 ? FUNCTION_NAME ,
529529 ? FUNCTION_ARITY ,
@@ -799,7 +799,7 @@ init_acceptor(Range, EpochOffsets0,
799799
800800 % % then truncate to
801801 IdxFiles = sorted_index_files (Dir ),
802- ? DEBUG (" ~s : ~s ~s from epoch offsets: ~w range ~w " ,
802+ ? DEBUG (" ~s : ~s ~ts from epoch offsets: ~w range ~w " ,
803803 [? MODULE , ? FUNCTION_NAME , Name , EpochOffsets , Range ]),
804804 RemIdxFiles = truncate_to (Name , Range , EpochOffsets , IdxFiles ),
805805 % % after truncation we can do normal init
@@ -835,7 +835,7 @@ chunk_id_index_scan0(Fd, ChunkId) ->
835835
836836delete_segment_from_index (Index ) ->
837837 File = segment_from_index_file (Index ),
838- ? DEBUG (" osiris_log: deleting segment ~s " , [File ]),
838+ ? DEBUG (" osiris_log: deleting segment ~ts " , [File ]),
839839 ok = prim_file :delete (Index ),
840840 ok = prim_file :delete (File ),
841841 ok .
@@ -884,7 +884,7 @@ truncate_to(Name, RemoteRange, [{E, ChId} | NextEOs], IdxFiles) ->
884884 % % build_seg_info/1?
885885 end ;
886886 {found , # seg_info {file = File , index = IdxFile }} ->
887- ? DEBUG (" osiris_log: ~s on node ~s truncating to chunk "
887+ ? DEBUG (" osiris_log: ~ts on node ~ts truncating to chunk "
888888 " id ~b in epoch ~b " ,
889889 [Name , node (), ChId , E ]),
890890 % % this is the inclusive case
@@ -937,7 +937,7 @@ init_data_reader({StartChunkId, PrevEOT}, #{dir := Dir,
937937 name := Name } = Config ) ->
938938 IdxFiles = sorted_index_files (Dir ),
939939 Range = offset_range_from_idx_files (IdxFiles ),
940- ? DEBUG (" osiris_segment:init_data_reader/2 ~s at ~b prev "
940+ ? DEBUG (" osiris_segment:init_data_reader/2 ~ts at ~b prev "
941941 " ~w local range: ~w " ,
942942 [Name , StartChunkId , PrevEOT , Range ]),
943943 % % Invariant: there is always at least one segment left on disk
@@ -1258,7 +1258,7 @@ last_user_chunk_id0([IdxFile | Rest]) ->
12581258 {ok , Id , Pos } ->
12591259 {Id , Pos , IdxFile };
12601260 {error , Reason } ->
1261- ? DEBUG (" Could not find user chunk in index file ~s (~p )" , [IdxFile , Reason ]),
1261+ ? DEBUG (" Could not find user chunk in index file ~ts (~p )" , [IdxFile , Reason ]),
12621262 last_user_chunk_id0 (Rest )
12631263 end .
12641264
@@ -1564,7 +1564,7 @@ delete_directory(#{name := Name} = Config) when is_map(Config) ->
15641564 delete_directory (Name );
15651565delete_directory (Name ) when ? IS_STRING (Name ) ->
15661566 Dir = directory (Name ),
1567- ? DEBUG (" osiris_log: deleting directory ~s " , [Dir ]),
1567+ ? DEBUG (" osiris_log: deleting directory ~ts " , [Dir ]),
15681568 case file :list_dir (Dir ) of
15691569 {ok , Files } ->
15701570 [ok =
@@ -1688,7 +1688,7 @@ first_and_last_seginfos0([FstIdxFile | Rem] = IdxFiles) ->
16881688 {ok , LastSegInfo } ->
16891689 {length (Rem ) + 1 , FstSegInfo , LastSegInfo };
16901690 {error , Err } ->
1691- ? ERROR (" ~s : failed to build seg_info from file ~s , error: ~w " ,
1691+ ? ERROR (" ~s : failed to build seg_info from file ~ts , error: ~w " ,
16921692 [? MODULE , LastIdxFile , Err ]),
16931693 error (Err )
16941694 end ;
@@ -1804,7 +1804,7 @@ build_segment_info(SegFile, LastChunkPos, IdxFile) ->
18041804 _Reserved :32 >>} ->
18051805 Size = LastChunkPos + LastSize + LastTSize + ? HEADER_SIZE_B ,
18061806 {ok , Eof } = file :position (Fd , eof ),
1807- ? DEBUG_IF (" ~s : segment ~s has trailing data ~w ~w " ,
1807+ ? DEBUG_IF (" ~s : segment ~ts has trailing data ~w ~w " ,
18081808 [? MODULE , filename :basename (SegFile ),
18091809 Size , Eof ], Size =/= Eof ),
18101810 _ = file :close (Fd ),
@@ -1903,7 +1903,7 @@ update_retention(Retention,
19031903evaluate_retention (Dir , Specs ) when is_list (Dir ) ->
19041904 % convert to binary for faster operations later
19051905 % mostly in segment_from_index_file/1
1906- evaluate_retention (list_to_binary (Dir ), Specs );
1906+ evaluate_retention (unicode : characters_to_binary (Dir ), Specs );
19071907evaluate_retention (Dir , Specs ) when is_binary (Dir ) ->
19081908
19091909 {Time , Result } = timer :tc (
@@ -2354,7 +2354,7 @@ open_new_segment(#?MODULE{cfg = #cfg{name = Name,
23542354 _ = close_fd (OldIdxFd ),
23552355 Filename = make_file_name (NextOffset , " segment" ),
23562356 IdxFilename = make_file_name (NextOffset , " index" ),
2357- ? DEBUG (" ~s : ~s ~s : ~s " , [? MODULE , ? FUNCTION_NAME , Name , Filename ]),
2357+ ? DEBUG (" ~s : ~s ~ts : ~ts " , [? MODULE , ? FUNCTION_NAME , Name , Filename ]),
23582358 {ok , IdxFd } =
23592359 file :open (
23602360 filename :join (Dir , IdxFilename ), ? FILE_OPTS_WRITE ),
@@ -2784,7 +2784,6 @@ close_fd(Fd) ->
27842784
27852785-ifdef (TEST ).
27862786
2787- % -include_lib("eunit/include/eunit.hrl").
27882787
27892788part_test () ->
27902789 [<<" ABCD" >>] = part (4 , [<<" ABCDEF" >>]),
0 commit comments