mem_storage_stage.cpp 2.0 KB
Newer Older
羽飞's avatar
羽飞 已提交
1
/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
羽飞's avatar
羽飞 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
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/13.
//

#include <string.h>
#include <string>

#include "mem_storage_stage.h"

#include "common/conf/ini.h"
#include "common/io/io.h"
#include "common/lang/string.h"
#include "common/log/log.h"
#include "common/seda/timer_stage.h"
#include "common/metrics/metrics_registry.h"

using namespace common;

//! Constructor
30 31
MemStorageStage::MemStorageStage(const char *tag) : Stage(tag)
{}
羽飞's avatar
羽飞 已提交
32 33

//! Destructor
34 35
MemStorageStage::~MemStorageStage()
{}
羽飞's avatar
羽飞 已提交
36 37

//! Parse properties, instantiate a stage object
38 39
Stage *MemStorageStage::make_stage(const std::string &tag)
{
羽飞's avatar
羽飞 已提交
40 41 42 43 44 45 46 47 48 49
  MemStorageStage *stage = new (std::nothrow) MemStorageStage(tag.c_str());
  if (stage == nullptr) {
    LOG_ERROR("new MemStorageStage failed");
    return nullptr;
  }
  stage->set_properties();
  return stage;
}

//! Set properties for this object set in stage specific properties
50 51
bool MemStorageStage::set_properties()
{
羽飞's avatar
羽飞 已提交
52 53 54 55 56 57 58 59 60 61 62 63
  //  std::string stageNameStr(stage_name_);
  //  std::map<std::string, std::string> section = g_properties()->get(
  //    stageNameStr);
  //
  //  std::map<std::string, std::string>::iterator it;
  //
  //  std::string key;

  return true;
}

//! Initialize stage params and validate outputs
64 65
bool MemStorageStage::initialize()
{
羽飞's avatar
羽飞 已提交
66 67 68 69
  return true;
}

//! Cleanup after disconnection
70 71
void MemStorageStage::cleanup()
{
羽飞's avatar
羽飞 已提交
72 73
}

74 75
void MemStorageStage::handle_event(StageEvent *event)
{
羽飞's avatar
羽飞 已提交
76 77 78 79 80 81 82
  TimerStat timerStat(*queryMetric);

  event->done_immediate();

  return;
}

83 84
void MemStorageStage::callback_event(StageEvent *event, CallbackContext *context)
{
羽飞's avatar
羽飞 已提交
85 86
  return;
}