From ef43cea5a83249be8262a02502fd9c3585ad0bb1 Mon Sep 17 00:00:00 2001 From: hnwyllmm Date: Fri, 8 Jul 2022 18:29:42 +0800 Subject: [PATCH] add file headers; remove unused files --- src/observer/event/#sql_event.cpp# | 29 ------- src/observer/event/execute_plan_event.cpp.bak | 29 ------- src/observer/event/execute_plan_event.h.bak | 43 ---------- src/observer/event/query_cache_event.h.bak | 42 ---------- src/observer/event/resolve_event.cpp.bak | 23 ------ src/observer/event/resolve_event.h.bak | 35 -------- .../sql/operator/index_scan_operator.cpp | 14 ++++ .../sql/operator/index_scan_operator.h | 14 ++++ .../sql/operator/join_operator.cpp.bak | 82 ------------------- 9 files changed, 28 insertions(+), 283 deletions(-) delete mode 100644 src/observer/event/#sql_event.cpp# delete mode 100644 src/observer/event/execute_plan_event.cpp.bak delete mode 100644 src/observer/event/execute_plan_event.h.bak delete mode 100644 src/observer/event/query_cache_event.h.bak delete mode 100644 src/observer/event/resolve_event.cpp.bak delete mode 100644 src/observer/event/resolve_event.h.bak delete mode 100644 src/observer/sql/operator/join_operator.cpp.bak diff --git a/src/observer/event/#sql_event.cpp# b/src/observer/event/#sql_event.cpp# deleted file mode 100644 index 3b0835d..0000000 --- a/src/observer/event/#sql_event.cpp# +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Longda on 2021/4/14. -// - -#include "event/sql_event.h" -#include "event/session_event.h" - -SQLStageEvent::SQLStageEvent(SessionEvent *event, const std::string &sql) : session_event_(event), sql_(sql) -{} - -SQLStageEvent::~SQLStageEvent() noexcept -{ - if (session_event_ != nullptr) { - session_event_ = nullptr; - // SessionEvent *session_event = session_event_; - // session_event_ = nullptr; - // session_event->doneImmediate(); - } -} diff --git a/src/observer/event/execute_plan_event.cpp.bak b/src/observer/event/execute_plan_event.cpp.bak deleted file mode 100644 index e0c8a7d..0000000 --- a/src/observer/event/execute_plan_event.cpp.bak +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2021/5/11. -// - -#include "event/execution_plan_event.h" -#include "event/sql_event.h" - -ExecutionPlanEvent::ExecutionPlanEvent(SQLStageEvent *sql_event, Query *sqls) : sql_event_(sql_event), sqls_(sqls) -{} -ExecutionPlanEvent::~ExecutionPlanEvent() -{ - sql_event_ = nullptr; - // if (sql_event_) { - // sql_event_->doneImmediate(); - // } - - query_destroy(sqls_); - sqls_ = nullptr; -} diff --git a/src/observer/event/execute_plan_event.h.bak b/src/observer/event/execute_plan_event.h.bak deleted file mode 100644 index 24f8aa5..0000000 --- a/src/observer/event/execute_plan_event.h.bak +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2021/5/11. -// - -#pragma once - -#include "common/seda/stage_event.h" - -class SQLStageEvent; - -class ExecutePlanEvent : public common::StageEvent { -public: - ExecutePlanEvent(SQLStageEvent *sql_event, common::StageEvent *parent_event) - : sql_event_(sql_event), parent_event_(parent_event) - {} - - virtual ~ExecutePlanEvent() = default; - - SQLStageEvent *sql_event() const - { - return sql_event_; - } - - common::StageEvent *parent_event() const { - return parent_event_; - } - -private: - SQLStageEvent *sql_event_ = nullptr; - common::StageEvent *parent_event_ = nullptr; -}; - -#endif // __OBSERVER_EVENT_EXECUTION_PLAN_EVENT_H__ diff --git a/src/observer/event/query_cache_event.h.bak b/src/observer/event/query_cache_event.h.bak deleted file mode 100644 index d2773dd..0000000 --- a/src/observer/event/query_cache_event.h.bak +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2022/5/23. -// - -#pragma once - -#include "common/seda/stage_event.h" - -class SQLStageEvent; -class Stmt; - -class QueryCacheEvent : public common::StageEvent { -public: - QueryCacheEvent(SQLStageEvent *sql_event, common::StageEvent *parent_event) - : sql_event_(sql_event), parent_event_(parent_event) - {} - - virtual ~QueryCacheEvent() noexcept = default; - - SQLStageEvent *sql_event() const { - return sql_event_; - } - - common::StageEvent *parent_event() const { - return parent_event_; - } - -private: - SQLStageEvent *sql_event_ = nullptr; - common::StageEvent *parent_event_ = nullptr; -}; - diff --git a/src/observer/event/resolve_event.cpp.bak b/src/observer/event/resolve_event.cpp.bak deleted file mode 100644 index 78f8680..0000000 --- a/src/observer/event/resolve_event.cpp.bak +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2022/5/23. -// - -#include "event/resolve_event.h" -#include "event/session_event.h" - -ResolveStageEvent(SessionEvent *event) : session_event_(event) -{} - -ResolveStageEvent::~ResolveStageEvent() noexcept -{ -} diff --git a/src/observer/event/resolve_event.h.bak b/src/observer/event/resolve_event.h.bak deleted file mode 100644 index 05e2de0..0000000 --- a/src/observer/event/resolve_event.h.bak +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by Wangyunlai on 2022/5/23. -// - -#pragma once - -#include "common/seda/stage_event.h" - -class SessionEvent; -class Stmt; - -class ResolveStageEvent : public BaseEvent { -public: - ResolveStageEvent(SessionEvent *event); - virtual ~ResolveStageEvent() noexcept; - - SessionEvent *session_event() const - { - return session_event_; - } - -private: - SessionEvent *session_event_ = nullptr; -}; - diff --git a/src/observer/sql/operator/index_scan_operator.cpp b/src/observer/sql/operator/index_scan_operator.cpp index acd0747..1be1a37 100644 --- a/src/observer/sql/operator/index_scan_operator.cpp +++ b/src/observer/sql/operator/index_scan_operator.cpp @@ -1,3 +1,17 @@ +/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. +miniob is licensed under Mulan PSL v2. +You can use this software according to the terms and conditions of the Mulan PSL v2. +You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 +THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +See the Mulan PSL v2 for more details. */ + +// +// Created by Wangyunlai on 2022/07/08. +// + #include "sql/operator/index_scan_operator.h" #include "storage/index/index.h" diff --git a/src/observer/sql/operator/index_scan_operator.h b/src/observer/sql/operator/index_scan_operator.h index 9394006..eedd71f 100644 --- a/src/observer/sql/operator/index_scan_operator.h +++ b/src/observer/sql/operator/index_scan_operator.h @@ -1,3 +1,17 @@ +/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. +miniob is licensed under Mulan PSL v2. +You can use this software according to the terms and conditions of the Mulan PSL v2. +You may obtain a copy of Mulan PSL v2 at: + http://license.coscl.org.cn/MulanPSL2 +THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +See the Mulan PSL v2 for more details. */ + +// +// Created by Wangyunlai on 2022/07/08. +// + #pragma once #include "sql/operator/operator.h" diff --git a/src/observer/sql/operator/join_operator.cpp.bak b/src/observer/sql/operator/join_operator.cpp.bak deleted file mode 100644 index f0f8e63..0000000 --- a/src/observer/sql/operator/join_operator.cpp.bak +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2021 Xie Meiyi(xiemeiyi@hust.edu.cn) and OceanBase and/or its affiliates. All rights reserved. -miniob is licensed under Mulan PSL v2. -You can use this software according to the terms and conditions of the Mulan PSL v2. -You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, -MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. -See the Mulan PSL v2 for more details. */ - -// -// Created by WangYunlai on 2021/6/10. -// - -#include "sql/operator/join_operator.h" - -RC JoinOperator::open() -{ - RC rc = left_->open(); - if (rc != RC::SUCCESS) { - LOG_WARN("failed to open left operator. rc=%d:%s", rc, strrc(rc)); - return rc; - } - - rc = right_->open(); - if (rc != RC::SUCCESS) { - LOG_WARN("failed to open right operator. rc=%d:%s", rc, strrc(rc)); - return rc; - } - return rc; -} - -RC JoinOperator::step_right() -{ - rc = right_->next(); - while (rc == RC::SUCCESS) { - if (predicate_->filter()) { - return rc; - } - - rc = right_->next(); - } - return rc; -} - -RC JoinOperator::next() -{ - RC rc = RC::SUCCESS; - while (true) { - if (round_done_) { - rc = left_->next(); - if (rc != RC::SUCCESS) { - return rc; - } - - round_done_ = false; - - right_->close(); - right_->open(); // TODO - } - - rc = step_right(); - if (rc == RC::SUCCESS) { - return rc; - } - - if (rc == RC::RECORD_EOF) { - round_done_ = true; - } else { - return rc; - } - } - - return RC::RECORD_EOF; -} - -RC JoinOperator::close() -{ - left_->close(); - right_->close(); - return RC::SUCCESS; -} -- GitLab