Github user zuyu commented on a diff in the pull request: https://github.com/apache/incubator-quickstep/pull/219#discussion_r107298842 --- Diff: query_execution/QueryContext.cpp --- @@ -58,7 +59,8 @@ QueryContext::QueryContext(const serialization::QueryContext &proto, const CatalogDatabaseLite &database, StorageManager *storage_manager, const tmb::client_id scheduler_client_id, - tmb::MessageBus *bus) { + tmb::MessageBus *bus) + : database_(static_cast<const CatalogDatabase&>(database)) { --- End diff -- Alternatively, `QueryManagerBase` class keeps track of the global memory usage, and `(Rebuild)WorkOrderCompleteMessge` contains the local memory usage for its resource, i.e., a block or a hash table. Thus, `Foreman` or `PolicyEnforcer` could sum up the memory usage in `QueryManageBase`.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---