oceanbase
54 строки · 1.6 Кб
1/**
2* Copyright (c) 2021 OceanBase
3* OceanBase CE is licensed under Mulan PubL v2.
4* You can use this software according to the terms and conditions of the Mulan PubL v2.
5* You may obtain a copy of Mulan PubL v2 at:
6* http://license.coscl.org.cn/MulanPubL-2.0
7* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10* See the Mulan PubL v2 for more details.
11*/
12
13#include "ob_rs_event_history_table_operator.h"
14#include "share/config/ob_server_config.h"
15namespace oceanbase
16{
17namespace rootserver
18{
19using namespace common;
20using namespace share;
21
22int ObRsEventHistoryTableOperator::init(common::ObMySQLProxy &proxy,
23const common::ObAddr &self_addr)
24{
25int ret = OB_SUCCESS;
26const bool is_rs_event = true;
27const bool is_server_event = false;
28set_addr(self_addr, is_rs_event, is_server_event);
29if (OB_FAIL(ObEventHistoryTableOperator::init(proxy))) {
30} else {
31set_event_table(share::OB_ALL_ROOTSERVICE_EVENT_HISTORY_TNAME);
32}
33return ret;
34}
35
36ObRsEventHistoryTableOperator &ObRsEventHistoryTableOperator::get_instance()
37{
38static ObRsEventHistoryTableOperator instance;
39return instance;
40}
41
42int ObRsEventHistoryTableOperator::async_delete()
43{
44int ret = OB_SUCCESS;
45if (!is_inited()) {
46ret = OB_NOT_INIT;
47SHARE_LOG(WARN, "not init", KR(ret));
48} else if (OB_FAIL(default_async_delete())) {
49SHARE_LOG(WARN, "failed to default async delete", KR(ret));
50}
51return ret;
52}
53}//end namespace rootserver
54}//end namespace oceanbase
55