Skip to content

[CASSANDRA-21295][trunk] Avoid unit conversion in DatabaseDescriptor.getMaxValueSize() for every deserializing Cell#4745

Open
netudima wants to merge 1 commit intoapache:trunkfrom
netudima:CASSANDRA-21295-trunk
Open

[CASSANDRA-21295][trunk] Avoid unit conversion in DatabaseDescriptor.getMaxValueSize() for every deserializing Cell#4745
netudima wants to merge 1 commit intoapache:trunkfrom
netudima:CASSANDRA-21295-trunk

Conversation

@netudima
Copy link
Copy Markdown
Contributor

Avoid unit conversion in DatabaseDescriptor.getMaxValueSize() for every deserializing Cell

patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-21295

…ry deserializing Cell

patch by Dmitry Konstantinov; reviewed by TBD for CASSANDRA-21295
public IntMebibytesBound(String value)
{
super(value, MEBIBYTES, Integer.MAX_VALUE);
bytes = Ints.saturatedCast(unit().toBytes(quantity()));
Copy link
Copy Markdown
Contributor

@frankgh frankgh Apr 23, 2026

Choose a reason for hiding this comment

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

Should we do the same for other implementations of org.apache.cassandra.config.DataStorageSpec where we are doing Ints.saturatedCast operations?

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.

yes, it makes sense, while I've seen this issue only in the described use case, it may impact other scenarios I've not checked yet too, so I will apply it for other implementations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, also to be consistent across all implementations

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.

2 participants