Skip to content

Conversation

@JeetKunDoug
Copy link
Contributor

No description provided.

Copy link
Contributor

@yifan-c yifan-c left a comment

Choose a reason for hiding this comment

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

LGTM.
Only have a few cosmetic nits.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if slices.isEmpty(), it would be unnecessary to create iterators from keys and slices, just like the other call-sites of createSlices

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At first blush, I think it's impossible for createSlices to return an empty set of slices for the use-cases we are supporting (at least all unit tests that hit this have at least one slice), which is I'm assuming why Alex left the check off in his original patch. If slices could be empty, we'd end up having a no-key delete, which wouldn't make any sense (although it would also just skip this whole block anyway, so it wouldn't add a delete).

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it looks like to disable read-before-write for the partition, the most suitable value to be supplied is null instead of empty map, which is fine, but just not necessary. org.apache.cassandra.cql3.UpdateParameters#getPrefetchedRow checks whether the field value is null.
I do not know how empty map is used historically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - the empty map has been there since the code was originally written, and it's always essentially been a no-op from what I can see. Not sure if we want to change it in this PR/change though (it adds one extra call to EmptyMap.get, which always returns null, so I don't think it's functionally that big a deal, and if we do want to change it I'd like to keep it separated from the rest of these changes and test it to make sure I'm not missing something.

Copy link
Contributor

Choose a reason for hiding this comment

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

Counter modification statement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup - fixed

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