summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-04-02 14:23:10 +0100
committerSimon MacMullen <simon@rabbitmq.com>2012-04-02 14:23:10 +0100
commit48a1033868039175b0d27fe9daf99501d6152159 (patch)
tree492415e120e28a8700d10b156bb78450eac93aa3
parent8dc01eb11b0e918f61654fcc8117aee09d8d9a5c (diff)
downloadrabbitmq-server-bug24750.tar.gz
Attempt to flesh out the essay slightly more.bug24750
-rw-r--r--src/dtree.erl22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/dtree.erl b/src/dtree.erl
index f5c260ef..265bb340 100644
--- a/src/dtree.erl
+++ b/src/dtree.erl
@@ -14,13 +14,21 @@
%% Copyright (c) 2007-2012 VMware, Inc. All rights reserved.
%%
-%% A dual-index tree. Entries have a primary key and a set of
-%% secondary keys. Most operations require the supply of just the
-%% secondary key. Entries exists while they have a non-empty secondar
-%% key set. The 'take' operations return the entries that got removed,
-%% i.e. that had no remaining secondary keys. take/3 expects entries
-%% to exist with the supplied primary keys and secondary key. take/2
-%% can cope with the supplied secondary key having no entries.
+%% A dual-index tree.
+%%
+%% Conceptually, what we want is a map that has two distinct sets of
+%% keys (referred to here as primary and secondary, although that
+%% shouldn't imply a hierarchy) pointing to one set of
+%% values. However, in practice what we'll always want to do is insert
+%% a value that's pointed at by (one primary, many secondaries) and
+%% remove values that are pointed at by (one secondary, many
+%% primaries) or (one secondary, all primaries). Thus the API.
+%%
+%% Entries exists while they have a non-empty secondary key set. The
+%% 'take' operations return the entries that got removed, i.e. that
+%% had no remaining secondary keys. take/3 expects entries to exist
+%% with the supplied primary keys and secondary key. take/2 can cope
+%% with the supplied secondary key having no entries.
-module(dtree).