Skip to content
This repository

Dialyzer fixes #90

Merged
merged 1 commit into from about 1 year ago

2 participants

Evan Vigil-McClanahan Ryan Zezeski
Evan Vigil-McClanahan
evanmcc commented

add some typespecs to get dialyzer clean, and move a lager warning to error_logger, since that's normally the way that it's done in bitcask (gets cleaned up by the lager parse_transform anyway). cc @rzezeski

Ryan Zezeski
Collaborator

+1 to merge

  • Code looks good
  • No dialyzer errors
  • EQC tests still fail intermittently because of expiry change -- will be adressed in different PR
Evan Vigil-McClanahan evanmcc merged commit 07b24e8 into from
Evan Vigil-McClanahan evanmcc closed this
Engel A. Sanchez engelsanchez deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

May 23, 2013
Evan Vigil-McClanahan evanmcc get dializer clean, and move a lager warning to error_logger. f9a1069
This page is out of date. Refresh to see the latest.

Showing 2 changed files with 5 additions and 8 deletions. Show diff stats Hide diff stats

  1. +4 2 src/bitcask.erl
  2. +1 6 src/bitcask_file.erl
6 src/bitcask.erl
@@ -459,7 +459,8 @@ merge(Dirname, Opts) ->
459 459
460 460 %% @doc Merge several data files within a bitcask datastore
461 461 %% into a more compact form.
462   --spec merge(Dirname::string(), Opts::[_], FilesToMerge::[string()]) -> ok.
  462 +-spec merge(Dirname::string(), Opts::[_],
  463 + {FilesToMerge::[string()],FilesToDelete::[string()]}) -> ok.
463 464 merge(_Dirname, _Opts, []) ->
464 465 ok;
465 466 merge(Dirname,Opts,FilesToMerge) when is_list(FilesToMerge) ->
@@ -627,7 +628,7 @@ consider_for_merge(FragTrigger, DeadBytesTrigger, ExpirationGraceTime) ->
627 628 )
628 629 end.
629 630
630   --spec needs_merge(reference()) -> {true, [string()]} | false.
  631 +-spec needs_merge(reference()) -> {true, {[string()], [string()]}} | false.
631 632 needs_merge(Ref) ->
632 633 State = get_state(Ref),
633 634 {_KeyCount, Summary} = summary_info(Ref),
@@ -1174,6 +1175,7 @@ out_of_date(Key, Tstamp, FileId, {_,_,Offset,_} = Pos, ExpiryTime, EverFound,
1174 1175 end
1175 1176 end.
1176 1177
  1178 +-spec readable_files(string()) -> [string()].
1177 1179 readable_files(Dirname) ->
1178 1180 %% Check the write and/or merge locks to see what files are currently
1179 1181 %% being written to. Generate our list excepting those.
7 src/bitcask_file.erl
@@ -192,9 +192,4 @@ check_owner({Pid, _Mref}, #state{owner=Owner}) ->
192 192 end.
193 193
194 194 warn(Fmt, Args) ->
195   - case code:which(lager) of
196   - non_existing ->
197   - io:format(Fmt, Args);
198   - _ ->
199   - lager:warning(Fmt, Args)
200   - end.
  195 + error_logger:warning_msg(Fmt, Args).

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.