diff options
author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-02 17:09:58 +0100 |
---|---|---|
committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-02 17:09:58 +0100 |
commit | 1a83d8af963dfc4869fc85f9c268cf9208d84487 (patch) | |
tree | 8a1cd8080ac9d0507f52f1fa623f6824198b54f3 /src/rabbit_msg_store_index.erl | |
parent | c28b3691958928f4e80800518a8fef416b950acc (diff) | |
download | rabbitmq-server-1a83d8af963dfc4869fc85f9c268cf9208d84487.tar.gz |
Added callback info to rabbit_msg_store.
Diffstat (limited to 'src/rabbit_msg_store_index.erl')
-rw-r--r-- | src/rabbit_msg_store_index.erl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/rabbit_msg_store_index.erl b/src/rabbit_msg_store_index.erl index 2f36256c..6cc0b2a7 100644 --- a/src/rabbit_msg_store_index.erl +++ b/src/rabbit_msg_store_index.erl @@ -16,6 +16,31 @@ -module(rabbit_msg_store_index). +-include("rabbit_msg_store.hrl"). + +-ifdef(use_specs). + +-type(dir() :: any()). +-type(index_state() :: any()). +-type(keyvalue() :: any()). +-type(fieldpos() :: non_neg_integer()). +-type(fieldvalue() :: any()). + +-callback new(dir()) -> index_state(). +-callback recover(dir()) -> rabbit_types:ok_or_error2(index_state(), any()). +-callback lookup(rabbit_types:msg_id(), index_state()) -> ('not_found' | keyvalue()). +-callback insert(keyvalue(), index_state()) -> 'ok'. +-callback update(keyvalue(), index_state()) -> 'ok'. +-callback update_fields(rabbit_types:msg_id(), ({fieldpos(), fieldvalue()} | + [{fieldpos(), fieldvalue()}]), + index_state()) -> 'ok'. +-callback delete(rabbit_types:msg_id(), index_state()) -> 'ok'. +-callback delete_object(keyvalue(), index_state()) -> 'ok'. +-callback delete_by_file(fieldvalue(), index_state()) -> 'ok'. +-callback terminate(index_state()) -> any(). + +-else. + -export([behaviour_info/1]). behaviour_info(callbacks) -> @@ -30,3 +55,5 @@ behaviour_info(callbacks) -> {terminate, 1}]; behaviour_info(_Other) -> undefined. + +-endif. |