From e6393f62291440d3201b33e5b89af0e44a5955c0 Mon Sep 17 00:00:00 2001 From: Yingchun Lai <405403881@qq.com> Date: Wed, 18 Dec 2019 17:04:40 +0800 Subject: [PATCH] add comments --- src/server/pegasus_server_impl.cpp | 6 +++--- src/server/test/hashkey_transform_test.cpp | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/server/pegasus_server_impl.cpp b/src/server/pegasus_server_impl.cpp index 91deb2412f..37f6aeeb26 100644 --- a/src/server/pegasus_server_impl.cpp +++ b/src/server/pegasus_server_impl.cpp @@ -1197,10 +1197,10 @@ void pegasus_server_impl::on_get_scanner(const ::dsn::apps::get_scanner_request start_inclusive = true; // Now 'start' is generated by 'request.hash_key_filter_pattern', it may be not a real // hashkey, we should not seek this prefix by prefix bloom filter. However, it only - // happend when do full scan (scanners got by get_unordered_scanners), in which case the + // happen when do full scan (scanners got by get_unordered_scanners), in which case the // following flags has been updated. - assert(!_db_opts.prefix_extractor || rd_opts.total_order_seek); - assert(!_db_opts.prefix_extractor || !rd_opts.prefix_same_as_start); + dassert(!_db_opts.prefix_extractor || rd_opts.total_order_seek); + dassert(!_db_opts.prefix_extractor || !rd_opts.prefix_same_as_start); } } diff --git a/src/server/test/hashkey_transform_test.cpp b/src/server/test/hashkey_transform_test.cpp index 40a18ac353..6b6a82e3ea 100644 --- a/src/server/test/hashkey_transform_test.cpp +++ b/src/server/test/hashkey_transform_test.cpp @@ -9,7 +9,11 @@ #include "base/pegasus_key_schema.h" -// User define SliceTransform must obey the 4 rules of ColumnFamilyOptions.prefix_extractor +// User define SliceTransform must obey the 4 rules of ColumnFamilyOptions.prefix_extractor: +// 1) key.starts_with(prefix(key)) +// 2) Compare(prefix(key), key) <= 0. +// 3) If Compare(k1, k2) <= 0, then Compare(prefix(k1), prefix(k2)) <= 0 +// 4) prefix(prefix(key)) == prefix(key) TEST(HashkeyTransformTest, Basic) { pegasus::server::HashkeyTransform prefix_extractor;