diff --git a/src/leveled_bookie.erl b/src/leveled_bookie.erl index b606b2f..901f6b8 100644 --- a/src/leveled_bookie.erl +++ b/src/leveled_bookie.erl @@ -163,6 +163,8 @@ -type timing_types() :: head|get|put|fold. -type recent_aae() :: false|#recent_aae{}|undefined. -type key() :: binary()|string(). + % Keys SHOULD be binary() + % string() support is a legacy of old tests -type open_options() :: %% For full description of options see ../docs/STARTUP_OPTIONS.md [{root_path, string()|undefined} | @@ -279,6 +281,8 @@ % Defaults to ?COMPRESSION_POINT ]. +-export_type([key/0]). + %%%============================================================================ %%% API diff --git a/src/leveled_codec.erl b/src/leveled_codec.erl index e90f2c4..e23f04c 100644 --- a/src/leveled_codec.erl +++ b/src/leveled_codec.erl @@ -837,16 +837,15 @@ get_metadata_from_siblings(<>, MetaBin:MetaLen/binary>>, [LastMod|LastMods]). - +-spec next_key(leveled_bookie:key()) -> leveled_bookie:key(). +%% @doc +%% Get the next key to iterate from a given point next_key(Key) when is_binary(Key) -> <>; -next_key(Key) when is_integer(Key) -> - Key + 1; next_key(Key) when is_list(Key) -> Key ++ [0]. - %%%============================================================================ %%% Test %%%============================================================================