summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2010-06-02 22:45:48 +0100
committerMatthias Radestock <matthias@lshift.net>2010-06-02 22:45:48 +0100
commit4ee7258ba4e5256e9552c48e287e28ff160f84a1 (patch)
tree2a1a5a030d6af0c1a111f2025617f4369da94521
parentd79a22e53591f30dbf8758335f1a3d95348ec44e (diff)
downloadrabbitmq-server-git-4ee7258ba4e5256e9552c48e287e28ff160f84a1.tar.gz
refactor: rename segment_fetch_keys to segments_nums
to abstract away from the dict-ness of the segment store
-rw-r--r--src/rabbit_queue_index.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rabbit_queue_index.erl b/src/rabbit_queue_index.erl
index 07a2c70f74..59330b204e 100644
--- a/src/rabbit_queue_index.erl
+++ b/src/rabbit_queue_index.erl
@@ -316,7 +316,7 @@ next_segment_boundary(SeqId) ->
bounds(State = #qistate { segments = Segments }) ->
%% This is not particularly efficient, but only gets invoked on
%% queue initialisation and termination.
- SegNums = lists:sort(segment_fetch_keys(Segments)),
+ SegNums = lists:sort(segment_nums(Segments)),
%% Don't bother trying to figure out the lowest seq_id, merely the
%% seq_id of the start of the lowest segment. That seq_id may not
%% actually exist, but that's fine. The important thing is that
@@ -679,7 +679,7 @@ all_segment_nums(#qistate { dir = Dir, segments = Segments }) ->
list_to_integer(
lists:takewhile(fun (C) -> $0 =< C andalso C =< $9 end,
SegName)), Set)
- end, sets:from_list(segment_fetch_keys(Segments)),
+ end, sets:from_list(segment_nums(Segments)),
filelib:wildcard("*" ++ ?SEGMENT_EXTENSION, Dir)))).
segment_find_or_new(Seg, Dir, Segments) ->
@@ -726,7 +726,7 @@ segment_map(Fun, {Segments, CachedSegments}) ->
lists:map(fun (Segment = #segment { num = Num }) -> Fun(Num, Segment) end,
CachedSegments)}.
-segment_fetch_keys({Segments, CachedSegments}) ->
+segment_nums({Segments, CachedSegments}) ->
lists:map(fun (#segment { num = Num }) -> Num end, CachedSegments) ++
dict:fetch_keys(Segments).