xichen01 commented on PR #5388: URL: https://github.com/apache/ozone/pull/5388#issuecomment-1745404214
> Thanks @xichen01 for flagging this issue. > > Space usage calculation already has some caching in `CachingSpaceUsageSource`, but it only caches "used space" value, not capacity. If `getCapacity()` is expensive, should we change `CachingSpaceUsageSource` to cache that, too? Caching `capacity` in `CachingSpaceUsageSource` is also a solution to reduce system call, but this may involve cache expiration, can we tolerate a certain amount of inaccuracy in the capacity size (though in general capacity rarely changes)? My current implementation avoids this problem, and it's a relatively simple optimization. And `getCapacity()` is not as expensive as `used space`, but it's also a system call, so I think it's necessary to do some optimization but may not need to be like `used space`, updated asynchronously by a thread. -- 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]
