Skip to content

Conversation

@mdumandag
Copy link
Contributor

Before this, read_many was returning an immutable lazy list of
items read. However, there were more information sent by the server
which we were omitting.

Now, read_many returns an instance of ReadResult, which the user
can get the read count, size, next sequence to read from and
item sequences. Note that, this is not a breaking change. ReadResult
inherits from the ImmutableLazyDataList and hence is a list. So, the
users of this API can use their code as it is without any change when
they upgrade to 4.1. New users might benefit from the new APIs provided.

Also added a filter parameter to read_many, refactored the implementation
and updated some docstrings.

Before this, read_many was returning an immutable lazy list of
items read. However, there were more information sent by the server
which we were omitting.

Now, read_many returns an instance of ReadResult, which the user
can get the read count, size, next sequence to read from and
item sequences. Note that, this is not a breaking change. ReadResult
inherits from the ImmutableLazyDataList and hence is a list. So, the
users of this API can use their code as it is without any change when
they upgrade to 4.1. New users might benefit from the new APIs provided.

Also added a filter parameter to read_many, refactored the implementation
and updated some docstrings.
@mdumandag
Copy link
Contributor Author

Failed because of an unrelated test. The bug behind the failure is fixed in #394.

I will restart tests after getting 394 merged.

@mdumandag
Copy link
Contributor Author

verify

Copy link
Contributor

@srknzl srknzl left a comment

Choose a reason for hiding this comment

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

Left some comments.

Some tests that are missing that I would consider adding:

  1. Some unit tests for start_sequence, min_count and max_count assertions (I could not find any unit test for ringbuffer, maybe we can add them later together with readMany unit test)
  2. readyManyAsync_whenSomeWaitingForSingleItemNeeded
  3. readManyAsync_whenSomeWaitingNeeded
  4. readManyAsync_whenMinZeroAndItemAvailable
  5. readManyAsync_whenMinZeroAndNoItemAvailable
  6. readManyAsync_whenMoreAvailableThanMinimumLessThanMaximum

@mdumandag
Copy link
Contributor Author

@srknzl added some of the tests you mentioned, not all of them because some of them feel unnecessary or already tested. As you said, lets add unit tests later, this is not the main concern of this PR

Copy link
Contributor

@srknzl srknzl left a comment

Choose a reason for hiding this comment

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

LGTM

@mdumandag
Copy link
Contributor Author

verify

@mdumandag mdumandag merged commit 4445166 into hazelcast:master Apr 27, 2021
@mdumandag mdumandag deleted the read-many-improvements branch April 27, 2021 07:30
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.

2 participants