Skip to content

Add the constructor to in_predicate where we can also accept a vector [API-551]#890

Merged
ihsandemir merged 2 commits intohazelcast:masterfrom
ihsandemir:in_predicate_fix
Jun 30, 2021
Merged

Add the constructor to in_predicate where we can also accept a vector [API-551]#890
ihsandemir merged 2 commits intohazelcast:masterfrom
ihsandemir:in_predicate_fix

Conversation

@ihsandemir
Copy link
Copy Markdown
Collaborator

Added the constructor to in_predicate where we can also accept a vector of keys/values for the query. Also added a new test IssueTest::issue_888 and updated the ClientMapTest::testValuesWithPredicate to use a vector of keys. The query example should also work with this fix.

fixes #888

…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
@ihsandemir ihsandemir added this to the 4.1.2 milestone Jun 21, 2021
@ihsandemir ihsandemir requested review from sancar, yemreinci and yuce June 21, 2021 21:54
@ihsandemir ihsandemir self-assigned this Jun 21, 2021
@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Windows test PASSed.

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Linux test PASSed.

}

template<typename T>
multi_predicate(const std::string attribute_name, hazelcast_client &client, const std::vector<T> &values) : base_predicate(client) {
Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Collaborator Author

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.

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Collaborator Author

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.

Comment thread hazelcast/include/hazelcast/client/query/predicates.h
@degerhz degerhz changed the title Add the constructor to in_predicate where we can also accept a vector Add the constructor to in_predicate where we can also accept a vector [API-551] Jun 30, 2021
@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Windows test PASSed.

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

Linux test PASSed.

@ihsandemir ihsandemir merged commit a97de79 into hazelcast:master Jun 30, 2021
@ihsandemir ihsandemir deleted the in_predicate_fix branch March 30, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

strange in_predicate behaviour

4 participants