oceanbase

Форк
0
/
ob_rs_event_history_table_operator.cpp 
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"
15
namespace oceanbase
16
{
17
namespace rootserver
18
{
19
using namespace common;
20
using namespace share;
21

22
int ObRsEventHistoryTableOperator::init(common::ObMySQLProxy &proxy,
23
                                        const common::ObAddr &self_addr)
24
{
25
  int ret = OB_SUCCESS;
26
  const bool is_rs_event = true;
27
  const bool is_server_event = false;
28
  set_addr(self_addr, is_rs_event, is_server_event);
29
  if (OB_FAIL(ObEventHistoryTableOperator::init(proxy))) {
30
  } else {
31
    set_event_table(share::OB_ALL_ROOTSERVICE_EVENT_HISTORY_TNAME);
32
  }
33
  return ret;
34
}
35

36
ObRsEventHistoryTableOperator &ObRsEventHistoryTableOperator::get_instance()
37
{
38
  static ObRsEventHistoryTableOperator instance;
39
  return instance;
40
}
41

42
int ObRsEventHistoryTableOperator::async_delete()
43
{
44
  int ret = OB_SUCCESS;
45
  if (!is_inited()) {
46
    ret = OB_NOT_INIT;
47
    SHARE_LOG(WARN, "not init", KR(ret));
48
  } else if (OB_FAIL(default_async_delete())) {
49
    SHARE_LOG(WARN, "failed to default async delete", KR(ret));
50
  }
51
  return ret;
52
}
53
}//end namespace rootserver
54
}//end namespace oceanbase
55

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.