imply-cheddar commented on issue #12261: URL: https://github.com/apache/druid/issues/12261#issuecomment-1040867884
As gian mentioned, the code is reaching in and grabbing the _gadget as a short-term solution to grab the number of bytes used. It would absolutely be preferable for the UnionSketch to also expose the same `.getCurrentBytes()` method. In terms of the implementation, the sketch that was grabbed is only being used to call `.getCurrentBytes()` and is used for no other purpose. The memory counting structure works with deltas, so if reset was called and the number got smaller, there would then be a negative delta in memory usage and the memory consumption values would be updated accordingly. The intention was always to open a ticket to request that the public API be extended. We wanted to have a concrete example of why we needed the method rather than just asking for a random method, so we wanted the PR to actually exist before doing the request. In the end, the request back to the datasketches got lost in the shuffle of getting the interface changes worked out, so that's our bad. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
