[ https://issues.apache.org/jira/browse/CASSANDRA-9989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16596229#comment-16596229 ]
Benedict edited comment on CASSANDRA-9989 at 8/29/18 11:46 AM: --------------------------------------------------------------- Thanks Jay. Unfortunately this breaks the {{isWellFormed}} test, and [I've added a special case|https://github.com/belliottsmith/cassandra/tree/9989] to {{LongBTreeTest}} to check this. In the case of a tree of size 20, we produce a child node that is smaller than {{FAN_FACTOR / 2}}. To avoid this, we need to calculate a mid-point where we decrement the size, which is just a cleaner generalisation of splitting the final two nodes (and instead of two loops, we can have a single conditional move inside the loop, to subtract on the correct child) was (Author: benedict): Thanks Jay. Unfortunately this breaks the {{isWellFormed}} test, and I've added a special case to {{LongBTreeTest}} to check this. In the case of a tree of size 20, we produce a child node that is smaller than {{FAN_FACTOR / 2}}. To avoid this, we need to calculate a mid-point where we decrement the size, which is just a cleaner generalisation of splitting the final two nodes (and instead of two loops, we can have a single conditional move inside the loop, to subtract on the correct child) > Optimise BTree.Buider > --------------------- > > Key: CASSANDRA-9989 > URL: https://issues.apache.org/jira/browse/CASSANDRA-9989 > Project: Cassandra > Issue Type: Sub-task > Reporter: Benedict > Assignee: Jay Zhuang > Priority: Minor > Fix For: 4.x > > Attachments: 9989-trunk.txt > > > BTree.Builder could reduce its copying, and exploit toArray more efficiently, > with some work. It's not very important right now because we don't make as > much use of its bulk-add methods as we otherwise might, however over time > this work will become more useful. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org