Skip to content

Conversation

@jacek-lewandowski
Copy link
Contributor

No description provided.

@jacek-lewandowski jacek-lewandowski changed the title fix ObjectSizes CASSANDRA-17402: Fix ObjectSizes implementation and usages Feb 24, 2022
public static long sizeOfEmptyHeapByteBuffer()
{
return BUFFER_EMPTY_SIZE;
int arrayLen = buffer.array().length;
Copy link
Contributor

Choose a reason for hiding this comment

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

Great idea!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

* @return Total in-memory size of the String
*/
//@TODO hard coding this to 2 isn't necessarily correct in Java 11
// TODO hard coding this to 2 isn't necessarily correct in Java 11
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this TODO comment still valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I didn't change that logic at all

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, the comment is mentioning the hardcoded "2" value, I understand that meaning the 2 bytes that were passed to MemoryLayoutSpecification.sizeOfArray. However, this has changed to send Character.SIZE, which has a value of 16 bits. So we are calling sizeOfArray with the size of a char in bits, when it expects bytes. I guess we should change it to Character.BYTES.

import org.apache.cassandra.db.rows.NativeCell;
import org.apache.cassandra.schema.ColumnMetadata;
import org.apache.cassandra.schema.TableMetadata;
import org.apache.cassandra.utils.ByteBufferUtil;
Copy link
Contributor

@adelapena adelapena Mar 7, 2022

Choose a reason for hiding this comment

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

Nit: unused, can be fixed on commit

@jacek-lewandowski jacek-lewandowski deleted the CASSANDRA-17402-4.0 branch September 13, 2022 07:01
michaeljmarshall pushed a commit to michaeljmarshall/cassandra that referenced this pull request Dec 17, 2025
### What is the issue

These metrics need to be customizable.

### What does this PR fix and why was it fixed

Allow custom implementations via -Dcassandra.custom_internode_outbound_metrics_provider_class
michaelsembwever pushed a commit to thelastpickle/cassandra that referenced this pull request Jan 7, 2026
…he#1470)

These metrics need to be customizable.

Allow custom implementations via -Dcassandra.custom_internode_outbound_metrics_provider_class
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.

4 participants