Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Dec 18, 2019
1 parent ea96ead commit e6393f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/server/pegasus_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
6 changes: 5 additions & 1 deletion src/server/test/hashkey_transform_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e6393f6

Please sign in to comment.