summaryrefslogtreecommitdiff
path: root/src/couch/src/couch_db_engine.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couch/src/couch_db_engine.erl')
-rw-r--r--src/couch/src/couch_db_engine.erl24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/couch/src/couch_db_engine.erl b/src/couch/src/couch_db_engine.erl
index 9b288127a..9d804b1ab 100644
--- a/src/couch/src/couch_db_engine.erl
+++ b/src/couch/src/couch_db_engine.erl
@@ -42,6 +42,12 @@
-type purge_info() :: [{docid(), revs()}].
-type epochs() :: [{Node::atom(), UpdateSeq::non_neg_integer()}].
-type size_info() :: [{Name::atom(), Size::non_neg_integer()}].
+-type partition_info() :: [
+ {partition, Partition::binary()} |
+ {doc_count, DocCount::non_neg_integer()} |
+ {doc_del_count, DocDelCount::non_neg_integer()} |
+ {sizes, size_info()}
+].
-type write_stream_options() :: [
{buffer_size, Size::pos_integer()} |
@@ -254,6 +260,18 @@
-callback get_size_info(DbHandle::db_handle()) -> SizeInfo::size_info().
+% This returns the information for the given partition.
+% It should just be a list of {Name::atom(), Size::non_neg_integer()}
+% It returns the partition name, doc count, deleted doc count and two sizes:
+%
+% active - Theoretical minimum number of bytes to store this partition on disk
+%
+% external - Number of bytes that would be required to represent the
+% contents of this partition outside of the database
+-callback get_partition_info(DbHandle::db_handle(), Partition::binary()) ->
+ partition_info().
+
+
% The current update sequence of the database. The update
% sequence should be incrememnted for every revision added to
% the database.
@@ -627,6 +645,7 @@
get_prop/2,
get_prop/3,
get_size_info/1,
+ get_partition_info/2,
get_update_seq/1,
get_uuid/1,
@@ -803,6 +822,11 @@ get_size_info(#db{} = Db) ->
Engine:get_size_info(EngineState).
+get_partition_info(#db{} = Db, Partition) ->
+ #db{engine = {Engine, EngineState}} = Db,
+ Engine:get_partition_info(EngineState, Partition).
+
+
get_update_seq(#db{} = Db) ->
#db{engine = {Engine, EngineState}} = Db,
Engine:get_update_seq(EngineState).