Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
empiredan committed Dec 6, 2024
1 parent 3f8170c commit 200c48a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion idl/utils.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace cpp dsn.utils
namespace go utils
namespace java org.apache.pegasus.utils

// How an string matches to a given pattern.
// How a string matches to a given pattern.
enum pattern_match_type
{
PMT_INVALID = 0,
Expand Down
1 change: 1 addition & 0 deletions src/server/pegasus_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,7 @@ int64_t pegasus_server_impl::last_flushed_decree() const
return static_cast<int64_t>(decree);
}

// TODO(wangdan): consider using dsn::utils::pattern_match().
bool pegasus_server_impl::validate_filter(::dsn::apps::filter_type::type filter_type,
const ::dsn::blob &filter_pattern,
const ::dsn::blob &value)
Expand Down
2 changes: 2 additions & 0 deletions src/utils/test/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ const std::vector<pattern_match_case> pattern_match_tests = {
{"abc", "xyz", pattern_match_type::PMT_MATCH_ALL, ERR_OK},
// It is matched exactly.
{"abc", "abc", pattern_match_type::PMT_MATCH_EXACT, ERR_OK},
// Empty string is matched exactly with empty pattern.
{"", "", pattern_match_type::PMT_MATCH_EXACT, ERR_OK},
// Non-empty string cannot be matched exactly with empty pattern.
{"abc", "", pattern_match_type::PMT_MATCH_EXACT, ERR_NOT_MATCHED},
// The string whose content is different from pattern would not be matched.
Expand Down

0 comments on commit 200c48a

Please sign in to comment.