From b417a564ec58eb1319fb62b9abe43a78261bbe0a Mon Sep 17 00:00:00 2001 From: hofmockel Date: Sun, 2 Feb 2014 17:25:46 +0100 Subject: [PATCH] A little bit more text on the tutorial --- docs/tutorial/index.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst index c272436..2e471f4 100644 --- a/docs/tutorial/index.rst +++ b/docs/tutorial/index.rst @@ -165,8 +165,13 @@ MergeOperator ============= Merge operators are useful for efficient read-modify-write operations. +For more details see `Merge Operator `_ -The simple Associative merge :: +A python merge operator must either implement the +:py:class:`rocksdb.interfaces.AssociativeMergeOperator` or +:py:class:`rocksdb.interfaces.MergeOperator` interface. + +The following example python merge operator implements a counter :: class AssocCounter(rocksdb.interfaces.AssociativeMergeOperator): def merge(self, key, existing_value, value): @@ -195,8 +200,10 @@ PrefixExtractor According to `Prefix API `_ a prefix_extractor can reduce IO for scans within a prefix range. -The following example presents a prefix extractor of a static size. So always -the first 5 bytes are used as the prefix :: +A python prefix extractor must implement the :py:class:`rocksdb.interfaces.SliceTransform` interface. + +The following example presents a prefix extractor of a static size. +So always the first 5 bytes are used as the prefix :: class StaticPrefix(rocksdb.interfaces.SliceTransform): def name(self):