Skip to content

Conversation

oschwald
Copy link
Member

@oschwald oschwald commented Oct 9, 2025

In preparation for a major release.

This also moves the responsibility of reading from the file to the
BufferHolder. This seems to make the responsibilities a bit clearer,
although I also method on the buffers could work.
This introduces some breaking changes due to the accessor method naming
pattern.
I realize this is contentious among some Java programmers, but given
that most people modifying this code will be familiar with this pattern
from other languages (Go, C#, etc.), this seems like an improvement.
@oschwald
Copy link
Member Author

oschwald commented Oct 9, 2025

This is easiest to review commit by commit.

}

for (ByteBuffer buffer : buffers) {
channel.read(buffer);
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably unnecessary, but would we want to have similar checks that we read the expected amount as in the non-test code?

+ this.ipVersion + ", nodeCount=" + this.nodeCount
+ ", recordSize=" + this.recordSize + "]";
long searchTreeSize() {
return nodeCount * nodeByteSize();
Copy link
Contributor

Choose a reason for hiding this comment

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

This was calculated once before and just returned, whereas now we run this (and the above one) every time, right? Is that okay? I think there's a Network method in the same position.

Copy link
Member Author

Choose a reason for hiding this comment

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

The Network method was an intentional compromise. The previous lazy loading had race conditions and it didn't seem that beneficial. This one would probably make sense to calculate only once though.

@horgh horgh merged commit a462282 into main Oct 10, 2025
23 checks passed
@horgh horgh deleted the greg/eng-3200 branch October 10, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants