-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the constructor to in_predicate
where we can also accept a vector [API-551]
#890
Conversation
…ctor of keys/values for the query. Also added a new test `IssueTest::issue_888` and updated the `ClientMapTest::testValuesWithPredicate` to use a vectory of keys. The query example should also work with this fix. fixes hazelcast#888
Windows test PASSed. |
Linux test PASSed. |
@@ -64,6 +64,15 @@ namespace hazelcast { | |||
out_stream.write<int32_t>(static_cast<int32_t>(sizeof...(values))); | |||
out_stream.write_objects(values...); | |||
} | |||
|
|||
template<typename T> | |||
multi_predicate(const std::string attribute_name, hazelcast_client &client, const std::vector<T> &values) : base_predicate(client) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the hazelcast_client
needed to create a predicate? IMO it would be great to get rid of it if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately, we need it to access the serialization service. I also do not like it but i had to do it due to the fact that i needed to prepare the binary during construction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I wish we could defer binary construction. Taking a client as a parameter has more problems, like would passing a different to multi_predicate
than the one calling the actual query cause problems? But I guess this is not something that can be changed in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing a different client, yes, that may cause a problem if serialization configs are different. Alternative was to use the client as the factory method to create the in_predicate
but it again has the same problem if the user would use a client predicate with the other client. I am open to any better solution but could not find one as of yet. Yes, we can open another issue to discuss this topic.
in_predicate
where we can also accept a vectorin_predicate
where we can also accept a vector [API-551]
Windows test PASSed. |
Linux test PASSed. |
Added the constructor to
in_predicate
where we can also accept a vector of keys/values for the query. Also added a new testIssueTest::issue_888
and updated theClientMapTest::testValuesWithPredicate
to use a vector of keys. The query example should also work with this fix.fixes #888