The allocation occurs in the topic_metadata_item::partitions map while adding a partition to the map in topic_table. The size makes sense: we have ~22,900 partitoins and assuming node hash map is an array of pointer-sized things (highly likely) we have 183K for that many elements: ass...
Firstly, I use a variant of segment tree, allow us to insert element and access elements by indexes. Each node will have two childs: Left[Node] and Right[Node], by default, they are 0 (NULL). To be indexable, we must maintain array Size[]. #include<stdio.h>#include<iostream>#inclu...
First, lookup the element to delete in the index array. When found, replace that element in the vector with the last element in the vector. Update two locations in the bucket array: First remove the bucket for the removed element Then, update the value_idx of the moved element. This ...