query_cache_stage.cpp 2.1 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
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 "query_cache_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"

using namespace common;

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

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

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

//! Set properties for this object set in stage specific properties
49 50
bool QueryCacheStage::set_properties()
{
羽飞's avatar
羽飞 已提交
51 52 53 54 55 56 57 58 59 60 61 62
  //  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
63 64
bool QueryCacheStage::initialize()
{
羽飞's avatar
羽飞 已提交
65
  std::list<Stage *>::iterator stgp = next_stage_list_.begin();
66
  parser_stage_ = *(stgp++);
羽飞's avatar
羽飞 已提交
67 68 69 70 71

  return true;
}

//! Cleanup after disconnection
72 73
void QueryCacheStage::cleanup()
{
羽飞's avatar
羽飞 已提交
74 75
}

76 77
void QueryCacheStage::handle_event(StageEvent *event)
{
78
  parser_stage_->handle_event(event);
羽飞's avatar
羽飞 已提交
79 80 81 82

  return;
}

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