summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-04-11 13:14:36 +0100
committerMatthew Sackman <matthew@lshift.net>2009-04-11 13:14:36 +0100
commitf8e12da9203484e9a2e820dd3aeda26d6ff6818f (patch)
tree5b3cc744cb1a280af0022984358a7fed11d0a6ef
parentcd8e9999fc072f56ce181058b0f993bbc3004de4 (diff)
downloadrabbitmq-server-git-f8e12da9203484e9a2e820dd3aeda26d6ff6818f.tar.gz
corrected some bugs.
Performance still isn't quite where I would like it to be. Need to do more profiling. Seem to be unnecessarily CPU bound despite use of ets throughout.
-rw-r--r--src/rabbit_disk_queue.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rabbit_disk_queue.erl b/src/rabbit_disk_queue.erl
index b9faf7677b..582477992e 100644
--- a/src/rabbit_disk_queue.erl
+++ b/src/rabbit_disk_queue.erl
@@ -99,10 +99,6 @@ init([FileSizeLimit, ReadFileHandlesLimit]) ->
process_flag(trap_exit, true),
InitName = "0" ++ (?FILE_EXTENSION),
FileSummary = ets:new((?FILE_SUMMARY_ETS_NAME), [set, private]),
- true = ets:insert(FileSummary, {InitName, #dqfile { valid_data = 0,
- contiguous_prefix = 0,
- left = undefined,
- right = undefined}}),
State = #dqstate { msg_location = ets:new((?MSG_LOC_ETS_NAME), [set, private]),
file_summary = FileSummary,
file_detail = ets:new((?FILE_DETAIL_ETS_NAME), [ordered_set, private]),
@@ -357,7 +353,11 @@ load_from_disk(State) ->
true, mnesia:async_dirty(fun() -> mnesia:all_keys(rabbit_disk_queue) end)),
{ok, State1}.
-load_messages(undefined, [], State) ->
+load_messages(undefined, [], State = #dqstate { file_summary = FileSummary, current_file_name = CurName }) ->
+ true = ets:insert_new(FileSummary, {CurName, #dqfile { valid_data = 0,
+ contiguous_prefix = 0,
+ left = undefined,
+ right = undefined}}),
State;
load_messages(Left, [], State = #dqstate { file_detail = FileDetail }) ->
Num = list_to_integer(filename:rootname(Left)),