Skip to content

MultiMap for Asyncio#787

Open
yuce wants to merge 6 commits intohazelcast:masterfrom
yuce:asyncio-multimap
Open

MultiMap for Asyncio#787
yuce wants to merge 6 commits intohazelcast:masterfrom
yuce:asyncio-multimap

Conversation

@yuce
Copy link
Copy Markdown
Contributor

@yuce yuce commented Mar 17, 2026

Straightforward port of asyncore MultiMap to asyncio.
Does not include lock-related functions, since they are missing from the asyncio Map as well.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.86127% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.46%. Comparing base (15a9697) to head (dca2092).

Files with missing lines Patch % Lines
hazelcast/internal/asyncio_proxy/multi_map.py 87.42% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #787      +/-   ##
==========================================
- Coverage   94.51%   94.46%   -0.05%     
==========================================
  Files         395      396       +1     
  Lines       25479    25650     +171     
==========================================
+ Hits        24081    24231     +150     
- Misses       1398     1419      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yuce yuce requested a review from emreyigit March 18, 2026 11:29
operation, ``False`` otherwise.
"""
check_not_none(key, "key can't be None")
check_not_none(key, "value can't be None")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this should check the value since key is already checked. The same issue also exists in proxy/multi_map.py.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed at: 3868635

except SchemaNotReplicatedError as e:
return await self._send_schema_and_retry(e, self.remove, key, value)

request = multi_map_remove_entry_codec.encode_request(self.name, key_data, value_data, 0)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thread ids are set to 0 while proxy/multi_map.py uses thead_id(). Is using 0 here valid? If yes, could you please make them constant instead of a magic number?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since asyncio client is not supposed to be accessed from different threads, the thread ID isn't useful. Go Client uses 0 as the default thread ID, and Node.js uses 1. I opted for 0.

Introduced the default_thread_id in 3868635
I'll send another PR fro Map.


Warning:
The list is NOT backed by the multimap, so changes to the map are
list reflected in the collection, and vice-versa.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sentence correct? I know it's from proxy/multi_map.py but same confusion is there as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the typo at: 3868635

It just warns the user that, modifying the returned value will not update the multi-map on the server-side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants