liuneng1994 commented on code in PR #6558:
URL: https://github.com/apache/incubator-gluten/pull/6558#discussion_r1696433460
##########
cpp-ch/local-engine/Common/QueryContext.cpp:
##########
@@ -15,90 +15,163 @@
* limitations under the License.
*/
#include "QueryContext.h"
+
+#include <format>
+
#include <Interpreters/Context.h>
#include <Parser/SerializedPlanParser.h>
-#include <Common/ConcurrentMap.h>
#include <Common/CurrentThread.h>
#include <Common/ThreadStatus.h>
+#include <Common/CHUtil.h>
+#include <Common/GlutenConfig.h>
+#include <base/unit.h>
+#include <sstream>
+#include <iomanip>
namespace DB
{
namespace ErrorCodes
{
- extern const int LOGICAL_ERROR;
+extern const int LOGICAL_ERROR;
}
}
namespace local_engine
{
using namespace DB;
-thread_local std::shared_ptr<CurrentThread::QueryScope> query_scope;
-thread_local std::shared_ptr<ThreadStatus> thread_status;
-ConcurrentMap<int64_t, NativeAllocatorContextPtr> allocator_map;
-int64_t initializeQuery(ReservationListenerWrapperPtr listener)
+struct QueryContext
+{
+ std::shared_ptr<ThreadStatus> thread_status;
+ std::shared_ptr<ThreadGroup> thread_group;
+ ContextMutablePtr query_context;
+};
+
+std::unordered_map<int64_t, std::shared_ptr<QueryContext>> query_map;
+std::mutex query_map_mutex;
Review Comment:
应该需要,这里会有多个task并发初始化和释放的情况
--
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]