chaoyli closed pull request #395: Change olap engine to storage engine (#385)
URL: https://github.com/apache/incubator-doris/pull/395
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/be/src/agent/cgroups_mgr.cpp b/be/src/agent/cgroups_mgr.cpp
index 66d76347..4d81fcdc 100644
--- a/be/src/agent/cgroups_mgr.cpp
+++ b/be/src/agent/cgroups_mgr.cpp
@@ -28,7 +28,7 @@
#include "boost/filesystem.hpp"
#include "common/logging.h"
#include "olap/store.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "runtime/exec_env.h"
#include "runtime/load_path_mgr.h"
@@ -188,7 +188,7 @@ AgentStatus CgroupsMgr::_config_disk_throttle(std::string
user_name,
}
// add olap engine data path here
- auto stores = OLAPEngine::get_instance()->get_stores();
+ auto stores = StorageEngine::get_instance()->get_stores();
// buld load data path, it is alreay in data path
// _exec_env->load_path_mgr()->get_load_data_path(&data_paths);
diff --git a/be/src/agent/heartbeat_server.cpp
b/be/src/agent/heartbeat_server.cpp
index e485426e..e4811a55 100644
--- a/be/src/agent/heartbeat_server.cpp
+++ b/be/src/agent/heartbeat_server.cpp
@@ -25,7 +25,7 @@
#include "common/status.h"
#include "gen_cpp/HeartbeatService.h"
#include "gen_cpp/Status_types.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/utils.h"
#include "service/backend_options.h"
#include "util/thrift_server.h"
@@ -41,7 +41,7 @@ namespace doris {
HeartbeatServer::HeartbeatServer(TMasterInfo* master_info) :
_master_info(master_info),
_epoch(0) {
- _olap_engine = OLAPEngine::get_instance();
+ _olap_engine = StorageEngine::get_instance();
}
void HeartbeatServer::init_cluster_id() {
diff --git a/be/src/agent/heartbeat_server.h b/be/src/agent/heartbeat_server.h
index 5b3165dc..3df17f06 100644
--- a/be/src/agent/heartbeat_server.h
+++ b/be/src/agent/heartbeat_server.h
@@ -31,7 +31,7 @@
namespace doris {
const uint32_t HEARTBEAT_INTERVAL = 10;
-class OLAPEngine;
+class StorageEngine;
class Status;
class ThriftServer;
@@ -55,7 +55,7 @@ class HeartbeatServer : public HeartbeatServiceIf {
Status _heartbeat(
const TMasterInfo& master_info);
- OLAPEngine* _olap_engine;
+ StorageEngine* _olap_engine;
// mutex to protect master_info and _epoch
std::mutex _hb_mtx;
diff --git a/be/src/agent/pusher.cpp b/be/src/agent/pusher.cpp
index e56e69b7..a5c911de 100644
--- a/be/src/agent/pusher.cpp
+++ b/be/src/agent/pusher.cpp
@@ -30,7 +30,7 @@
#include "gen_cpp/AgentService_types.h"
#include "olap/olap_common.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/tablet.h"
using std::list;
@@ -40,7 +40,7 @@ using std::vector;
namespace doris {
-Pusher::Pusher(OLAPEngine* engine, const TPushReq& push_req) :
+Pusher::Pusher(StorageEngine* engine, const TPushReq& push_req) :
_push_req(push_req), _engine(engine) {
_download_status = DORIS_SUCCESS;
}
diff --git a/be/src/agent/pusher.h b/be/src/agent/pusher.h
index 9e2979e7..8892edf9 100644
--- a/be/src/agent/pusher.h
+++ b/be/src/agent/pusher.h
@@ -31,11 +31,11 @@ namespace doris {
const uint32_t MAX_RETRY = 3;
const uint32_t DEFAULT_DOWNLOAD_TIMEOUT = 3600;
-class OLAPEngine;
+class StorageEngine;
class Pusher {
public:
- explicit Pusher(OLAPEngine* engine, const TPushReq& push_req);
+ explicit Pusher(StorageEngine* engine, const TPushReq& push_req);
virtual ~Pusher();
// The initial function of pusher
@@ -55,7 +55,7 @@ class Pusher {
bool _is_init = false;
TPushReq _push_req;
FileDownloader::FileDownloaderParam _downloader_param;
- OLAPEngine* _engine;
+ StorageEngine* _engine;
FileDownloader* _file_downloader;
AgentStatus _download_status;
diff --git a/be/src/agent/task_worker_pool.cpp
b/be/src/agent/task_worker_pool.cpp
index 73ff55a1..bd144403 100644
--- a/be/src/agent/task_worker_pool.cpp
+++ b/be/src/agent/task_worker_pool.cpp
@@ -37,7 +37,7 @@
#include "gen_cpp/FrontendService.h"
#include "gen_cpp/Types_types.h"
#include "olap/olap_common.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/tablet.h"
#include "olap/store.h"
#include "olap/utils.h"
@@ -1848,7 +1848,7 @@ void*
TaskWorkerPool::_report_disk_state_worker_thread_callback(void* arg_this)
#ifndef BE_TEST
// wait for notifying until timeout
- OLAPEngine::get_instance()->wait_for_report_notify(
+ StorageEngine::get_instance()->wait_for_report_notify(
config::report_disk_state_interval_seconds, false);
}
#endif
@@ -1885,7 +1885,7 @@ void*
TaskWorkerPool::_report_tablet_worker_thread_callback(void* arg_this) {
report_all_tablets_info_status);
#ifndef BE_TEST
// wait for notifying until timeout
- OLAPEngine::get_instance()->wait_for_report_notify(
+ StorageEngine::get_instance()->wait_for_report_notify(
config::report_tablet_interval_seconds, true);
continue;
#else
@@ -1905,7 +1905,7 @@ void*
TaskWorkerPool::_report_tablet_worker_thread_callback(void* arg_this) {
#ifndef BE_TEST
// wait for notifying until timeout
- OLAPEngine::get_instance()->wait_for_report_notify(
+ StorageEngine::get_instance()->wait_for_report_notify(
config::report_tablet_interval_seconds, true);
}
#endif
diff --git a/be/src/agent/task_worker_pool.h b/be/src/agent/task_worker_pool.h
index 2c96feef..dd19e2a6 100644
--- a/be/src/agent/task_worker_pool.h
+++ b/be/src/agent/task_worker_pool.h
@@ -32,7 +32,7 @@
#include "gen_cpp/AgentService_types.h"
#include "gen_cpp/HeartbeatService_types.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/utils.h"
namespace doris {
diff --git a/be/src/exec/olap_meta_reader.cpp b/be/src/exec/olap_meta_reader.cpp
index 0a3855e3..70ac0bae 100644
--- a/be/src/exec/olap_meta_reader.cpp
+++ b/be/src/exec/olap_meta_reader.cpp
@@ -43,7 +43,7 @@ Status EngineMetaReader::get_hints(
RuntimeProfile* profile) {
auto tablet_id = scan_range->scan_range().tablet_id;
int32_t schema_hash =
strtoul(scan_range->scan_range().schema_hash.c_str(), NULL, 10);
- TabletSharedPtr table = OLAPEngine::get_instance()->get_tablet(
+ TabletSharedPtr table = StorageEngine::get_instance()->get_tablet(
tablet_id, schema_hash);
if (table.get() == NULL) {
LOG(WARNING) << "tablet does not exist. tablet_id=" << tablet_id << ",
schema_hash="
diff --git a/be/src/exec/olap_scan_node.cpp b/be/src/exec/olap_scan_node.cpp
index b0a456d9..b99f2c26 100644
--- a/be/src/exec/olap_scan_node.cpp
+++ b/be/src/exec/olap_scan_node.cpp
@@ -371,7 +371,7 @@ Status OlapScanNode::start_scan(RuntimeState* state) {
RETURN_IF_ERROR(normalize_conjuncts());
VLOG(1) << "BuildOlapFilters";
- // 2. Using ColumnValueRange to Build OlapEngine filters
+ // 2. Using ColumnValueRange to Build StorageEngine filters
RETURN_IF_ERROR(build_olap_filters());
VLOG(1) << "SelectScanRanges";
@@ -383,7 +383,7 @@ Status OlapScanNode::start_scan(RuntimeState* state) {
RETURN_IF_ERROR(build_scan_key());
VLOG(1) << "SplitScanRange";
- // 5. Query OlapEngine to split `Sub ScanRange` to serval `Sub Sub
ScanRange`
+ // 5. Query StorageEngine to split `Sub ScanRange` to serval `Sub Sub
ScanRange`
RETURN_IF_ERROR(split_scan_range());
VLOG(1) << "StartScanThread";
@@ -710,7 +710,7 @@ Status OlapScanNode::normalize_in_predicate(SlotDescriptor*
slot, ColumnValueRan
// 1.3 Push InPredicate value into ColumnValueRange
HybirdSetBase::IteratorBase* iter =
pred->hybird_set()->begin();
while (iter->has_next()) {
- // column in (NULL,...) counldn't push down to OlapEngine
+ // column in (NULL,...) counldn't push down to
StorageEngine
// so that discard whole ColumnValueRange
if (NULL == iter->get_value()) {
range->clear();
diff --git a/be/src/exec/olap_scanner.cpp b/be/src/exec/olap_scanner.cpp
index 13e2425f..2e013c95 100644
--- a/be/src/exec/olap_scanner.cpp
+++ b/be/src/exec/olap_scanner.cpp
@@ -79,7 +79,7 @@ Status OlapScanner::_prepare(
VersionHash version_hash =
strtoul(scan_range->scan_range().version_hash.c_str(), nullptr, 10);
{
- _tablet = OLAPEngine::get_instance()->get_tablet(tablet_id,
schema_hash);
+ _tablet = StorageEngine::get_instance()->get_tablet(tablet_id,
schema_hash);
if (_tablet.get() == nullptr) {
OLAP_LOG_WARNING("tablet does not exist. [tablet_id=%ld
schema_hash=%d]",
tablet_id, schema_hash);
diff --git a/be/src/exec/olap_scanner.h b/be/src/exec/olap_scanner.h
index c9f7c614..b235d02f 100644
--- a/be/src/exec/olap_scanner.h
+++ b/be/src/exec/olap_scanner.h
@@ -37,7 +37,7 @@
#include "olap/delete_handler.h"
#include "olap/column_data.h"
#include "olap/olap_cond.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/reader.h"
namespace doris {
diff --git a/be/src/http/action/checksum_action.cpp
b/be/src/http/action/checksum_action.cpp
index 39721e74..4041d7cd 100644
--- a/be/src/http/action/checksum_action.cpp
+++ b/be/src/http/action/checksum_action.cpp
@@ -30,7 +30,7 @@
#include "http/http_response.h"
#include "http/http_status.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "runtime/exec_env.h"
namespace doris {
diff --git a/be/src/http/action/meta_action.cpp
b/be/src/http/action/meta_action.cpp
index bb2aafae..49fed9c8 100644
--- a/be/src/http/action/meta_action.cpp
+++ b/be/src/http/action/meta_action.cpp
@@ -27,7 +27,7 @@
#include "http/http_status.h"
#include "olap/olap_header_manager.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/olap_define.h"
#include "olap/olap_header.h"
#include "olap/tablet.h"
@@ -49,7 +49,7 @@ Status MetaAction::_handle_header(HttpRequest *req,
std::string* json_header) {
}
uint64_t tablet_id = std::stoull(req_tablet_id);
uint32_t schema_hash = std::stoul(req_schema_hash);
- TabletSharedPtr tablet = OLAPEngine::get_instance()->get_tablet(tablet_id,
schema_hash);
+ TabletSharedPtr tablet =
StorageEngine::get_instance()->get_tablet(tablet_id, schema_hash);
if (tablet == nullptr) {
LOG(WARNING) << "no tablet for tablet_id:" << tablet_id << " schema
hash:" << schema_hash;
return Status("no tablet exist");
diff --git a/be/src/http/action/reload_tablet_action.cpp
b/be/src/http/action/reload_tablet_action.cpp
index c66a5f5c..6fdd3255 100644
--- a/be/src/http/action/reload_tablet_action.cpp
+++ b/be/src/http/action/reload_tablet_action.cpp
@@ -30,7 +30,7 @@
#include "http/http_response.h"
#include "http/http_status.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "runtime/exec_env.h"
namespace doris {
diff --git a/be/src/http/action/restore_tablet_action.cpp
b/be/src/http/action/restore_tablet_action.cpp
index 8cc8f5f1..c1981540 100644
--- a/be/src/http/action/restore_tablet_action.cpp
+++ b/be/src/http/action/restore_tablet_action.cpp
@@ -34,7 +34,7 @@
#include "olap/olap_header.h"
#include "util/json_util.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/store.h"
#include "runtime/exec_env.h"
@@ -85,7 +85,7 @@ Status RestoreTabletAction::_handle(HttpRequest *req) {
LOG(INFO) << "get restore tablet action request: " << tablet_id << "-" <<
schema_hash;
TabletSharedPtr tablet =
- OLAPEngine::get_instance()->get_tablet(tablet_id, schema_hash);
+ StorageEngine::get_instance()->get_tablet(tablet_id, schema_hash);
if (tablet.get() != nullptr) {
LOG(WARNING) << "find tablet. tablet_id=" << tablet_id << "
schema_hash=" << schema_hash;
return Status("tablet already exists, can not restore.");
@@ -177,7 +177,7 @@ Status RestoreTabletAction::_restore(const std::string&
key, int64_t tablet_id,
}
std::string root_path =
OlapStore::get_root_path_from_schema_hash_path_in_trash(latest_tablet_path);
- OlapStore* store = OLAPEngine::get_instance()->get_store(root_path);
+ OlapStore* store = StorageEngine::get_instance()->get_store(root_path);
std::string restore_schema_hash_path =
store->get_tablet_schema_hash_path_from_header(&header);
Status s = FileUtils::create_dir(restore_schema_hash_path);
if (!s.ok()) {
@@ -215,7 +215,7 @@ Status RestoreTabletAction::_restore(const std::string&
key, int64_t tablet_id,
bool RestoreTabletAction::_get_latest_tablet_path_from_trash(
int64_t tablet_id, int32_t schema_hash, std::string* path) {
std::vector<std::string> tablet_paths;
- std::vector<OlapStore*> stores = OLAPEngine::get_instance()->get_stores();
+ std::vector<OlapStore*> stores =
StorageEngine::get_instance()->get_stores();
for (auto& store : stores) {
store->find_tablet_in_trash(tablet_id, &tablet_paths);
}
diff --git a/be/src/http/action/snapshot_action.cpp
b/be/src/http/action/snapshot_action.cpp
index 1b79ea56..0c9d3ac7 100644
--- a/be/src/http/action/snapshot_action.cpp
+++ b/be/src/http/action/snapshot_action.cpp
@@ -32,7 +32,7 @@
#include "http/http_status.h"
#include "runtime/exec_env.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
namespace doris {
diff --git a/be/src/olap/CMakeLists.txt b/be/src/olap/CMakeLists.txt
index c6d09eab..f13fe50c 100644
--- a/be/src/olap/CMakeLists.txt
+++ b/be/src/olap/CMakeLists.txt
@@ -52,7 +52,6 @@ add_library(Olap STATIC
new_status.cpp
null_predicate.cpp
olap_cond.cpp
- olap_engine.cpp
olap_header.cpp
olap_header_manager.cpp
olap_index.cpp
@@ -75,6 +74,7 @@ add_library(Olap STATIC
segment_reader.cpp
segment_writer.cpp
serialize.cpp
+ storage_engine.cpp
store.cpp
stream_index_common.cpp
stream_index_reader.cpp
diff --git a/be/src/olap/base_compaction.cpp b/be/src/olap/base_compaction.cpp
index 1e162b26..fb83e9b6 100644
--- a/be/src/olap/base_compaction.cpp
+++ b/be/src/olap/base_compaction.cpp
@@ -26,7 +26,7 @@
#include "olap/delete_handler.h"
#include "olap/merger.h"
#include "olap/column_data.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/olap_header.h"
#include "olap/segment_group.h"
#include "olap/tablet.h"
@@ -459,7 +459,7 @@ OLAPStatus BaseCompaction::_update_header(uint64_t
row_count, vector<SegmentGrou
void BaseCompaction::_delete_old_files(vector<SegmentGroup*>* unused_indices) {
if (!unused_indices->empty()) {
- OLAPEngine* unused_index = OLAPEngine::get_instance();
+ StorageEngine* unused_index = StorageEngine::get_instance();
for (vector<SegmentGroup*>::iterator it = unused_indices->begin();
it != unused_indices->end(); ++it) {
diff --git a/be/src/olap/cumulative_compaction.cpp
b/be/src/olap/cumulative_compaction.cpp
index b8c69e28..2d56b120 100755
--- a/be/src/olap/cumulative_compaction.cpp
+++ b/be/src/olap/cumulative_compaction.cpp
@@ -21,7 +21,7 @@
#include <list>
#include <vector>
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "util/doris_metrics.h"
using std::list;
@@ -483,7 +483,7 @@ OLAPStatus
CumulativeCompaction::_update_header(vector<SegmentGroup*>* unused_in
void CumulativeCompaction::_delete_unused_delta_files(vector<SegmentGroup*>*
unused_indices) {
if (!unused_indices->empty()) {
- OLAPEngine* unused_index = OLAPEngine::get_instance();
+ StorageEngine* unused_index = StorageEngine::get_instance();
for (vector<SegmentGroup*>::iterator it = unused_indices->begin();
it != unused_indices->end(); ++it) {
diff --git a/be/src/olap/delta_writer.cpp b/be/src/olap/delta_writer.cpp
index be4513a4..68c86344 100644
--- a/be/src/olap/delta_writer.cpp
+++ b/be/src/olap/delta_writer.cpp
@@ -44,24 +44,24 @@ DeltaWriter::~DeltaWriter() {
}
void DeltaWriter::_garbage_collection() {
- OLAPEngine::get_instance()->delete_transaction(_req.partition_id,
_req.transaction_id,
+ StorageEngine::get_instance()->delete_transaction(_req.partition_id,
_req.transaction_id,
_req.tablet_id,
_req.schema_hash);
for (SegmentGroup* segment_group : _segment_group_vec) {
segment_group->release();
- OLAPEngine::get_instance()->add_unused_index(segment_group);
+ StorageEngine::get_instance()->add_unused_index(segment_group);
}
if (_new_tablet != nullptr) {
- OLAPEngine::get_instance()->delete_transaction(_req.partition_id,
_req.transaction_id,
+ StorageEngine::get_instance()->delete_transaction(_req.partition_id,
_req.transaction_id,
_new_tablet->tablet_id(), _new_tablet->schema_hash());
for (SegmentGroup* segment_group : _new_segment_group_vec) {
segment_group->release();
- OLAPEngine::get_instance()->add_unused_index(segment_group);
+ StorageEngine::get_instance()->add_unused_index(segment_group);
}
}
}
OLAPStatus DeltaWriter::init() {
- _tablet = OLAPEngine::get_instance()->get_tablet(_req.tablet_id,
_req.schema_hash);
+ _tablet = StorageEngine::get_instance()->get_tablet(_req.tablet_id,
_req.schema_hash);
if (_tablet == nullptr) {
LOG(WARNING) << "tablet_id: " << _req.tablet_id << ", "
<< "schema_hash: " << _req.schema_hash << " not found";
@@ -70,7 +70,7 @@ OLAPStatus DeltaWriter::init() {
{
MutexLock push_lock(_tablet->get_push_lock());
- RETURN_NOT_OK(OLAPEngine::get_instance()->add_transaction(
+ RETURN_NOT_OK(StorageEngine::get_instance()->add_transaction(
_req.partition_id, _req.transaction_id,
_req.tablet_id, _req.schema_hash, _req.load_id));
//_segment_group_id =
_tablet->current_pending_segment_group_id(_req.transaction_id);
@@ -88,8 +88,8 @@ OLAPStatus DeltaWriter::init() {
<< "new_tablet_id: " << new_tablet_id << ", "
<< "new_schema_hash: " << new_schema_hash << ", "
<< "transaction_id: " << _req.transaction_id;
- _new_tablet =
OLAPEngine::get_instance()->get_tablet(new_tablet_id, new_schema_hash);
- OLAPEngine::get_instance()->add_transaction(
+ _new_tablet =
StorageEngine::get_instance()->get_tablet(new_tablet_id, new_schema_hash);
+ StorageEngine::get_instance()->add_transaction(
_req.partition_id, _req.transaction_id,
new_tablet_id, new_schema_hash,
_req.load_id);
}
diff --git a/be/src/olap/delta_writer.h b/be/src/olap/delta_writer.h
index 6f6baa3d..ee849f17 100644
--- a/be/src/olap/delta_writer.h
+++ b/be/src/olap/delta_writer.h
@@ -19,7 +19,7 @@
#define DORIS_BE_SRC_DELTA_WRITER_H
#include "olap/memtable.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/tablet.h"
#include "olap/schema_change.h"
#include "olap/data_writer.h"
diff --git a/be/src/olap/olap_define.h b/be/src/olap/olap_define.h
index 5782a2d5..63a9b87a 100644
--- a/be/src/olap/olap_define.h
+++ b/be/src/olap/olap_define.h
@@ -178,7 +178,7 @@ enum OLAPStatus {
OLAP_ERR_TABLE_INDEX_FIND_ERROR = -403,
OLAP_ERR_TABLE_CREATE_FROM_HEADER_ERROR = -404,
- // OLAPEngine
+ // StorageEngine
// [-500, -600)
OLAP_ERR_ENGINE_INSERT_EXISTS_TABLE = -500,
OLAP_ERR_ENGINE_DROP_NOEXISTS_TABLE = -501,
diff --git a/be/src/olap/olap_header_manager.cpp
b/be/src/olap/olap_header_manager.cpp
index 9bd04dca..61058462 100755
--- a/be/src/olap/olap_header_manager.cpp
+++ b/be/src/olap/olap_header_manager.cpp
@@ -24,7 +24,7 @@
#include <boost/algorithm/string/trim.hpp>
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/olap_meta.h"
#include "common/logging.h"
#include "json2pb/json_to_pb.h"
diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp
index 2c173057..bd30bb66 100644
--- a/be/src/olap/olap_server.cpp
+++ b/be/src/olap/olap_server.cpp
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include <sys/socket.h>
#include <unistd.h>
@@ -29,7 +29,7 @@
#include "olap/cumulative_compaction.h"
#include "olap/olap_common.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "agent/cgroups_mgr.h"
using std::string;
@@ -39,7 +39,7 @@ namespace doris {
// number of running SCHEMA-CHANGE threads
volatile uint32_t g_schema_change_active_threads = 0;
-OLAPStatus OLAPEngine::_start_bg_worker() {
+OLAPStatus StorageEngine::_start_bg_worker() {
// start thread for monitoring the snapshot and trash folder
_garbage_sweeper_thread = std::thread(
[this] {
@@ -86,7 +86,7 @@ OLAPStatus OLAPEngine::_start_bg_worker() {
return OLAP_SUCCESS;
}
-void* OLAPEngine::_fd_cache_clean_callback(void* arg) {
+void* StorageEngine::_fd_cache_clean_callback(void* arg) {
#ifdef GOOGLE_PROFILER
ProfilerRegisterThread();
#endif
@@ -104,7 +104,7 @@ void* OLAPEngine::_fd_cache_clean_callback(void* arg) {
return NULL;
}
-void* OLAPEngine::_base_compaction_thread_callback(void* arg) {
+void* StorageEngine::_base_compaction_thread_callback(void* arg) {
#ifdef GOOGLE_PROFILER
ProfilerRegisterThread();
#endif
@@ -130,7 +130,7 @@ void* OLAPEngine::_base_compaction_thread_callback(void*
arg) {
return NULL;
}
-void* OLAPEngine::_garbage_sweeper_thread_callback(void* arg) {
+void* StorageEngine::_garbage_sweeper_thread_callback(void* arg) {
#ifdef GOOGLE_PROFILER
ProfilerRegisterThread();
#endif
@@ -176,7 +176,7 @@ void* OLAPEngine::_garbage_sweeper_thread_callback(void*
arg) {
return NULL;
}
-void* OLAPEngine::_disk_stat_monitor_thread_callback(void* arg) {
+void* StorageEngine::_disk_stat_monitor_thread_callback(void* arg) {
#ifdef GOOGLE_PROFILER
ProfilerRegisterThread();
#endif
@@ -197,7 +197,7 @@ void* OLAPEngine::_disk_stat_monitor_thread_callback(void*
arg) {
return NULL;
}
-void* OLAPEngine::_unused_index_thread_callback(void* arg) {
+void* StorageEngine::_unused_index_thread_callback(void* arg) {
#ifdef GOOGLE_PROFILER
ProfilerRegisterThread();
#endif
@@ -218,7 +218,7 @@ void* OLAPEngine::_unused_index_thread_callback(void* arg) {
return NULL;
}
-void* OLAPEngine::_cumulative_compaction_thread_callback(void* arg) {
+void* StorageEngine::_cumulative_compaction_thread_callback(void* arg) {
#ifdef GOOGLE_PROFILER
ProfilerRegisterThread();
#endif
diff --git a/be/src/olap/olap_snapshot.cpp b/be/src/olap/olap_snapshot.cpp
index 9421bcae..c1de1b07 100644
--- a/be/src/olap/olap_snapshot.cpp
+++ b/be/src/olap/olap_snapshot.cpp
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include <ctype.h>
#include <errno.h>
@@ -56,7 +56,7 @@ using std::list;
namespace doris {
-OLAPStatus OLAPEngine::make_snapshot(
+OLAPStatus StorageEngine::make_snapshot(
const TSnapshotRequest& request,
string* snapshot_path) {
OLAPStatus res = OLAP_SUCCESS;
@@ -90,7 +90,7 @@ OLAPStatus OLAPEngine::make_snapshot(
return res;
}
-OLAPStatus OLAPEngine::release_snapshot(const string& snapshot_path) {
+OLAPStatus StorageEngine::release_snapshot(const string& snapshot_path) {
// 如果请求的snapshot_path位于root/snapshot文件夹下,则认为是合法的,可以删除
// 否则认为是非法请求,返回错误结果
auto stores = get_stores();
@@ -112,7 +112,7 @@ OLAPStatus OLAPEngine::release_snapshot(const string&
snapshot_path) {
return OLAP_ERR_CE_CMD_PARAMS_ERROR;
}
-OLAPStatus OLAPEngine::_calc_snapshot_id_path(
+OLAPStatus StorageEngine::_calc_snapshot_id_path(
const TabletSharedPtr& tablet,
string* out_path) {
OLAPStatus res = OLAP_SUCCESS;
@@ -137,7 +137,7 @@ OLAPStatus OLAPEngine::_calc_snapshot_id_path(
return res;
}
-string OLAPEngine::_get_schema_hash_full_path(
+string StorageEngine::_get_schema_hash_full_path(
const TabletSharedPtr& ref_tablet,
const string& location) const {
stringstream schema_full_path_stream;
@@ -149,7 +149,7 @@ string OLAPEngine::_get_schema_hash_full_path(
return schema_full_path;
}
-string OLAPEngine::_get_header_full_path(
+string StorageEngine::_get_header_full_path(
const TabletSharedPtr& ref_tablet,
const std::string& schema_hash_path) const {
stringstream header_name_stream;
@@ -157,7 +157,7 @@ string OLAPEngine::_get_header_full_path(
return header_name_stream.str();
}
-void OLAPEngine::_update_header_file_info(
+void StorageEngine::_update_header_file_info(
const vector<VersionEntity>& shortest_versions,
OLAPHeader* header) {
// clear schema_change_status
@@ -181,7 +181,7 @@ void OLAPEngine::_update_header_file_info(
}
}
-OLAPStatus OLAPEngine::_link_index_and_data_files(
+OLAPStatus StorageEngine::_link_index_and_data_files(
const string& schema_hash_path,
const TabletSharedPtr& ref_tablet,
const vector<VersionEntity>& version_entity_vec) {
@@ -227,7 +227,7 @@ OLAPStatus OLAPEngine::_link_index_and_data_files(
return res;
}
-OLAPStatus OLAPEngine::_copy_index_and_data_files(
+OLAPStatus StorageEngine::_copy_index_and_data_files(
const string& schema_hash_path,
const TabletSharedPtr& ref_tablet,
vector<VersionEntity>& version_entity_vec) {
@@ -270,7 +270,7 @@ OLAPStatus OLAPEngine::_copy_index_and_data_files(
return OLAP_SUCCESS;
}
-OLAPStatus OLAPEngine::_create_snapshot_files(
+OLAPStatus StorageEngine::_create_snapshot_files(
const TabletSharedPtr& ref_tablet,
const TSnapshotRequest& request,
string* snapshot_path) {
@@ -442,7 +442,7 @@ OLAPStatus OLAPEngine::_create_snapshot_files(
return res;
}
-OLAPStatus OLAPEngine::_create_incremental_snapshot_files(
+OLAPStatus StorageEngine::_create_incremental_snapshot_files(
const TabletSharedPtr& ref_tablet,
const TSnapshotRequest& request,
string* snapshot_path) {
@@ -556,7 +556,7 @@ OLAPStatus OLAPEngine::_create_incremental_snapshot_files(
return res;
}
-OLAPStatus OLAPEngine::_append_single_delta(
+OLAPStatus StorageEngine::_append_single_delta(
const TSnapshotRequest& request, OlapStore* store) {
OLAPStatus res = OLAP_SUCCESS;
string root_path = store->path();
@@ -609,7 +609,7 @@ OLAPStatus OLAPEngine::_append_single_delta(
return res;
}
-string OLAPEngine::_construct_index_file_path(
+string StorageEngine::_construct_index_file_path(
const string& tablet_path_prefix,
const Version& version,
VersionHash version_hash,
@@ -617,7 +617,7 @@ string OLAPEngine::_construct_index_file_path(
return Tablet::construct_file_path(tablet_path_prefix, version,
version_hash, segment_group_id, segment, "idx");
}
-string OLAPEngine::_construct_data_file_path(
+string StorageEngine::_construct_data_file_path(
const string& tablet_path_prefix,
const Version& version,
VersionHash version_hash,
@@ -625,7 +625,7 @@ string OLAPEngine::_construct_data_file_path(
return Tablet::construct_file_path(tablet_path_prefix, version,
version_hash, segment_group_id, segment, "dat");
}
-OLAPStatus OLAPEngine::_create_hard_link(const string& from_path, const
string& to_path) {
+OLAPStatus StorageEngine::_create_hard_link(const string& from_path, const
string& to_path) {
if (link(from_path.c_str(), to_path.c_str()) == 0) {
VLOG(10) << "success to create hard link from_path=" << from_path
<< ", to_path=" << to_path;
@@ -637,7 +637,7 @@ OLAPStatus OLAPEngine::_create_hard_link(const string&
from_path, const string&
}
}
-OLAPStatus OLAPEngine::storage_medium_migrate(
+OLAPStatus StorageEngine::storage_medium_migrate(
TTabletId tablet_id, TSchemaHash schema_hash,
TStorageMedium::type storage_medium) {
LOG(INFO) << "begin to process storage media migrate. "
@@ -740,7 +740,7 @@ OLAPStatus OLAPEngine::storage_medium_migrate(
break;
}
- // load the new tablet into OLAPEngine
+ // load the new tablet into StorageEngine
auto tablet = Tablet::create_from_header(new_olap_header, stores[0]);
if (tablet == NULL) {
OLAP_LOG_WARNING("failed to create from header");
@@ -749,7 +749,7 @@ OLAPStatus OLAPEngine::storage_medium_migrate(
}
res = add_tablet(tablet_id, schema_hash, tablet);
if (res != OLAP_SUCCESS) {
- OLAP_LOG_WARNING("fail to add tablet to OLAPEngine. [res=%d]",
res);
+ OLAP_LOG_WARNING("fail to add tablet to StorageEngine. [res=%d]",
res);
break;
}
@@ -779,7 +779,7 @@ OLAPStatus OLAPEngine::storage_medium_migrate(
return res;
}
-OLAPStatus OLAPEngine::_generate_new_header(
+OLAPStatus StorageEngine::_generate_new_header(
OlapStore* store,
const uint64_t new_shard,
const TabletSharedPtr& tablet,
@@ -791,7 +791,7 @@ OLAPStatus OLAPEngine::_generate_new_header(
OLAPStatus res = OLAP_SUCCESS;
OlapStore* ref_store =
-
OLAPEngine::get_instance()->get_store(tablet->storage_root_path_name());
+
StorageEngine::get_instance()->get_store(tablet->storage_root_path_name());
OlapHeaderManager::get_header(ref_store, tablet->tablet_id(),
tablet->schema_hash(), new_olap_header);
_update_header_file_info(version_entity_vec, new_olap_header);
new_olap_header->set_shard(new_shard);
diff --git a/be/src/olap/push_handler.cpp b/be/src/olap/push_handler.cpp
index bde06143..26b060c0 100644
--- a/be/src/olap/push_handler.cpp
+++ b/be/src/olap/push_handler.cpp
@@ -23,7 +23,7 @@
#include <boost/filesystem.hpp>
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/tablet.h"
#include "olap/schema_change.h"
@@ -64,7 +64,7 @@ OLAPStatus PushHandler::process_realtime_push(
PUniqueId load_id;
load_id.set_hi(0);
load_id.set_lo(0);
- res = OLAPEngine::get_instance()->add_transaction(
+ res = StorageEngine::get_instance()->add_transaction(
request.partition_id, request.transaction_id,
tablet->tablet_id(), tablet->schema_hash(), load_id);
@@ -101,7 +101,7 @@ OLAPStatus PushHandler::process_realtime_push(
<< ", related_tablet_id=" << related_tablet_id
<< ", related_schema_hash=" << related_schema_hash
<< ", transaction_id=" << request.transaction_id;
- TabletSharedPtr related_tablet =
OLAPEngine::get_instance()->get_tablet(
+ TabletSharedPtr related_tablet =
StorageEngine::get_instance()->get_tablet(
related_tablet_id, related_schema_hash);
// if related tablet not exists, only push current tablet
@@ -123,7 +123,7 @@ OLAPStatus PushHandler::process_realtime_push(
PUniqueId load_id;
load_id.set_hi(0);
load_id.set_lo(0);
- res = OLAPEngine::get_instance()->add_transaction(
+ res = StorageEngine::get_instance()->add_transaction(
request.partition_id, request.transaction_id,
related_tablet->tablet_id(),
related_tablet->schema_hash(), load_id);
@@ -243,14 +243,14 @@ OLAPStatus PushHandler::process_realtime_push(
continue;
}
- OLAPEngine::get_instance()->delete_transaction(
+ StorageEngine::get_instance()->delete_transaction(
request.partition_id, request.transaction_id,
tablet_var.tablet->tablet_id(),
tablet_var.tablet->schema_hash());
// actually, olap_index may has been deleted in
delete_transaction()
for (SegmentGroup* segment_group : tablet_var.added_indices) {
segment_group->release();
- OLAPEngine::get_instance()->add_unused_index(segment_group);
+ StorageEngine::get_instance()->add_unused_index(segment_group);
}
}
}
@@ -269,7 +269,7 @@ void PushHandler::_get_tablet_infos(
TTabletInfo tablet_info;
tablet_info.tablet_id = tablet_var.tablet->tablet_id();
tablet_info.schema_hash = tablet_var.tablet->schema_hash();
- OLAPEngine::get_instance()->report_tablet_info(&tablet_info);
+ StorageEngine::get_instance()->report_tablet_info(&tablet_info);
tablet_info_vec->push_back(tablet_info);
}
}
diff --git a/be/src/olap/schema_change.cpp b/be/src/olap/schema_change.cpp
index 181c07cf..d9ecb49d 100644
--- a/be/src/olap/schema_change.cpp
+++ b/be/src/olap/schema_change.cpp
@@ -26,7 +26,7 @@
#include "olap/column_data.h"
#include "olap/merger.h"
#include "olap/column_data.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/tablet.h"
#include "olap/row_block.h"
#include "olap/row_cursor.h"
@@ -1226,7 +1226,7 @@ OLAPStatus
SchemaChangeHandler::clear_schema_change_single_info(
AlterTabletType* alter_tablet_type,
bool only_one,
bool check_only) {
- TabletSharedPtr tablet = OLAPEngine::get_instance()->get_tablet(tablet_id,
schema_hash);
+ TabletSharedPtr tablet =
StorageEngine::get_instance()->get_tablet(tablet_id, schema_hash);
return clear_schema_change_single_info(tablet, alter_tablet_type,
only_one, check_only);
}
@@ -1317,7 +1317,7 @@ OLAPStatus
SchemaChangeHandler::_check_and_clear_schema_change_info(
}
// clear schema change info of related tablet
- TabletSharedPtr related_tablet = OLAPEngine::get_instance()->get_tablet(
+ TabletSharedPtr related_tablet = StorageEngine::get_instance()->get_tablet(
tablet_id, schema_hash);
if (related_tablet.get() == NULL) {
OLAP_LOG_WARNING("get null tablet! [tablet_id=%ld schema_hash=%d]",
@@ -1353,19 +1353,19 @@ OLAPStatus SchemaChangeHandler::process_alter_tablet(
LOG(INFO) << "begin to validate alter tablet request.";
// 1. Lock schema_change_lock util schema change info is stored in tablet
header
- if
(!OLAPEngine::get_instance()->try_schema_change_lock(request.base_tablet_id)) {
+ if
(!StorageEngine::get_instance()->try_schema_change_lock(request.base_tablet_id))
{
OLAP_LOG_WARNING("failed to obtain schema change lock. [res=%d
tablet=%ld]",
res, request.base_tablet_id);
return OLAP_ERR_TRY_LOCK_FAILED;
}
// 2. Get base tablet
- TabletSharedPtr ref_tablet = OLAPEngine::get_instance()->get_tablet(
+ TabletSharedPtr ref_tablet = StorageEngine::get_instance()->get_tablet(
request.base_tablet_id, request.base_schema_hash);
if (ref_tablet.get() == NULL) {
OLAP_LOG_WARNING("fail to find base tablet. [base_tablet=%ld
base_schema_hash=%d]",
request.base_tablet_id, request.base_schema_hash);
-
OLAPEngine::get_instance()->release_schema_change_lock(request.base_tablet_id);
+
StorageEngine::get_instance()->release_schema_change_lock(request.base_tablet_id);
return OLAP_ERR_TABLE_NOT_FOUND;
}
@@ -1375,12 +1375,12 @@ OLAPStatus SchemaChangeHandler::process_alter_tablet(
if (res != OLAP_SUCCESS) {
OLAP_LOG_WARNING("failed to check and clear schema change info.
[tablet='%s']",
ref_tablet->full_name().c_str());
-
OLAPEngine::get_instance()->release_schema_change_lock(request.base_tablet_id);
+
StorageEngine::get_instance()->release_schema_change_lock(request.base_tablet_id);
return res;
}
- // 4. return failed if new tablet already exist in OLAPEngine.
- TabletSharedPtr new_tablet = OLAPEngine::get_instance()->get_tablet(
+ // 4. return failed if new tablet already exist in StorageEngine.
+ TabletSharedPtr new_tablet = StorageEngine::get_instance()->get_tablet(
request.new_tablet_req.tablet_id,
request.new_tablet_req.tablet_schema.schema_hash);
if (new_tablet.get() != NULL) {
res = OLAP_SUCCESS;
@@ -1388,7 +1388,7 @@ OLAPStatus SchemaChangeHandler::process_alter_tablet(
res = _do_alter_tablet(type, ref_tablet, request);
}
-
OLAPEngine::get_instance()->release_schema_change_lock(request.base_tablet_id);
+
StorageEngine::get_instance()->release_schema_change_lock(request.base_tablet_id);
return res;
}
@@ -1402,7 +1402,7 @@ OLAPStatus SchemaChangeHandler::_do_alter_tablet(
string base_root_path = ref_tablet->storage_root_path_name();
LOG(INFO) << "begin to do alter tablet job. new_tablet_id=" <<
request.new_tablet_req.tablet_id;
- // 1. Create new tablet and register into OLAPEngine
+ // 1. Create new tablet and register into StorageEngine
res = _create_new_tablet(ref_tablet,
request.new_tablet_req,
&base_root_path,
@@ -1428,7 +1428,7 @@ OLAPStatus SchemaChangeHandler::_do_alter_tablet(
"[base=%s new=%s res=%d]",
ref_tablet->full_name().c_str(),
new_tablet->full_name().c_str(), res);
ref_tablet->release_push_lock();
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
new_tablet->tablet_id(), new_tablet->schema_hash());
return res;
}
@@ -1436,7 +1436,7 @@ OLAPStatus SchemaChangeHandler::_do_alter_tablet(
// get current transactions
int64_t partition_id;
std::set<int64_t> transaction_ids;
- OLAPEngine::get_instance()->
+ StorageEngine::get_instance()->
get_transactions_by_tablet(ref_tablet, &partition_id,
&transaction_ids);
ref_tablet->release_push_lock();
@@ -1455,7 +1455,7 @@ OLAPStatus SchemaChangeHandler::_do_alter_tablet(
// erase finished transaction
vector<int64_t> finished_transactions;
for (int64_t transaction_id : transaction_ids) {
- if (!OLAPEngine::get_instance()->has_transaction(
+ if (!StorageEngine::get_instance()->has_transaction(
partition_id, transaction_id,
ref_tablet->tablet_id(), ref_tablet->schema_hash())) {
finished_transactions.push_back(transaction_id);
@@ -1520,7 +1520,7 @@ OLAPStatus SchemaChangeHandler::_do_alter_tablet(
new_tablet->release_header_lock();
ref_tablet->release_header_lock();
ref_tablet->release_push_lock();
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
new_tablet->tablet_id(), new_tablet->schema_hash());
OLAP_LOG_WARNING("fail to remove data from new tablet when
schema_change. "
"[new_tablet=%s]",
new_tablet->full_name().c_str());
@@ -1623,7 +1623,7 @@ OLAPStatus SchemaChangeHandler::_do_alter_tablet(
<< "request=" << sc_params.debug_message;
} else {
// Delete tablet when submit alter tablet failed.
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
new_tablet->tablet_id(), new_tablet->schema_hash());
}
@@ -1646,7 +1646,7 @@ OLAPStatus SchemaChangeHandler::_create_new_tablet(
do {
// 2. Create tablet with only header, no deltas
- TabletSharedPtr new_tablet = OLAPEngine::get_instance()->create_tablet(
+ TabletSharedPtr new_tablet =
StorageEngine::get_instance()->create_tablet(
request, ref_root_path, true, ref_tablet);
if (new_tablet == NULL) {
OLAP_LOG_WARNING("failed to create tablet. [tablet=%ld
xml_path=%d]",
@@ -1672,13 +1672,13 @@ OLAPStatus SchemaChangeHandler::_create_new_tablet(
new_tablet->set_creation_time(new_creation_time);
}
- // 3. Add tablet to OlapEngine will make it visiable to user
- res = OLAPEngine::get_instance()->add_tablet(
+ // 3. Add tablet to StorageEngine will make it visiable to user
+ res = StorageEngine::get_instance()->add_tablet(
request.tablet_id,
request.tablet_schema.schema_hash,
new_tablet);
if (res != OLAP_SUCCESS) {
- OLAP_LOG_WARNING("failed to add tablet to OLAPEngine. [res=%d
tablet='%s']",
+ OLAP_LOG_WARNING("failed to add tablet to StorageEngine. [res=%d
tablet='%s']",
res, new_tablet->full_name().c_str());
break;
}
@@ -1687,7 +1687,7 @@ OLAPStatus SchemaChangeHandler::_create_new_tablet(
// 4. Register tablet into OLAPRootPath, so that we can manage tablet
from
// the perspective of root path.
// Example: unregister all tables when a bad disk found.
- res = OLAPEngine::get_instance()->register_tablet_into_root_path(
+ res = StorageEngine::get_instance()->register_tablet_into_root_path(
new_tablet.get());
if (res != OLAP_SUCCESS) {
OLAP_LOG_WARNING("fail to register tablet into root path. "
@@ -1698,10 +1698,10 @@ OLAPStatus SchemaChangeHandler::_create_new_tablet(
}
TabletSharedPtr tablet;
- tablet = OLAPEngine::get_instance()->get_tablet(
+ tablet = StorageEngine::get_instance()->get_tablet(
request.tablet_id, request.tablet_schema.schema_hash);
if (tablet.get() == NULL) {
- OLAP_LOG_WARNING("failed to get tablet from OLAPEngine.
[tablet=%ld schema_hash=%d]",
+ OLAP_LOG_WARNING("failed to get tablet from StorageEngine.
[tablet=%ld schema_hash=%d]",
request.tablet_id,
request.tablet_schema.schema_hash);
res = OLAP_ERR_OTHER_ERROR;
@@ -1715,7 +1715,7 @@ OLAPStatus SchemaChangeHandler::_create_new_tablet(
if (res != OLAP_SUCCESS) {
if (is_tablet_added) {
- res = OLAPEngine::get_instance()->drop_tablet(
+ res = StorageEngine::get_instance()->drop_tablet(
request.tablet_id, request.tablet_schema.schema_hash);
if (res != OLAP_SUCCESS) {
LOG(WARNING) << "fail to drop tablet when create tablet
failed. res=" << res
@@ -1908,7 +1908,7 @@ OLAPStatus SchemaChangeHandler::_save_schema_change_info(
// check new tablet exists,
// prevent to set base's status after new's dropping (clear base's status)
- if (OLAPEngine::get_instance()->get_tablet(
+ if (StorageEngine::get_instance()->get_tablet(
new_tablet->tablet_id(), new_tablet->schema_hash()).get() == NULL)
{
OLAP_LOG_WARNING("fail to find tablet before saving status.
[tablet='%s']",
new_tablet->full_name().c_str());
@@ -2382,7 +2382,7 @@ OLAPStatus SchemaChange::create_init_version(
}
// Get tablet and generate new index
- tablet = OLAPEngine::get_instance()->get_tablet(tablet_id,
schema_hash);
+ tablet = StorageEngine::get_instance()->get_tablet(tablet_id,
schema_hash);
if (tablet.get() == NULL) {
OLAP_LOG_WARNING("fail to find tablet. [tablet=%ld]", tablet_id);
res = OLAP_ERR_TABLE_NOT_FOUND;
diff --git a/be/src/olap/schema_change.h b/be/src/olap/schema_change.h
index 9c8fa847..03f6ca66 100644
--- a/be/src/olap/schema_change.h
+++ b/be/src/olap/schema_change.h
@@ -325,7 +325,7 @@ class SchemaChangeHandler {
mutable std::string group;
};
- // 根据给定的table_desc,创建Tablet,并挂接到OLAPEngine中
+ // 根据给定的table_desc,创建Tablet,并挂接到StorageEngine中
OLAPStatus _create_new_tablet(const TabletSharedPtr ref_tablet,
const TCreateTabletReq&
create_tablet_req,
const std::string* ref_root_path,
diff --git a/be/src/olap/segment_reader.cpp b/be/src/olap/segment_reader.cpp
index f0c1db32..6ae5744c 100644
--- a/be/src/olap/segment_reader.cpp
+++ b/be/src/olap/segment_reader.cpp
@@ -69,7 +69,7 @@ SegmentReader::SegmentReader(
_runtime_state(runtime_state),
_shared_buffer(NULL),
_stats(stats) {
- _lru_cache = OLAPEngine::get_instance()->index_stream_lru_cache();
+ _lru_cache = StorageEngine::get_instance()->index_stream_lru_cache();
_tracker.reset(new MemTracker(-1));
_mem_pool.reset(new MemPool(_tracker.get()));
}
diff --git a/be/src/olap/segment_reader.h b/be/src/olap/segment_reader.h
index 14b6e45b..03db6ddb 100644
--- a/be/src/olap/segment_reader.h
+++ b/be/src/olap/segment_reader.h
@@ -36,7 +36,7 @@
#include "olap/lru_cache.h"
#include "olap/olap_cond.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/tablet.h"
#include "olap/row_cursor.h"
#include "runtime/runtime_state.h"
diff --git a/be/src/olap/olap_engine.cpp b/be/src/olap/storage_engine.cpp
similarity index 94%
rename from be/src/olap/olap_engine.cpp
rename to be/src/olap/storage_engine.cpp
index dbb8541b..55031ff4 100644
--- a/be/src/olap/olap_engine.cpp
+++ b/be/src/olap/storage_engine.cpp
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include <signal.h>
@@ -70,7 +70,7 @@ using std::vector;
namespace doris {
-OLAPEngine* OLAPEngine::_s_instance = nullptr;
+StorageEngine* StorageEngine::_s_instance = nullptr;
const std::string HTTP_REQUEST_PREFIX = "/api/_tablet/_download?";
const std::string HTTP_REQUEST_TOKEN_PARAM = "token=";
const std::string HTTP_REQUEST_FILE_PARAM = "&file=";
@@ -89,9 +89,9 @@ static Status _validate_options(const EngineOptions& options)
{
return Status::OK;
}
-Status OLAPEngine::open(const EngineOptions& options, OLAPEngine** engine_ptr)
{
+Status StorageEngine::open(const EngineOptions& options, StorageEngine**
engine_ptr) {
RETURN_IF_ERROR(_validate_options(options));
- std::unique_ptr<OLAPEngine> engine(new OLAPEngine(options));
+ std::unique_ptr<StorageEngine> engine(new StorageEngine(options));
auto st = engine->open();
if (st != OLAP_SUCCESS) {
LOG(WARNING) << "engine open failed, res=" << st;
@@ -106,7 +106,7 @@ Status OLAPEngine::open(const EngineOptions& options,
OLAPEngine** engine_ptr) {
return Status::OK;
}
-OLAPEngine::OLAPEngine(const EngineOptions& options)
+StorageEngine::StorageEngine(const EngineOptions& options)
: _options(options),
_available_storage_medium_type_count(0),
_effective_cluster_id(-1),
@@ -123,11 +123,11 @@ OLAPEngine::OLAPEngine(const EngineOptions& options)
}
}
-OLAPEngine::~OLAPEngine() {
+StorageEngine::~StorageEngine() {
clear();
}
-OLAPStatus OLAPEngine::_load_store(OlapStore* store) {
+OLAPStatus StorageEngine::_load_store(OlapStore* store) {
std::string store_path = store->path();
LOG(INFO) <<"start to load tablets from store_path:" << store_path;
@@ -200,7 +200,7 @@ OLAPStatus OLAPEngine::_load_store(OlapStore* store) {
return res;
}
-OLAPStatus OLAPEngine::load_one_tablet(
+OLAPStatus StorageEngine::load_one_tablet(
OlapStore* store, TTabletId tablet_id, SchemaHash schema_hash,
const string& schema_hash_path, bool force) {
stringstream header_name_stream;
@@ -248,7 +248,7 @@ OLAPStatus OLAPEngine::load_one_tablet(
OLAP_LOG_WARNING("fail to register tablet into root path.
[root_path=%s]",
schema_hash_path.c_str());
- if (OLAPEngine::get_instance()->drop_tablet(tablet_id, schema_hash) !=
OLAP_SUCCESS) {
+ if (StorageEngine::get_instance()->drop_tablet(tablet_id, schema_hash)
!= OLAP_SUCCESS) {
OLAP_LOG_WARNING("fail to drop tablet when create tablet failed. "
"[tablet=%ld schema_hash=%d]",
tablet_id, schema_hash);
@@ -265,7 +265,7 @@ OLAPStatus OLAPEngine::load_one_tablet(
return OLAP_SUCCESS;
}
-void OLAPEngine::check_none_row_oriented_tablet(const std::vector<OlapStore*>&
stores) {
+void StorageEngine::check_none_row_oriented_tablet(const
std::vector<OlapStore*>& stores) {
for (auto store : stores) {
auto res = _check_none_row_oriented_tablet_in_store(store);
if (res != OLAP_SUCCESS) {
@@ -275,7 +275,7 @@ void OLAPEngine::check_none_row_oriented_tablet(const
std::vector<OlapStore*>& s
}
}
-OLAPStatus OLAPEngine::_check_none_row_oriented_tablet_in_store(OlapStore*
store) {
+OLAPStatus StorageEngine::_check_none_row_oriented_tablet_in_store(OlapStore*
store) {
std::string store_path = store->path();
LOG(INFO) <<"start to load tablets from store_path:" << store_path;
@@ -344,7 +344,7 @@ OLAPStatus
OLAPEngine::_check_none_row_oriented_tablet_in_store(OlapStore* store
return res;
}
-OLAPStatus OLAPEngine::check_none_row_oriented_tablet_in_path(
+OLAPStatus StorageEngine::check_none_row_oriented_tablet_in_path(
OlapStore* store, TTabletId tablet_id,
SchemaHash schema_hash, const string& schema_hash_path) {
stringstream header_name_stream;
@@ -375,7 +375,7 @@ OLAPStatus
OLAPEngine::check_none_row_oriented_tablet_in_path(
return OLAP_SUCCESS;
}
-void OLAPEngine::load_stores(const std::vector<OlapStore*>& stores) {
+void StorageEngine::load_stores(const std::vector<OlapStore*>& stores) {
std::vector<std::thread> threads;
for (auto store : stores) {
threads.emplace_back([this, store] {
@@ -391,7 +391,7 @@ void OLAPEngine::load_stores(const std::vector<OlapStore*>&
stores) {
}
}
-OLAPStatus OLAPEngine::open() {
+OLAPStatus StorageEngine::open() {
// init store_map
for (auto& path : _options.store_paths) {
OlapStore* store = new OlapStore(path.path, path.capacity_bytes);
@@ -444,7 +444,7 @@ OLAPStatus OLAPEngine::open() {
return OLAP_SUCCESS;
}
-void OLAPEngine::_update_storage_medium_type_count() {
+void StorageEngine::_update_storage_medium_type_count() {
set<TStorageMedium::type> available_storage_medium_types;
std::lock_guard<std::mutex> l(_store_lock);
@@ -458,7 +458,7 @@ void OLAPEngine::_update_storage_medium_type_count() {
}
-OLAPStatus OLAPEngine::_judge_and_update_effective_cluster_id(int32_t
cluster_id) {
+OLAPStatus StorageEngine::_judge_and_update_effective_cluster_id(int32_t
cluster_id) {
OLAPStatus res = OLAP_SUCCESS;
if (cluster_id == -1 && _effective_cluster_id == -1) {
@@ -480,7 +480,7 @@ OLAPStatus
OLAPEngine::_judge_and_update_effective_cluster_id(int32_t cluster_id
return res;
}
-void OLAPEngine::set_store_used_flag(const string& path, bool is_used) {
+void StorageEngine::set_store_used_flag(const string& path, bool is_used) {
std::lock_guard<std::mutex> l(_store_lock);
auto it = _store_map.find(path);
if (it == _store_map.end()) {
@@ -491,7 +491,7 @@ void OLAPEngine::set_store_used_flag(const string& path,
bool is_used) {
_update_storage_medium_type_count();
}
-void OLAPEngine::get_all_available_root_path(std::vector<std::string>*
available_paths) {
+void StorageEngine::get_all_available_root_path(std::vector<std::string>*
available_paths) {
available_paths->clear();
std::lock_guard<std::mutex> l(_store_lock);
for (auto& it : _store_map) {
@@ -502,7 +502,7 @@ void
OLAPEngine::get_all_available_root_path(std::vector<std::string>* available
}
template<bool include_unused>
-std::vector<OlapStore*> OLAPEngine::get_stores() {
+std::vector<OlapStore*> StorageEngine::get_stores() {
std::vector<OlapStore*> stores;
stores.reserve(_store_map.size());
@@ -521,10 +521,10 @@ std::vector<OlapStore*> OLAPEngine::get_stores() {
return stores;
}
-template std::vector<OlapStore*> OLAPEngine::get_stores<false>();
-template std::vector<OlapStore*> OLAPEngine::get_stores<true>();
+template std::vector<OlapStore*> StorageEngine::get_stores<false>();
+template std::vector<OlapStore*> StorageEngine::get_stores<true>();
-OLAPStatus OLAPEngine::get_all_root_path_info(vector<RootPathInfo>*
root_paths_info) {
+OLAPStatus StorageEngine::get_all_root_path_info(vector<RootPathInfo>*
root_paths_info) {
OLAPStatus res = OLAP_SUCCESS;
root_paths_info->clear();
@@ -586,11 +586,11 @@ OLAPStatus
OLAPEngine::get_all_root_path_info(vector<RootPathInfo>* root_paths_i
return res;
}
-OLAPStatus OLAPEngine::register_tablet_into_root_path(Tablet* tablet) {
+OLAPStatus StorageEngine::register_tablet_into_root_path(Tablet* tablet) {
return tablet->store()->register_tablet(tablet);
}
-void OLAPEngine::start_disk_stat_monitor() {
+void StorageEngine::start_disk_stat_monitor() {
for (auto& it : _store_map) {
it.second->health_check();
}
@@ -614,11 +614,11 @@ void OLAPEngine::start_disk_stat_monitor() {
}
}
-bool OLAPEngine::_used_disk_not_enough(uint32_t unused_num, uint32_t
total_num) {
+bool StorageEngine::_used_disk_not_enough(uint32_t unused_num, uint32_t
total_num) {
return ((total_num == 0) || (unused_num * 100 / total_num >
_min_percentage_of_error_disk));
}
-OLAPStatus OLAPEngine::check_all_root_path_cluster_id() {
+OLAPStatus StorageEngine::check_all_root_path_cluster_id() {
int32_t cluster_id = -1;
for (auto& it : _store_map) {
int32_t tmp_cluster_id = it.second->cluster_id();
@@ -651,7 +651,7 @@ OLAPStatus OLAPEngine::check_all_root_path_cluster_id() {
return res;
}
-Status OLAPEngine::set_cluster_id(int32_t cluster_id) {
+Status StorageEngine::set_cluster_id(int32_t cluster_id) {
std::lock_guard<std::mutex> l(_store_lock);
for (auto& it : _store_map) {
RETURN_IF_ERROR(it.second->set_cluster_id(cluster_id));
@@ -661,7 +661,7 @@ Status OLAPEngine::set_cluster_id(int32_t cluster_id) {
return Status::OK;
}
-std::vector<OlapStore*> OLAPEngine::get_stores_for_create_tablet(
+std::vector<OlapStore*> StorageEngine::get_stores_for_create_tablet(
TStorageMedium::type storage_medium) {
std::vector<OlapStore*> stores;
{
@@ -682,7 +682,7 @@ std::vector<OlapStore*>
OLAPEngine::get_stores_for_create_tablet(
return stores;
}
-OlapStore* OLAPEngine::get_store(const std::string& path) {
+OlapStore* StorageEngine::get_store(const std::string& path) {
std::lock_guard<std::mutex> l(_store_lock);
auto it = _store_map.find(path);
if (it == std::end(_store_map)) {
@@ -691,7 +691,7 @@ OlapStore* OLAPEngine::get_store(const std::string& path) {
return it->second;
}
-void OLAPEngine::_delete_tables_on_unused_root_path() {
+void StorageEngine::_delete_tables_on_unused_root_path() {
vector<TabletInfo> tablet_info_vec;
uint32_t unused_root_path_num = 0;
uint32_t total_root_path_num = 0;
@@ -720,10 +720,10 @@ void OLAPEngine::_delete_tables_on_unused_root_path() {
_is_drop_tables = true;
}
-
OLAPEngine::get_instance()->drop_tables_on_error_root_path(tablet_info_vec);
+
StorageEngine::get_instance()->drop_tables_on_error_root_path(tablet_info_vec);
}
-OLAPStatus OLAPEngine::_get_path_available_capacity(
+OLAPStatus StorageEngine::_get_path_available_capacity(
const string& root_path,
int64_t* disk_available) {
OLAPStatus res = OLAP_SUCCESS;
@@ -740,7 +740,7 @@ OLAPStatus OLAPEngine::_get_path_available_capacity(
return res;
}
-OLAPStatus OLAPEngine::clear() {
+OLAPStatus StorageEngine::clear() {
// 删除lru中所有内容,其实进程退出这么做本身意义不大,但对单测和更容易发现问题还是有很大意义的
delete FileHandler::get_fd_cache();
FileHandler::set_fd_cache(nullptr);
@@ -753,7 +753,7 @@ OLAPStatus OLAPEngine::clear() {
return OLAP_SUCCESS;
}
-TabletSharedPtr OLAPEngine::_get_tablet_with_no_lock(TTabletId tablet_id,
SchemaHash schema_hash) {
+TabletSharedPtr StorageEngine::_get_tablet_with_no_lock(TTabletId tablet_id,
SchemaHash schema_hash) {
VLOG(3) << "begin to get tablet. tablet_id=" << tablet_id;
tablet_map_t::iterator it = _tablet_map.find(tablet_id);
if (it != _tablet_map.end()) {
@@ -771,7 +771,7 @@ TabletSharedPtr
OLAPEngine::_get_tablet_with_no_lock(TTabletId tablet_id, Schema
return tablet;
}
-TabletSharedPtr OLAPEngine::get_tablet(TTabletId tablet_id, SchemaHash
schema_hash, bool load_tablet) {
+TabletSharedPtr StorageEngine::get_tablet(TTabletId tablet_id, SchemaHash
schema_hash, bool load_tablet) {
_tablet_map_lock.rdlock();
TabletSharedPtr tablet;
tablet = _get_tablet_with_no_lock(tablet_id, schema_hash);
@@ -792,7 +792,7 @@ TabletSharedPtr OLAPEngine::get_tablet(TTabletId tablet_id,
SchemaHash schema_ha
return tablet;
}
-OLAPStatus OLAPEngine::get_tables_by_id(
+OLAPStatus StorageEngine::get_tables_by_id(
TTabletId tablet_id,
list<TabletSharedPtr>* table_list) {
OLAPStatus res = OLAP_SUCCESS;
@@ -829,7 +829,7 @@ OLAPStatus OLAPEngine::get_tables_by_id(
return res;
}
-bool OLAPEngine::check_tablet_id_exist(TTabletId tablet_id) {
+bool StorageEngine::check_tablet_id_exist(TTabletId tablet_id) {
bool is_exist = false;
_tablet_map_lock.rdlock();
@@ -842,10 +842,10 @@ bool OLAPEngine::check_tablet_id_exist(TTabletId
tablet_id) {
return is_exist;
}
-OLAPStatus OLAPEngine::add_tablet(TTabletId tablet_id, SchemaHash schema_hash,
+OLAPStatus StorageEngine::add_tablet(TTabletId tablet_id, SchemaHash
schema_hash,
const TabletSharedPtr& tablet, bool force) {
OLAPStatus res = OLAP_SUCCESS;
- VLOG(3) << "begin to add tablet to OLAPEngine. "
+ VLOG(3) << "begin to add tablet to StorageEngine. "
<< "tablet_id=" << tablet_id << ", schema_hash=" << schema_hash
<< ", force=" << force;
_tablet_map_lock.wrlock();
@@ -915,7 +915,7 @@ OLAPStatus OLAPEngine::add_tablet(TTabletId tablet_id,
SchemaHash schema_hash,
return res;
}
-OLAPStatus OLAPEngine::add_transaction(
+OLAPStatus StorageEngine::add_transaction(
TPartitionId partition_id, TTransactionId transaction_id,
TTabletId tablet_id, SchemaHash schema_hash, const PUniqueId& load_id) {
@@ -946,7 +946,7 @@ OLAPStatus OLAPEngine::add_transaction(
return OLAP_SUCCESS;
}
-void OLAPEngine::delete_transaction(
+void StorageEngine::delete_transaction(
TPartitionId partition_id, TTransactionId transaction_id,
TTabletId tablet_id, SchemaHash schema_hash, bool delete_from_tablet) {
@@ -975,7 +975,7 @@ void OLAPEngine::delete_transaction(
}
}
-void OLAPEngine::get_transactions_by_tablet(TabletSharedPtr tablet, int64_t*
partition_id,
+void StorageEngine::get_transactions_by_tablet(TabletSharedPtr tablet,
int64_t* partition_id,
set<int64_t>* transaction_ids) {
if (tablet.get() == nullptr || partition_id == nullptr || transaction_ids
== nullptr) {
OLAP_LOG_WARNING("parameter is null when get transactions by tablet");
@@ -996,7 +996,7 @@ void OLAPEngine::get_transactions_by_tablet(TabletSharedPtr
tablet, int64_t* par
}
}
-bool OLAPEngine::has_transaction(TPartitionId partition_id, TTransactionId
transaction_id,
+bool StorageEngine::has_transaction(TPartitionId partition_id, TTransactionId
transaction_id,
TTabletId tablet_id, SchemaHash schema_hash) {
pair<int64_t, int64_t> key(partition_id, transaction_id);
TabletInfo tablet_info(tablet_id, schema_hash);
@@ -1010,7 +1010,7 @@ bool OLAPEngine::has_transaction(TPartitionId
partition_id, TTransactionId trans
return found;
}
-OLAPStatus OLAPEngine::publish_version(const TPublishVersionRequest&
publish_version_req,
+OLAPStatus StorageEngine::publish_version(const TPublishVersionRequest&
publish_version_req,
vector<TTabletId>* error_tablet_ids) {
LOG(INFO) << "begin to process publish version. transaction_id="
<< publish_version_req.transaction_id;
@@ -1104,7 +1104,7 @@ OLAPStatus OLAPEngine::publish_version(const
TPublishVersionRequest& publish_ver
return res;
}
-void OLAPEngine::clear_transaction_task(const TTransactionId transaction_id,
+void StorageEngine::clear_transaction_task(const TTransactionId transaction_id,
const vector<TPartitionId>
partition_ids) {
LOG(INFO) << "begin to clear transaction task. transaction_id=" <<
transaction_id;
@@ -1136,7 +1136,7 @@ void OLAPEngine::clear_transaction_task(const
TTransactionId transaction_id,
LOG(INFO) << "finish to clear transaction task. transaction_id=" <<
transaction_id;
}
-OLAPStatus OLAPEngine::clone_incremental_data(TabletSharedPtr tablet,
OLAPHeader& clone_header,
+OLAPStatus StorageEngine::clone_incremental_data(TabletSharedPtr tablet,
OLAPHeader& clone_header,
int64_t committed_version) {
LOG(INFO) << "begin to incremental clone. tablet=" << tablet->full_name()
<< ", committed_version=" << committed_version;
@@ -1207,7 +1207,7 @@ OLAPStatus
OLAPEngine::clone_incremental_data(TabletSharedPtr tablet, OLAPHeader
return clone_res;
}
-OLAPStatus OLAPEngine::clone_full_data(TabletSharedPtr tablet, OLAPHeader&
clone_header) {
+OLAPStatus StorageEngine::clone_full_data(TabletSharedPtr tablet, OLAPHeader&
clone_header) {
Version clone_latest_version = clone_header.get_latest_version();
LOG(INFO) << "begin to full clone. tablet=" << tablet->full_name() << ","
<< "clone_latest_version=" << clone_latest_version.first << "-" <<
clone_latest_version.second;
@@ -1293,7 +1293,7 @@ OLAPStatus OLAPEngine::clone_full_data(TabletSharedPtr
tablet, OLAPHeader& clone
// base tablet cannot be dropped;
// b. other cases:
// drop specified tablet and clear schema change info.
-OLAPStatus OLAPEngine::drop_tablet(
+OLAPStatus StorageEngine::drop_tablet(
TTabletId tablet_id, SchemaHash schema_hash, bool keep_files) {
LOG(INFO) << "begin to process drop tablet."
<< "tablet=" << tablet_id << ", schema_hash=" << schema_hash;
@@ -1377,7 +1377,7 @@ OLAPStatus OLAPEngine::drop_tablet(
return res;
}
-OLAPStatus OLAPEngine::_drop_tablet_directly(
+OLAPStatus StorageEngine::_drop_tablet_directly(
TTabletId tablet_id, SchemaHash schema_hash, bool keep_files) {
_tablet_map_lock.wrlock();
OLAPStatus res = _drop_tablet_directly_unlocked(tablet_id, schema_hash,
keep_files);
@@ -1385,7 +1385,7 @@ OLAPStatus OLAPEngine::_drop_tablet_directly(
return res;
}
-OLAPStatus OLAPEngine::_drop_tablet_directly_unlocked(
+OLAPStatus StorageEngine::_drop_tablet_directly_unlocked(
TTabletId tablet_id, SchemaHash schema_hash, bool keep_files) {
OLAPStatus res = OLAP_SUCCESS;
@@ -1421,7 +1421,7 @@ OLAPStatus OLAPEngine::_drop_tablet_directly_unlocked(
return res;
}
-OLAPStatus OLAPEngine::drop_tables_on_error_root_path(
+OLAPStatus StorageEngine::drop_tables_on_error_root_path(
const vector<TabletInfo>& tablet_info_vec) {
OLAPStatus res = OLAP_SUCCESS;
@@ -1458,7 +1458,7 @@ OLAPStatus OLAPEngine::drop_tables_on_error_root_path(
return res;
}
-TabletSharedPtr OLAPEngine::create_tablet(
+TabletSharedPtr StorageEngine::create_tablet(
const TCreateTabletReq& request, const string* ref_root_path,
const bool is_schema_change_tablet, const TabletSharedPtr ref_tablet) {
// Get all available stores, use ref_root_path if the caller specified
@@ -1501,7 +1501,7 @@ TabletSharedPtr OLAPEngine::create_tablet(
return tablet;
}
-OLAPStatus OLAPEngine::create_init_version(TTabletId tablet_id, SchemaHash
schema_hash,
+OLAPStatus StorageEngine::create_init_version(TTabletId tablet_id, SchemaHash
schema_hash,
Version version, VersionHash
version_hash) {
VLOG(3) << "begin to create init version. "
<< "begin=" << version.first << ", end=" << version.second;
@@ -1589,7 +1589,7 @@ OLAPStatus OLAPEngine::create_init_version(TTabletId
tablet_id, SchemaHash schem
return res;
}
-bool OLAPEngine::try_schema_change_lock(TTabletId tablet_id) {
+bool StorageEngine::try_schema_change_lock(TTabletId tablet_id) {
bool res = false;
VLOG(3) << "try_schema_change_lock begin. table_id=" << tablet_id;
_tablet_map_lock.rdlock();
@@ -1606,7 +1606,7 @@ bool OLAPEngine::try_schema_change_lock(TTabletId
tablet_id) {
return res;
}
-void OLAPEngine::release_schema_change_lock(TTabletId tablet_id) {
+void StorageEngine::release_schema_change_lock(TTabletId tablet_id) {
VLOG(3) << "release_schema_change_lock begin. tablet_id=" << tablet_id;
_tablet_map_lock.rdlock();
@@ -1621,7 +1621,7 @@ void OLAPEngine::release_schema_change_lock(TTabletId
tablet_id) {
VLOG(3) << "release_schema_change_lock end. tablet_id=" << tablet_id;
}
-void OLAPEngine::_build_tablet_info(TabletSharedPtr tablet, TTabletInfo*
tablet_info) {
+void StorageEngine::_build_tablet_info(TabletSharedPtr tablet, TTabletInfo*
tablet_info) {
tablet_info->tablet_id = tablet->tablet_id();
tablet_info->schema_hash = tablet->schema_hash();
@@ -1650,7 +1650,7 @@ void OLAPEngine::_build_tablet_info(TabletSharedPtr
tablet, TTabletInfo* tablet_
tablet->release_header_lock();
}
-OLAPStatus OLAPEngine::report_tablet_info(TTabletInfo* tablet_info) {
+OLAPStatus StorageEngine::report_tablet_info(TTabletInfo* tablet_info) {
DorisMetrics::report_tablet_requests_total.increment(1);
LOG(INFO) << "begin to process report tablet info."
<< "tablet_id=" << tablet_info->tablet_id
@@ -1671,7 +1671,7 @@ OLAPStatus OLAPEngine::report_tablet_info(TTabletInfo*
tablet_info) {
return res;
}
-OLAPStatus OLAPEngine::report_all_tablets_info(std::map<TTabletId, TTablet>*
tablets_info) {
+OLAPStatus StorageEngine::report_all_tablets_info(std::map<TTabletId,
TTablet>* tablets_info) {
LOG(INFO) << "begin to process report all tablets info.";
DorisMetrics::report_all_tablets_requests_total.increment(1);
@@ -1719,7 +1719,7 @@ OLAPStatus
OLAPEngine::report_all_tablets_info(std::map<TTabletId, TTablet>* tab
return OLAP_SUCCESS;
}
-void OLAPEngine::get_tablet_stat(TTabletStatResult& result) {
+void StorageEngine::get_tablet_stat(TTabletStatResult& result) {
VLOG(3) << "begin to get all tablet stat.";
// get current time
@@ -1738,7 +1738,7 @@ void OLAPEngine::get_tablet_stat(TTabletStatResult&
result) {
_tablet_map_lock.unlock();
}
-void OLAPEngine::_build_tablet_stat() {
+void StorageEngine::_build_tablet_stat() {
_tablet_stat_cache.clear();
for (const auto& item : _tablet_map) {
if (item.second.table_arr.size() == 0) {
@@ -1767,7 +1767,7 @@ void OLAPEngine::_build_tablet_stat() {
_tablet_stat_cache_update_time_ms = UnixMillis();
}
-bool OLAPEngine::_can_do_compaction(TabletSharedPtr tablet) {
+bool StorageEngine::_can_do_compaction(TabletSharedPtr tablet) {
// 如果table正在做schema change,则通过选路判断数据是否转换完成
// 如果选路成功,则转换完成,可以进行BE
// 如果选路失败,则转换未完成,不能进行BE
@@ -1791,13 +1791,13 @@ bool OLAPEngine::_can_do_compaction(TabletSharedPtr
tablet) {
return true;
}
-void OLAPEngine::start_clean_fd_cache() {
+void StorageEngine::start_clean_fd_cache() {
VLOG(10) << "start clean file descritpor cache";
FileHandler::get_fd_cache()->prune();
VLOG(10) << "end clean file descritpor cache";
}
-void OLAPEngine::perform_cumulative_compaction() {
+void StorageEngine::perform_cumulative_compaction() {
TabletSharedPtr best_tablet =
_find_best_tablet_to_compaction(CompactionType::CUMULATIVE_COMPACTION);
if (best_tablet == nullptr) { return; }
@@ -1815,7 +1815,7 @@ void OLAPEngine::perform_cumulative_compaction() {
}
}
-void OLAPEngine::perform_base_compaction() {
+void StorageEngine::perform_base_compaction() {
TabletSharedPtr best_tablet =
_find_best_tablet_to_compaction(CompactionType::BASE_COMPACTION);
if (best_tablet == nullptr) { return; }
@@ -1834,7 +1834,7 @@ void OLAPEngine::perform_base_compaction() {
}
}
-TabletSharedPtr OLAPEngine::_find_best_tablet_to_compaction(CompactionType
compaction_type) {
+TabletSharedPtr StorageEngine::_find_best_tablet_to_compaction(CompactionType
compaction_type) {
ReadLock tablet_map_rdlock(&_tablet_map_lock);
uint32_t highest_score = 0;
TabletSharedPtr best_tablet;
@@ -1860,11 +1860,11 @@ TabletSharedPtr
OLAPEngine::_find_best_tablet_to_compaction(CompactionType compa
return best_tablet;
}
-void OLAPEngine::get_cache_status(rapidjson::Document* document) const {
+void StorageEngine::get_cache_status(rapidjson::Document* document) const {
return _index_stream_lru_cache->get_cache_status(document);
}
-OLAPStatus OLAPEngine::start_trash_sweep(double* usage) {
+OLAPStatus StorageEngine::start_trash_sweep(double* usage) {
OLAPStatus res = OLAP_SUCCESS;
LOG(INFO) << "start trash and snapshot sweep.";
@@ -1929,7 +1929,7 @@ OLAPStatus OLAPEngine::start_trash_sweep(double* usage) {
return res;
}
-OLAPStatus OLAPEngine::_do_sweep(
+OLAPStatus StorageEngine::_do_sweep(
const string& scan_root, const time_t& local_now, const uint32_t
expire) {
OLAPStatus res = OLAP_SUCCESS;
if (!check_dir_existed(scan_root)) {
@@ -1969,7 +1969,7 @@ OLAPStatus OLAPEngine::_do_sweep(
return res;
}
-OLAPStatus OLAPEngine::_create_new_tablet_header(
+OLAPStatus StorageEngine::_create_new_tablet_header(
const TCreateTabletReq& request,
OlapStore* store,
const bool is_schema_change_tablet,
@@ -2135,7 +2135,7 @@ OLAPStatus OLAPEngine::_create_new_tablet_header(
return OLAP_SUCCESS;
}
-OLAPStatus OLAPEngine::_check_existed_or_else_create_dir(const string& path) {
+OLAPStatus StorageEngine::_check_existed_or_else_create_dir(const string&
path) {
if (check_dir_existed(path)) {
LOG(WARNING) << "failed to create the dir that existed. [path='" <<
path << "']";
return OLAP_ERR_CANNOT_CREATE_DIR;
@@ -2144,7 +2144,7 @@ OLAPStatus
OLAPEngine::_check_existed_or_else_create_dir(const string& path) {
return create_dirs(path);
}
-void OLAPEngine::_cancel_unfinished_schema_change() {
+void StorageEngine::_cancel_unfinished_schema_change() {
// Schema Change在引擎退出时schemachange信息还保存在在Header里,
// 引擎重启后,需清除schemachange信息,上层会重做
uint64_t canceled_num = 0;
@@ -2190,7 +2190,7 @@ void OLAPEngine::_cancel_unfinished_schema_change() {
LOG(INFO) << "finish to cancel unfinished schema change! canceled_num=" <<
canceled_num;
}
-void OLAPEngine::start_delete_unused_index() {
+void StorageEngine::start_delete_unused_index() {
_gc_mutex.lock();
for (auto it = _gc_files.begin(); it != _gc_files.end();) {
@@ -2207,7 +2207,7 @@ void OLAPEngine::start_delete_unused_index() {
_gc_mutex.unlock();
}
-void OLAPEngine::add_unused_index(SegmentGroup* segment_group) {
+void StorageEngine::add_unused_index(SegmentGroup* segment_group) {
_gc_mutex.lock();
auto it = _gc_files.find(segment_group);
@@ -2227,7 +2227,7 @@ void OLAPEngine::add_unused_index(SegmentGroup*
segment_group) {
_gc_mutex.unlock();
}
-OLAPStatus OLAPEngine::_create_init_version(
+OLAPStatus StorageEngine::_create_init_version(
TabletSharedPtr tablet, const TCreateTabletReq& request) {
OLAPStatus res = OLAP_SUCCESS;
@@ -2268,7 +2268,7 @@ OLAPStatus OLAPEngine::_create_init_version(
}
// TODO(zc): refactor this funciton
-OLAPStatus OLAPEngine::create_tablet(const TCreateTabletReq& request) {
+OLAPStatus StorageEngine::create_tablet(const TCreateTabletReq& request) {
OLAPStatus res = OLAP_SUCCESS;
bool is_tablet_added = false;
@@ -2306,11 +2306,11 @@ OLAPStatus OLAPEngine::create_tablet(const
TCreateTabletReq& request) {
break;
}
- // 4. Add tablet to OlapEngine will make it visiable to user
+ // 4. Add tablet to StorageEngine will make it visiable to user
res = add_tablet(
request.tablet_id, request.tablet_schema.schema_hash, tablet);
if (res != OLAP_SUCCESS) {
- OLAP_LOG_WARNING("fail to add tablet to OLAPEngine. [res=%d]",
res);
+ OLAP_LOG_WARNING("fail to add tablet to StorageEngine. [res=%d]",
res);
break;
}
is_tablet_added = true;
@@ -2323,12 +2323,12 @@ OLAPStatus OLAPEngine::create_tablet(const
TCreateTabletReq& request) {
break;
}
- // 5. Register tablet into OLAPEngine, so that we can manage tablet
from
+ // 5. Register tablet into StorageEngine, so that we can manage tablet
from
// the perspective of root path.
// Example: unregister all tables when a bad disk found.
res = register_tablet_into_root_path(tablet_ptr.get());
if (res != OLAP_SUCCESS) {
- OLAP_LOG_WARNING("fail to register tablet into OLAPEngine.
[res=%d, root_path=%s]",
+ OLAP_LOG_WARNING("fail to register tablet into StorageEngine.
[res=%d, root_path=%s]",
res, tablet_ptr->storage_root_path_name().c_str());
break;
}
@@ -2361,7 +2361,7 @@ OLAPStatus OLAPEngine::create_tablet(const
TCreateTabletReq& request) {
return res;
}
-OLAPStatus OLAPEngine::schema_change(const TAlterTabletReq& request) {
+OLAPStatus StorageEngine::schema_change(const TAlterTabletReq& request) {
LOG(INFO) << "begin to schema change. old_tablet_id=" <<
request.base_tablet_id
<< ", new_tablet_id=" << request.new_tablet_req.tablet_id;
@@ -2386,7 +2386,7 @@ OLAPStatus OLAPEngine::schema_change(const
TAlterTabletReq& request) {
return res;
}
-OLAPStatus OLAPEngine::create_rollup_tablet(const TAlterTabletReq& request) {
+OLAPStatus StorageEngine::create_rollup_tablet(const TAlterTabletReq& request)
{
LOG(INFO) << "begin to create rollup tablet. "
<< "old_tablet_id=" << request.base_tablet_id
<< ", new_tablet_id=" << request.new_tablet_req.tablet_id;
@@ -2412,7 +2412,7 @@ OLAPStatus OLAPEngine::create_rollup_tablet(const
TAlterTabletReq& request) {
return res;
}
-AlterTableStatus OLAPEngine::show_alter_tablet_status(
+AlterTableStatus StorageEngine::show_alter_tablet_status(
TTabletId tablet_id,
TSchemaHash schema_hash) {
LOG(INFO) << "begin to process show alter tablet status."
@@ -2421,7 +2421,7 @@ AlterTableStatus OLAPEngine::show_alter_tablet_status(
AlterTableStatus status = ALTER_TABLE_FINISHED;
- TabletSharedPtr tablet = OLAPEngine::get_instance()->get_tablet(tablet_id,
schema_hash);
+ TabletSharedPtr tablet =
StorageEngine::get_instance()->get_tablet(tablet_id, schema_hash);
if (tablet.get() == NULL) {
OLAP_LOG_WARNING("fail to get tablet. [tablet=%ld schema_hash=%d]",
tablet_id, schema_hash);
@@ -2433,7 +2433,7 @@ AlterTableStatus OLAPEngine::show_alter_tablet_status(
return status;
}
-OLAPStatus OLAPEngine::compute_checksum(
+OLAPStatus StorageEngine::compute_checksum(
TTabletId tablet_id,
TSchemaHash schema_hash,
TVersion version,
@@ -2524,7 +2524,7 @@ OLAPStatus OLAPEngine::compute_checksum(
return OLAP_SUCCESS;
}
-OLAPStatus OLAPEngine::cancel_delete(const TCancelDeleteDataReq& request) {
+OLAPStatus StorageEngine::cancel_delete(const TCancelDeleteDataReq& request) {
LOG(INFO) << "begin to process cancel delete."
<< "tablet=" << request.tablet_id
<< ", version=" << request.version;
@@ -2572,7 +2572,7 @@ OLAPStatus OLAPEngine::cancel_delete(const
TCancelDeleteDataReq& request) {
return res;
}
-OLAPStatus OLAPEngine::delete_data(
+OLAPStatus StorageEngine::delete_data(
const TPushReq& request,
vector<TTabletInfo>* tablet_info_vec) {
LOG(INFO) << "begin to process delete data. request=" <<
ThriftDebugString(request);
@@ -2613,7 +2613,7 @@ OLAPStatus OLAPEngine::delete_data(
return res;
}
-OLAPStatus OLAPEngine::recover_tablet_until_specfic_version(
+OLAPStatus StorageEngine::recover_tablet_until_specfic_version(
const TRecoverTabletReq& recover_tablet_req) {
TabletSharedPtr tablet = get_tablet(recover_tablet_req.tablet_id,
recover_tablet_req.schema_hash);
@@ -2623,7 +2623,7 @@ OLAPStatus
OLAPEngine::recover_tablet_until_specfic_version(
return OLAP_SUCCESS;
}
-string OLAPEngine::get_info_before_incremental_clone(TabletSharedPtr tablet,
+string StorageEngine::get_info_before_incremental_clone(TabletSharedPtr tablet,
int64_t committed_version, vector<Version>* missing_versions) {
// get missing versions
@@ -2649,7 +2649,7 @@ string
OLAPEngine::get_info_before_incremental_clone(TabletSharedPtr tablet,
return tablet->tablet_path() + CLONE_PREFIX;
}
-OLAPStatus OLAPEngine::finish_clone(TabletSharedPtr tablet, const string&
clone_dir,
+OLAPStatus StorageEngine::finish_clone(TabletSharedPtr tablet, const string&
clone_dir,
int64_t committed_version, bool
is_incremental_clone) {
OLAPStatus res = OLAP_SUCCESS;
vector<string> linked_success_files;
@@ -2718,10 +2718,10 @@ OLAPStatus OLAPEngine::finish_clone(TabletSharedPtr
tablet, const string& clone_
}
if (is_incremental_clone) {
- res = OLAPEngine::get_instance()->clone_incremental_data(
+ res = StorageEngine::get_instance()->clone_incremental_data(
tablet, clone_header,
committed_version);
} else {
- res = OLAPEngine::get_instance()->clone_full_data(tablet,
clone_header);
+ res = StorageEngine::get_instance()->clone_full_data(tablet,
clone_header);
}
// if full clone success, need to update cumulative layer point
@@ -2750,7 +2750,7 @@ OLAPStatus OLAPEngine::finish_clone(TabletSharedPtr
tablet, const string& clone_
return res;
}
-OLAPStatus OLAPEngine::obtain_shard_path(
+OLAPStatus StorageEngine::obtain_shard_path(
TStorageMedium::type storage_medium, std::string* shard_path,
OlapStore** store) {
LOG(INFO) << "begin to process obtain root path. storage_medium=" <<
storage_medium;
OLAPStatus res = OLAP_SUCCESS;
@@ -2760,7 +2760,7 @@ OLAPStatus OLAPEngine::obtain_shard_path(
return OLAP_ERR_CE_CMD_PARAMS_ERROR;
}
- auto stores =
OLAPEngine::get_instance()->get_stores_for_create_tablet(storage_medium);
+ auto stores =
StorageEngine::get_instance()->get_stores_for_create_tablet(storage_medium);
if (stores.empty()) {
OLAP_LOG_WARNING("no available disk can be used to create tablet.");
return OLAP_ERR_NO_AVAILABLE_ROOT_PATH;
@@ -2782,7 +2782,7 @@ OLAPStatus OLAPEngine::obtain_shard_path(
return res;
}
-OLAPStatus OLAPEngine::load_header(
+OLAPStatus StorageEngine::load_header(
const string& shard_path,
const TCloneReq& request) {
LOG(INFO) << "begin to process load headers."
@@ -2796,7 +2796,7 @@ OLAPStatus OLAPEngine::load_header(
try {
auto store_path =
boost::filesystem::path(shard_path).parent_path().parent_path().string();
- store = OLAPEngine::get_instance()->get_store(store_path);
+ store = StorageEngine::get_instance()->get_store(store_path);
if (store == nullptr) {
LOG(WARNING) << "invalid shard path, path=" << shard_path;
return OLAP_ERR_INVALID_ROOT_PATH;
@@ -2811,7 +2811,7 @@ OLAPStatus OLAPEngine::load_header(
schema_hash_path_stream << shard_path
<< "/" << request.tablet_id
<< "/" << request.schema_hash;
- res = OLAPEngine::get_instance()->load_one_tablet(
+ res = StorageEngine::get_instance()->load_one_tablet(
store,
request.tablet_id, request.schema_hash,
schema_hash_path_stream.str());
@@ -2824,7 +2824,7 @@ OLAPStatus OLAPEngine::load_header(
return res;
}
-OLAPStatus OLAPEngine::load_header(
+OLAPStatus StorageEngine::load_header(
OlapStore* store,
const string& shard_path,
TTabletId tablet_id,
@@ -2837,7 +2837,7 @@ OLAPStatus OLAPEngine::load_header(
schema_hash_path_stream << shard_path
<< "/" << tablet_id
<< "/" << schema_hash;
- res = OLAPEngine::get_instance()->load_one_tablet(
+ res = StorageEngine::get_instance()->load_one_tablet(
store,
tablet_id, schema_hash,
schema_hash_path_stream.str());
@@ -2850,7 +2850,7 @@ OLAPStatus OLAPEngine::load_header(
return res;
}
-OLAPStatus OLAPEngine::clear_alter_task(const TTabletId tablet_id,
+OLAPStatus StorageEngine::clear_alter_task(const TTabletId tablet_id,
const TSchemaHash schema_hash) {
LOG(INFO) << "begin to process clear alter task. tablet_id=" << tablet_id
<< ", schema_hash=" << schema_hash;
@@ -2916,7 +2916,7 @@ OLAPStatus OLAPEngine::clear_alter_task(const TTabletId
tablet_id,
return OLAP_SUCCESS;
}
-OLAPStatus OLAPEngine::push(
+OLAPStatus StorageEngine::push(
const TPushReq& request,
vector<TTabletInfo>* tablet_info_vec) {
OLAPStatus res = OLAP_SUCCESS;
@@ -2929,7 +2929,7 @@ OLAPStatus OLAPEngine::push(
return OLAP_ERR_CE_CMD_PARAMS_ERROR;
}
- TabletSharedPtr tablet = OLAPEngine::get_instance()->get_tablet(
+ TabletSharedPtr tablet = StorageEngine::get_instance()->get_tablet(
request.tablet_id, request.schema_hash);
if (NULL == tablet.get()) {
OLAP_LOG_WARNING("false to find tablet. [tablet=%ld schema_hash=%d]",
diff --git a/be/src/olap/olap_engine.h b/be/src/olap/storage_engine.h
similarity index 96%
rename from be/src/olap/olap_engine.h
rename to be/src/olap/storage_engine.h
index 5415cb65..ba36b2ad 100644
--- a/be/src/olap/olap_engine.h
+++ b/be/src/olap/storage_engine.h
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
-#ifndef DORIS_BE_SRC_OLAP_OLAP_ENGINE_H
-#define DORIS_BE_SRC_OLAP_OLAP_ENGINE_H
+#ifndef DORIS_BE_SRC_OLAP_STORAGE_ENGINE_H
+#define DORIS_BE_SRC_OLAP_STORAGE_ENGINE_H
#include <ctime>
#include <list>
@@ -65,23 +65,23 @@ struct RootPathInfo {
TStorageMedium::type storage_medium; // 存储介质类型:SSD|HDD
};
-// OLAPEngine singleton to manage all Table pointers.
+// StorageEngine singleton to manage all Table pointers.
// Providing add/drop/get operations.
-// OLAPEngine instance doesn't own the Table resources, just hold the pointer,
+// StorageEngine instance doesn't own the Table resources, just hold the
pointer,
// allocation/deallocation must be done outside.
-class OLAPEngine {
+class StorageEngine {
public:
- OLAPEngine() { }
- OLAPEngine(const EngineOptions& options);
- ~OLAPEngine();
+ StorageEngine() { }
+ StorageEngine(const EngineOptions& options);
+ ~StorageEngine();
- static Status open(const EngineOptions& options, OLAPEngine** engine_ptr);
+ static Status open(const EngineOptions& options, StorageEngine**
engine_ptr);
- static void set_instance(OLAPEngine* engine) {
+ static void set_instance(StorageEngine* engine) {
_s_instance = engine;
}
- static OLAPEngine *get_instance() {
+ static StorageEngine *get_instance() {
return _s_instance;
}
@@ -94,7 +94,7 @@ class OLAPEngine {
OLAPStatus create_tablet(const TCreateTabletReq& request);
- // Create new tablet for OLAPEngine
+ // Create new tablet for StorageEngine
//
// Return Tablet * succeeded; Otherwise, return NULL if failed
TabletSharedPtr create_tablet(const TCreateTabletReq& request,
@@ -102,7 +102,7 @@ class OLAPEngine {
const bool is_schema_change_tablet,
const TabletSharedPtr ref_tablet);
- // Add a tablet pointer to OLAPEngine
+ // Add a tablet pointer to StorageEngine
// If force, drop the existing tablet add this new one
//
// Return OLAP_SUCCESS, if run ok
@@ -279,7 +279,7 @@ class OLAPEngine {
// @return OLAP_SUCCESS if submit success
OLAPStatus create_rollup_tablet(const TAlterTabletReq& request);
- // Do schema change on tablet, OLAPEngine support
+ // Do schema change on tablet, StorageEngine support
// add column, drop column, alter column type and order,
// after schema_change, base tablet is abandoned.
// Note that the two tablets has same tablet_id but different schema_hash
@@ -559,7 +559,7 @@ class OLAPEngine {
// last update time of tablet stat cache
int64_t _tablet_stat_cache_update_time_ms;
- static OLAPEngine* _s_instance;
+ static StorageEngine* _s_instance;
// snapshot
Mutex _snapshot_mutex;
@@ -616,4 +616,4 @@ class OLAPEngine {
} // namespace doris
-#endif // DORIS_BE_SRC_OLAP_OLAP_ENGINE_H
+#endif // DORIS_BE_SRC_OLAP_STORAGE_ENGINE_H
diff --git a/be/src/olap/store.cpp b/be/src/olap/store.cpp
index 3ef7337f..76d97772 100755
--- a/be/src/olap/store.cpp
+++ b/be/src/olap/store.cpp
@@ -476,7 +476,7 @@ std::string
OlapStore::get_root_path_from_schema_hash_path_in_trash(
return
schema_hash_path_in_trash.parent_path().parent_path().parent_path().parent_path().string();
}
-OLAPStatus OlapStore::_load_tablet_from_header(OLAPEngine* engine, TTabletId
tablet_id,
+OLAPStatus OlapStore::_load_tablet_from_header(StorageEngine* engine,
TTabletId tablet_id,
TSchemaHash schema_hash, const std::string& header) {
std::unique_ptr<OLAPHeader> olap_header(new OLAPHeader());
bool parsed = olap_header->ParseFromString(header);
@@ -548,7 +548,7 @@ OLAPStatus OlapStore::_load_tablet_from_header(OLAPEngine*
engine, TTabletId tab
return OLAP_SUCCESS;
}
-OLAPStatus OlapStore::load_tables(OLAPEngine* engine) {
+OLAPStatus OlapStore::load_tables(StorageEngine* engine) {
auto load_tablet_func = [this, engine](long tablet_id,
long schema_hash, const std::string& value) -> bool {
OLAPStatus status = _load_tablet_from_header(engine, tablet_id,
schema_hash, value);
@@ -562,7 +562,7 @@ OLAPStatus OlapStore::load_tables(OLAPEngine* engine) {
return status;
}
-OLAPStatus OlapStore::check_none_row_oriented_tablet_in_store(OLAPEngine*
engine) {
+OLAPStatus OlapStore::check_none_row_oriented_tablet_in_store(StorageEngine*
engine) {
auto load_tablet_func = [this, engine](long tablet_id,
long schema_hash, const std::string& value) -> bool {
OLAPStatus status = _check_none_row_oriented_tablet_in_store(engine,
tablet_id, schema_hash, value);
@@ -577,7 +577,7 @@ OLAPStatus
OlapStore::check_none_row_oriented_tablet_in_store(OLAPEngine* engine
}
OLAPStatus OlapStore::_check_none_row_oriented_tablet_in_store(
- OLAPEngine* engine, TTabletId tablet_id,
+ StorageEngine* engine, TTabletId tablet_id,
TSchemaHash schema_hash, const std::string& header) {
std::unique_ptr<OLAPHeader> olap_header(new OLAPHeader());
bool parsed = olap_header->ParseFromString(header);
diff --git a/be/src/olap/store.h b/be/src/olap/store.h
index 42e35a45..ebf07339 100644
--- a/be/src/olap/store.h
+++ b/be/src/olap/store.h
@@ -25,12 +25,12 @@
#include "common/status.h"
#include "gen_cpp/Types_types.h"
#include "olap/olap_common.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
namespace doris {
class OLAPRootPath;
-class OLAPEngine;
+class StorageEngine;
// A OlapStore used to manange data in same path.
// Now, After OlapStore was created, it will never be deleted for easy
implementation.
@@ -80,10 +80,10 @@ class OlapStore {
static std::string get_root_path_from_schema_hash_path_in_trash(const
std::string& schema_hash_dir_in_trash);
- OLAPStatus load_tables(OLAPEngine* engine);
- OLAPStatus check_none_row_oriented_tablet_in_store(OLAPEngine* engine);
+ OLAPStatus load_tables(StorageEngine* engine);
+ OLAPStatus check_none_row_oriented_tablet_in_store(StorageEngine* engine);
OLAPStatus _check_none_row_oriented_tablet_in_store(
- OLAPEngine* engine, TTabletId tablet_id,
+ StorageEngine* engine, TTabletId tablet_id,
TSchemaHash schema_hash, const std::string& header);
private:
@@ -99,12 +99,12 @@ class OlapStore {
Status _read_cluster_id(const std::string& path, int32_t* cluster_id);
Status _write_cluster_id_to_path(const std::string& path, int32_t
cluster_id);
- OLAPStatus _load_tablet_from_header(OLAPEngine* engine, TTabletId
tablet_id,
+ OLAPStatus _load_tablet_from_header(StorageEngine* engine, TTabletId
tablet_id,
TSchemaHash schema_hash, const std::string& header);
private:
friend class OLAPRootPath;
- friend class OLAPEngine;
+ friend class StorageEngine;
std::string _path;
int64_t _path_hash;
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 103b3040..fa7898e6 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -31,14 +31,14 @@
#include "olap/column_data.h"
#include "olap/olap_common.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/olap_index.h"
#include "olap/reader.h"
#include "olap/store.h"
#include "olap/row_cursor.h"
#include "util/defer_op.h"
#include "olap/olap_header_manager.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/utils.h"
#include "olap/data_writer.h"
@@ -259,7 +259,7 @@ Tablet::~Tablet() {
for (auto& it : _pending_data_sources) {
// false means can't remove the transaction from header, also prevent
the loading of tablet
for (SegmentGroup* segment_group : it.second) {
- OLAPEngine::get_instance()->delete_transaction(
+ StorageEngine::get_instance()->delete_transaction(
segment_group->partition_id(),
segment_group->transaction_id(),
_tablet_id, _schema_hash, false);
SAFE_DELETE(segment_group);
@@ -310,7 +310,7 @@ OLAPStatus Tablet::load() {
<< "res=" << res << ", root=" << one_schema_root;
goto EXIT;
} else if (res != OLAP_SUCCESS) {
- OLAPEngine::get_instance()->drop_tablet(tablet_id(), schema_hash(),
true);
+ StorageEngine::get_instance()->drop_tablet(tablet_id(), schema_hash(),
true);
return res;
}
res = load_indices();
@@ -337,7 +337,7 @@ OLAPStatus Tablet::load() {
EXIT:
if (res != OLAP_SUCCESS) {
- OLAPEngine::get_instance()->drop_tablet(tablet_id(), schema_hash());
+ StorageEngine::get_instance()->drop_tablet(tablet_id(), schema_hash());
}
return res;
@@ -741,7 +741,7 @@ void Tablet::delete_pending_data(int64_t transaction_id) {
// delete from data sources
for (SegmentGroup* segment_group : it->second) {
segment_group->release();
- OLAPEngine::get_instance()->add_unused_index(segment_group);
+ StorageEngine::get_instance()->add_unused_index(segment_group);
}
_pending_data_sources.erase(it);
@@ -838,7 +838,7 @@ void Tablet::load_pending_data() {
break;
}
- OLAPStatus add_status =
OLAPEngine::get_instance()->add_transaction(
+ OLAPStatus add_status =
StorageEngine::get_instance()->add_transaction(
pending_delta.partition_id(),
pending_delta.transaction_id(),
_tablet_id, _schema_hash, pending_segment_group.load_id());
@@ -983,7 +983,7 @@ OLAPStatus Tablet::_handle_existed_version(int64_t
transaction_id, const Version
} else if (!push_for_delete) {
DeleteConditionHandler del_cond_handler;
TabletSharedPtr tablet_ptr =
- OLAPEngine::get_instance()->get_tablet(_tablet_id,
_schema_hash);
+ StorageEngine::get_instance()->get_tablet(_tablet_id,
_schema_hash);
if (tablet_ptr.get() != nullptr) {
del_cond_handler.delete_cond(tablet_ptr, version.first, false);
}
@@ -1004,9 +1004,9 @@ OLAPStatus Tablet::_handle_existed_version(int64_t
transaction_id, const Version
LOG(FATAL) << "fail to save header when unregister data. [tablet="
<< full_name()
<< " transaction_id=" << transaction_id << "]";
}
- // use OLAPEngine to delete this segment_group
+ // use StorageEngine to delete this segment_group
if (!existed_index_vec.empty()) {
- OLAPEngine *unused_index = OLAPEngine::get_instance();
+ StorageEngine *unused_index = StorageEngine::get_instance();
for (SegmentGroup* segment_group : existed_index_vec) {
unused_index->add_unused_index(segment_group);
}
@@ -1403,7 +1403,7 @@ OLAPStatus Tablet::clone_data(const OLAPHeader&
clone_header,
if (it != _data_sources.end()) {
std::vector<SegmentGroup*> index_to_delete_vec = it->second;
_data_sources.erase(it);
- OLAPEngine* unused_index = OLAPEngine::get_instance();
+ StorageEngine* unused_index = StorageEngine::get_instance();
for (SegmentGroup* segment_group : index_to_delete_vec) {
unused_index->add_unused_index(segment_group);
}
@@ -2182,7 +2182,7 @@ void Tablet::set_io_error() {
OLAP_LOG_WARNING("io error occur.[tablet_full_name='%s',
root_path_name='%s']",
_full_name.c_str(),
_storage_root_path.c_str());
- OLAPEngine::get_instance()->set_store_used_flag(_storage_root_path, false);
+ StorageEngine::get_instance()->set_store_used_flag(_storage_root_path,
false);
}
bool Tablet::is_used() {
diff --git a/be/src/runtime/exec_env.h b/be/src/runtime/exec_env.h
index 9d295512..0381c760 100644
--- a/be/src/runtime/exec_env.h
+++ b/be/src/runtime/exec_env.h
@@ -37,7 +37,7 @@ class LoadPathMgr;
class LoadStreamMgr;
class MemTracker;
class MetricRegistry;
-class OLAPEngine;
+class StorageEngine;
class PoolMemTrackerRegistry;
class PriorityThreadPool;
class PullLoadTaskMgr;
@@ -112,8 +112,8 @@ class ExecEnv {
LoadStreamMgr* load_stream_mgr() { return _load_stream_mgr; }
const std::vector<StorePath>& store_paths() const { return _store_paths; }
void set_store_paths(const std::vector<StorePath>& paths) { _store_paths =
paths; }
- OLAPEngine* olap_engine() { return _olap_engine; }
- void set_olap_engine(OLAPEngine* olap_engine) { _olap_engine =
olap_engine; }
+ StorageEngine* olap_engine() { return _olap_engine; }
+ void set_olap_engine(StorageEngine* olap_engine) { _olap_engine =
olap_engine; }
private:
Status _init(const std::vector<StorePath>& store_paths);
@@ -157,7 +157,7 @@ class ExecEnv {
ReservationTracker* _buffer_reservation = nullptr;
BufferPool* _buffer_pool = nullptr;
- OLAPEngine* _olap_engine = nullptr;
+ StorageEngine* _olap_engine = nullptr;
};
}
diff --git a/be/src/runtime/exec_env_init.cpp b/be/src/runtime/exec_env_init.cpp
index 1584567e..a368ddb9 100644
--- a/be/src/runtime/exec_env_init.cpp
+++ b/be/src/runtime/exec_env_init.cpp
@@ -38,7 +38,7 @@
#include "util/parse_util.h"
#include "util/mem_info.h"
#include "util/debug_util.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "util/network_util.h"
#include "util/bfd_parser.h"
#include "runtime/etl_job_mgr.h"
diff --git a/be/src/runtime/load_path_mgr.cpp b/be/src/runtime/load_path_mgr.cpp
index 527106dc..bcbbc333 100644
--- a/be/src/runtime/load_path_mgr.cpp
+++ b/be/src/runtime/load_path_mgr.cpp
@@ -25,7 +25,7 @@
#include <boost/algorithm/string/join.hpp>
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "util/file_utils.h"
#include "gen_cpp/Types_types.h"
#include "runtime/exec_env.h"
diff --git a/be/src/runtime/snapshot_loader.cpp
b/be/src/runtime/snapshot_loader.cpp
index 9b7f2f6b..c160732c 100644
--- a/be/src/runtime/snapshot_loader.cpp
+++ b/be/src/runtime/snapshot_loader.cpp
@@ -26,7 +26,7 @@
#include "exec/broker_reader.h"
#include "exec/broker_writer.h"
#include "olap/file_helper.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/tablet.h"
#include "runtime/exec_env.h"
#include "runtime/broker_mgr.h"
@@ -556,7 +556,7 @@ Status SnapshotLoader::move(
// than we merge the 2 .hdr file before reloading it.
// load header in tablet dir to get the base vesion
- TabletSharedPtr tablet = OLAPEngine::get_instance()->get_tablet(
+ TabletSharedPtr tablet = StorageEngine::get_instance()->get_tablet(
tablet_id, schema_hash);
if (tablet.get() == NULL) {
std::stringstream ss;
@@ -660,14 +660,14 @@ Status SnapshotLoader::move(
// fixme: there is no header now and can not call load_one_tablet here
// reload header
- OlapStore* store = OLAPEngine::get_instance()->get_store(store_path);
+ OlapStore* store = StorageEngine::get_instance()->get_store(store_path);
if (store == nullptr) {
std::stringstream ss;
ss << "failed to get store by path: " << store_path;
LOG(WARNING) << ss.str();
return Status(ss.str());
}
- OLAPStatus ost = OLAPEngine::get_instance()->load_one_tablet(
+ OLAPStatus ost = StorageEngine::get_instance()->load_one_tablet(
store, tablet_id, schema_hash, tablet_path, true);
if (ost != OLAP_SUCCESS) {
std::stringstream ss;
diff --git a/be/src/runtime/tmp_file_mgr.cc b/be/src/runtime/tmp_file_mgr.cc
index 7d03ee07..bfdb4a2d 100644
--- a/be/src/runtime/tmp_file_mgr.cc
+++ b/be/src/runtime/tmp_file_mgr.cc
@@ -27,7 +27,7 @@
// #include <gutil/strings/substitute.h>
// #include <gutil/strings/join.h>
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "util/debug_util.h"
#include "util/disk_info.h"
#include "util/filesystem_util.h"
diff --git a/be/src/service/backend_service.cpp
b/be/src/service/backend_service.cpp
index 056495a2..c6b29481 100644
--- a/be/src/service/backend_service.cpp
+++ b/be/src/service/backend_service.cpp
@@ -22,7 +22,7 @@
#include <thrift/protocol/TDebugProtocol.h>
#include <thrift/concurrency/PosixThreadFactory.h>
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "service/backend_options.h"
#include "util/network_util.h"
#include "util/thrift_util.h"
@@ -225,7 +225,7 @@ void BackendService::erase_export_task(TStatus& t_status,
const TUniqueId& task_
}
void BackendService::get_tablet_stat(TTabletStatResult& result) {
- OLAPEngine::get_instance()->get_tablet_stat(result);
+ StorageEngine::get_instance()->get_tablet_stat(result);
}
} // namespace doris
diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp
index f01ce03c..2ccbba80 100644
--- a/be/src/service/doris_main.cpp
+++ b/be/src/service/doris_main.cpp
@@ -135,10 +135,10 @@ int main(int argc, char** argv) {
// options
doris::EngineOptions options;
options.store_paths = paths;
- doris::OLAPEngine* engine = nullptr;
- auto st = doris::OLAPEngine::open(options, &engine);
+ doris::StorageEngine* engine = nullptr;
+ auto st = doris::StorageEngine::open(options, &engine);
if (!st.ok()) {
- LOG(FATAL) << "fail to open OLAPEngine, res=" << st.get_error_msg();
+ LOG(FATAL) << "fail to open StorageEngine, res=" << st.get_error_msg();
exit(-1);
}
diff --git a/be/test/agent/pusher_test.cpp b/be/test/agent/pusher_test.cpp
index 68700ac5..c9d45e5d 100644
--- a/be/test/agent/pusher_test.cpp
+++ b/be/test/agent/pusher_test.cpp
@@ -46,7 +46,7 @@ TEST(PusherTest, TestInit) {
push_req.schema_hash = 12345;
Pusher pusher(nullptr, push_req);
- OLAPEngine* tmp = NULL;
+ StorageEngine* tmp = NULL;
MockCommandExecutor mock_command_executor;
tmp = pusher._engine;
pusher._engine = &mock_command_executor;
@@ -158,7 +158,7 @@ TEST(PusherTest, TestProcess) {
pusher._is_init = true;
pusher._downloader_param.local_file_path = "./test_data/download_file";
MockCommandExecutor mock_command_executor;
- OLAPEngine* tmp;
+ StorageEngine* tmp;
tmp = pusher._engine;
pusher._engine = &mock_command_executor;
EXPECT_CALL(mock_command_executor, push(push_req, &tablet_infos))
diff --git a/be/test/exec/new_olap_scan_node_test.cpp
b/be/test/exec/new_olap_scan_node_test.cpp
index 17f60ec5..f20adeea 100644
--- a/be/test/exec/new_olap_scan_node_test.cpp
+++ b/be/test/exec/new_olap_scan_node_test.cpp
@@ -52,7 +52,7 @@ class TestOlapScanNode : public testing::Test {
}
void TearDown() {
- OLAPEngine::get_instance()->clear();
+ StorageEngine::get_instance()->clear();
SessionManager::get_instance()->delete_session_by_fd(123);
system("rm -rf ./testrun");
@@ -73,7 +73,7 @@ class TestOlapScanNode : public testing::Test {
OLAPRootPath::get_instance()->init();
- OLAPEngine::get_instance()->_lru_cache = newLRU_cache(10000);
+ StorageEngine::get_instance()->_lru_cache = newLRU_cache(10000);
_olap_header = new
OLAPHeader("./testrun/case3/clickuserid_online_userid_type_planid_unitid_winfoid.hdr");
@@ -83,7 +83,7 @@ class TestOlapScanNode : public testing::Test {
tablet->_root_path_name = "./testrun/case3";
TableDescription description("fc", "clickuserid_online",
"userid_type_planid_unitid_winfoid");
- OLAPEngine::get_instance()->add_table(description, tablet);
+ StorageEngine::get_instance()->add_table(description, tablet);
// init session manager
SessionManager::get_instance()->init();
diff --git a/be/test/olap/delete_handler_test.cpp
b/be/test/olap/delete_handler_test.cpp
index 74a570a8..49c628ec 100644
--- a/be/test/olap/delete_handler_test.cpp
+++ b/be/test/olap/delete_handler_test.cpp
@@ -28,7 +28,7 @@
#include "olap/delete_handler.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/push_handler.h"
#include "olap/utils.h"
#include "olap/options.h"
@@ -42,7 +42,7 @@ using google::protobuf::RepeatedPtrField;
namespace doris {
static const uint32_t MAX_PATH_LEN = 1024;
-static OLAPEngine* k_engine = nullptr;
+static StorageEngine* k_engine = nullptr;
void set_up() {
char buffer[MAX_PATH_LEN];
@@ -56,7 +56,7 @@ void set_up() {
doris::EngineOptions options;
options.store_paths = paths;
- doris::OLAPEngine::open(options, &k_engine);
+ doris::StorageEngine::open(options, &k_engine);
}
void tear_down() {
@@ -160,7 +160,7 @@ void set_default_push_request(TPushReq* request) {
class TestDeleteConditionHandler : public testing::Test {
protected:
void SetUp() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
char buffer[MAX_PATH_LEN];
getcwd(buffer, MAX_PATH_LEN);
config::storage_root_path = string(buffer) + "/data_delete_condition";
@@ -195,7 +195,7 @@ class TestDeleteConditionHandler : public testing::Test {
void TearDown() {
// Remove all dir.
tablet.reset();
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
_create_tablet.tablet_id,
_create_tablet.tablet_schema.schema_hash);
while (0 == access(_tablet_path.c_str(), F_OK)) {
sleep(1);
@@ -471,7 +471,7 @@ TEST_F(TestDeleteConditionHandler,
DeleteCondRemovBelowCondition) {
class TestDeleteConditionHandler2 : public testing::Test {
protected:
void SetUp() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
char buffer[MAX_PATH_LEN];
getcwd(buffer, MAX_PATH_LEN);
config::storage_root_path = string(buffer) + "/data_delete_condition";
@@ -496,7 +496,7 @@ class TestDeleteConditionHandler2 : public testing::Test {
void TearDown() {
// Remove all dir.
tablet.reset();
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
_create_tablet.tablet_id,
_create_tablet.tablet_schema.schema_hash);
while (0 == access(_tablet_path.c_str(), F_OK)) {
sleep(1);
@@ -780,7 +780,7 @@ TEST_F(TestDeleteConditionHandler2, InvalidConditionValue) {
class TestDeleteHandler : public testing::Test {
protected:
void SetUp() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
char buffer[MAX_PATH_LEN];
getcwd(buffer, MAX_PATH_LEN);
config::storage_root_path = string(buffer) + "/data_delete_condition";
@@ -819,7 +819,7 @@ class TestDeleteHandler : public testing::Test {
// Remove all dir.
tablet.reset();
_delete_handler.finalize();
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
_create_tablet.tablet_id,
_create_tablet.tablet_schema.schema_hash);
while (0 == access(_tablet_path.c_str(), F_OK)) {
sleep(1);
diff --git a/be/test/olap/delta_writer_test.cpp
b/be/test/olap/delta_writer_test.cpp
index 46d0f195..083560eb 100644
--- a/be/test/olap/delta_writer_test.cpp
+++ b/be/test/olap/delta_writer_test.cpp
@@ -25,7 +25,7 @@
#include "gen_cpp/PaloInternalService_types.h"
#include "gen_cpp/Types_types.h"
#include "olap/field.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/tablet.h"
#include "olap/utils.h"
#include "runtime/tuple.h"
@@ -42,7 +42,7 @@ namespace doris {
static const uint32_t MAX_RETRY_TIMES = 10;
static const uint32_t MAX_PATH_LEN = 1024;
-OLAPEngine* k_engine = nullptr;
+StorageEngine* k_engine = nullptr;
void set_up() {
char buffer[MAX_PATH_LEN];
@@ -55,7 +55,7 @@ void set_up() {
doris::EngineOptions options;
options.store_paths = paths;
- doris::OLAPEngine::open(options, &k_engine);
+ doris::StorageEngine::open(options, &k_engine);
}
void tear_down() {
@@ -267,7 +267,7 @@ class TestDeltaWriter : public ::testing::Test {
~TestDeltaWriter() { }
void SetUp() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
char buffer[MAX_PATH_LEN];
getcwd(buffer, MAX_PATH_LEN);
config::storage_root_path = std::string(buffer) + "/data_push";
@@ -397,7 +397,7 @@ TEST_F(TestDeltaWriter, write) {
ASSERT_EQ(res, OLAP_SUCCESS);
// publish version success
- TabletSharedPtr tablet =
OLAPEngine::get_instance()->get_tablet(write_req.tablet_id,
write_req.schema_hash);
+ TabletSharedPtr tablet =
StorageEngine::get_instance()->get_tablet(write_req.tablet_id,
write_req.schema_hash);
TPublishVersionRequest publish_req;
publish_req.transaction_id = write_req.transaction_id;
TPartitionVersionInfo info;
@@ -486,7 +486,7 @@ class TestSchemaChange : public ::testing::Test {
~TestSchemaChange() { }
void SetUp() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
char buffer[MAX_PATH_LEN];
getcwd(buffer, MAX_PATH_LEN);
config::storage_root_path = std::string(buffer) +
"/data_schema_change";
@@ -591,7 +591,7 @@ TEST_F(TestSchemaChange, schema_change) {
ASSERT_EQ(res, OLAP_SUCCESS);
// publish version success
- TabletSharedPtr tablet =
OLAPEngine::get_instance()->get_tablet(write_req.tablet_id,
write_req.schema_hash);
+ TabletSharedPtr tablet =
StorageEngine::get_instance()->get_tablet(write_req.tablet_id,
write_req.schema_hash);
TPublishVersionRequest publish_req;
publish_req.transaction_id = write_req.transaction_id;
TPartitionVersionInfo info;
diff --git a/be/test/olap/mock_command_executor.h
b/be/test/olap/mock_command_executor.h
index ce389f82..2cf8c552 100644
--- a/be/test/olap/mock_command_executor.h
+++ b/be/test/olap/mock_command_executor.h
@@ -19,11 +19,11 @@
#define DORIS_BE_SRC_OLAP_MOCK_MOCK_COMMAND_EXECUTOR_H
#include "gmock/gmock.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
namespace doris {
-class MockCommandExecutor : public OLAPEngine {
+class MockCommandExecutor : public StorageEngine {
public:
MOCK_METHOD1(create_tablet, OLAPStatus(const TCreateTabletReq& request));
MOCK_METHOD2(get_tablet, TabletSharedPtr(TTabletId tablet_id, TSchemaHash
schema_hash));
diff --git a/be/test/olap/olap_reader_test.cpp
b/be/test/olap/olap_reader_test.cpp
index a996cbd7..fe5a0af8 100755
--- a/be/test/olap/olap_reader_test.cpp
+++ b/be/test/olap/olap_reader_test.cpp
@@ -146,7 +146,7 @@ class TestOLAPReaderRow : public testing::Test {
void TearDown() {
// Remove all dir.
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
_create_tablet.tablet_id,
_create_tablet.tablet_schema.schema_hash);
while (0 == access(_tablet_path.c_str(), F_OK)) {
sleep(1);
@@ -155,7 +155,7 @@ class TestOLAPReaderRow : public testing::Test {
}
void init_olap() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
config::storage_root_path = "./test_run/row_tablet";
remove_all_dir(config::storage_root_path);
ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
@@ -681,7 +681,7 @@ class TestOLAPReaderColumn : public testing::Test {
void TearDown() {
// Remove all dir.
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
_create_tablet.tablet_id,
_create_tablet.tablet_schema.schema_hash);
while (0 == access(_tablet_path.c_str(), F_OK)) {
sleep(1);
@@ -690,7 +690,7 @@ class TestOLAPReaderColumn : public testing::Test {
}
void init_olap() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
config::storage_root_path = "./test_run/column_tablet";
remove_all_dir(config::storage_root_path);
ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
@@ -1165,7 +1165,7 @@ class TestOLAPReaderColumnDeleteCondition : public
testing::Test {
void TearDown() {
// Remove all dir.
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
_create_tablet.tablet_id,
_create_tablet.tablet_schema.schema_hash);
while (0 == access(_tablet_path.c_str(), F_OK)) {
sleep(1);
@@ -1174,7 +1174,7 @@ class TestOLAPReaderColumnDeleteCondition : public
testing::Test {
}
void init_olap() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
config::storage_root_path = "./test_run/row_tablet";
remove_all_dir(config::storage_root_path);
ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
diff --git a/be/test/olap/stream_index_test.cpp
b/be/test/olap/stream_index_test.cpp
index c2c38d57..f8180514 100755
--- a/be/test/olap/stream_index_test.cpp
+++ b/be/test/olap/stream_index_test.cpp
@@ -20,7 +20,7 @@
#include "olap/olap_cond.h"
#include "olap/olap_define.h"
-#include "olap/olap_engine.h"
+#include "olap/storage_engine.h"
#include "olap/olap_header.h"
#include "olap/tablet.h"
#include "olap/olap_common.h"
diff --git a/be/test/olap/vectorized_olap_reader_test.cpp
b/be/test/olap/vectorized_olap_reader_test.cpp
index 3378dada..72d041a0 100644
--- a/be/test/olap/vectorized_olap_reader_test.cpp
+++ b/be/test/olap/vectorized_olap_reader_test.cpp
@@ -148,7 +148,7 @@ class TestVectorizedOLAPReader : public testing::Test {
void TearDown() {
// Remove all dir.
- OLAPEngine::get_instance()->drop_tablet(
+ StorageEngine::get_instance()->drop_tablet(
_create_tablet.tablet_id,
_create_tablet.tablet_schema.schema_hash);
while (0 == access(_tablet_name.c_str(), F_OK)) {
sleep(1);
@@ -157,7 +157,7 @@ class TestVectorizedOLAPReader : public testing::Test {
}
void init_olap_row() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
config::storage_root_path = "./test_run/row_tablet";
remove_all_dir(config::storage_root_path);
ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
@@ -186,7 +186,7 @@ class TestVectorizedOLAPReader : public testing::Test {
}
void init_olap_column() {
- // Create local data dir for OLAPEngine.
+ // Create local data dir for StorageEngine.
config::storage_root_path = "./test_run/column_tablet";
remove_all_dir(config::storage_root_path);
ASSERT_EQ(create_dir(config::storage_root_path), OLAP_SUCCESS);
diff --git a/fe/src/main/java/org/apache/doris/analysis/StringLiteral.java
b/fe/src/main/java/org/apache/doris/analysis/StringLiteral.java
index 98029706..f1f7c60b 100644
--- a/fe/src/main/java/org/apache/doris/analysis/StringLiteral.java
+++ b/fe/src/main/java/org/apache/doris/analysis/StringLiteral.java
@@ -66,7 +66,7 @@ public int compareLiteral(LiteralExpr expr) {
return 1;
}
- // compare string with utf-8 byte array, same with DM,BE,OLAPENGINE
+ // compare string with utf-8 byte array, same with DM,BE,StorageEngine
byte[] thisBytes = null;
byte[] otherBytes = null;
try {
diff --git a/fe/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
b/fe/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
index 21c87db5..a5be8ec2 100644
--- a/fe/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
+++ b/fe/src/main/java/org/apache/doris/planner/SingleNodePlanner.java
@@ -422,7 +422,7 @@ private void turnOffPreAgg(AggregateInfo aggInfo,
SelectStmt selectStmt, Analyze
if (!slot.getColumn().isKey()) {
if (conjunctSlotIds.contains(slot.getId())) {
turnOffReason = "conjunct on " +
slot.getColumn().getName() +
- " which is OlapEngine value column";
+ " which is StorageEngine value column";
valueColumnValidate = false;
break;
}
@@ -529,7 +529,7 @@ private void turnOffPreAgg(AggregateInfo aggInfo,
SelectStmt selectStmt, Analyze
if
(aggExpr.getFnName().getFunction().equalsIgnoreCase("MAX")
&&
aggExpr.getFnName().getFunction().equalsIgnoreCase("MIN")) {
returnColumnValidate = false;
- turnOffReason = "the type of agg on OlapEngine's
Key column should only be MAX or MIN."
+ turnOffReason = "the type of agg on
StorageEngine's Key column should only be MAX or MIN."
+ "agg expr: " + aggExpr.toSql();
break;
}
@@ -592,7 +592,7 @@ private void turnOffPreAgg(AggregateInfo aggInfo,
SelectStmt selectStmt, Analyze
for (SlotDescriptor slot :
selectStmt.getTableRefs().get(0).getDesc().getSlots()) {
if (!slot.getColumn().isKey()) {
if (groupSlotIds.contains(slot.getId())) {
- turnOffReason = "groupExpr contains OlapEngine's
Value";
+ turnOffReason = "groupExpr contains
StorageEngine's Value";
groupExprValidate = false;
break;
}
diff --git a/gensrc/thrift/MetricDefs.thrift b/gensrc/thrift/MetricDefs.thrift
index 66db6314..d12e5394 100644
--- a/gensrc/thrift/MetricDefs.thrift
+++ b/gensrc/thrift/MetricDefs.thrift
@@ -706,20 +706,20 @@ const map<string,TMetricDef> TMetricDefs =
"contexts": [
"PALO_BE"
],
- "description": "Looking count of olapengine's lru cache.",
+ "description": "Looking count of StorageEngine's lru cache.",
"key": "palo_be.olap.lru_cache.lookup_count",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine Lru Cache Lookup Count",
+ "label": "StorageEngine Lru Cache Lookup Count",
"units": Metrics.TUnit.NONE
},
"palo_be.olap.lru_cache.hit_count": {
"contexts": [
"PALO_BE"
],
- "description": "Hit count of olapengine's lru cache.",
+ "description": "Hit count of StorageEngine's lru cache.",
"key": "palo_be.olap.lru_cache.hit_count",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine Lru Cache Hit Count",
+ "label": "StorageEngine Lru Cache Hit Count",
"units": Metrics.TUnit.NONE
},
"palo_be.olap.push_count": {
@@ -729,7 +729,7 @@ const map<string,TMetricDef> TMetricDefs =
"description": "Pushing count over the life of the Palo Be process.",
"key": "palo_be.olap.push_count",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine Pushing Count",
+ "label": "StorageEngine Pushing Count",
"units": Metrics.TUnit.NONE
},
"palo_be.olap.fetch_count": {
@@ -739,7 +739,7 @@ const map<string,TMetricDef> TMetricDefs =
"description": "Fetch count over the life of the Palo Be process.",
"key": "palo_be.olap.fetch_count",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine Fetch Count",
+ "label": "StorageEngine Fetch Count",
"units": Metrics.TUnit.NONE
},
"palo_be.olap.request_count": {
@@ -749,7 +749,7 @@ const map<string,TMetricDef> TMetricDefs =
"description": "Request count over the life of the Palo Be process.",
"key": "palo_be.olap.request_count",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine Request Count",
+ "label": "StorageEngine Request Count",
"units": Metrics.TUnit.NONE
},
"palo_be.olap.be_merge.delta_num": {
@@ -759,7 +759,7 @@ const map<string,TMetricDef> TMetricDefs =
"description": "Base compaction num over the life of the Palo Be
process.",
"key": "palo_be.olap.be_merge.delta_num",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine base compatcion num",
+ "label": "StorageEngine base compatcion num",
"units": Metrics.TUnit.NONE
},
"palo_be.olap.be_merge_size": {
@@ -769,7 +769,7 @@ const map<string,TMetricDef> TMetricDefs =
"description": "Base compaction size over the life of the Palo Be
process.",
"key": "palo_be.olap.be_merge_size",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine base compatcion size",
+ "label": "StorageEngine base compatcion size",
"units": Metrics.TUnit.NONE
},
"palo_be.olap.ce_merge.delta_num": {
@@ -779,7 +779,7 @@ const map<string,TMetricDef> TMetricDefs =
"description": "Cumulative compaction num over the life of the Palo Be
process.",
"key": "palo_be.olap.ce_merge.delta_num",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine cumulative compatcion num",
+ "label": "StorageEngine cumulative compatcion num",
"units": Metrics.TUnit.NONE
},
"palo_be.olap.ce_merge_size": {
@@ -789,7 +789,7 @@ const map<string,TMetricDef> TMetricDefs =
"description": "Cumulative compaction size over the life of the Palo Be
process.",
"key": "palo_be.olap.ce_merge_size",
"kind": Metrics.TMetricKind.COUNTER,
- "label": "OlapEngine cumulative compatcion size",
+ "label": "StorageEngine cumulative compatcion size",
"units": Metrics.TUnit.NONE
},
"palo_be.thrift_server.PaloBackend.connections_in_use": {
diff --git a/run-ut.sh b/run-ut.sh
index a0aea8cf..bfe6d9bd 100755
--- a/run-ut.sh
+++ b/run-ut.sh
@@ -183,7 +183,7 @@ ${DORIS_TEST_BINARY_DIR}/http/metrics_action_test
${DORIS_TEST_BINARY_DIR}/http/http_utils_test
${DORIS_TEST_BINARY_DIR}/http/stream_load_test
-# Running OLAPEngine Unittest
+# Running StorageEngine Unittest
${DORIS_TEST_BINARY_DIR}/olap/bit_field_test
${DORIS_TEST_BINARY_DIR}/olap/byte_buffer_test
${DORIS_TEST_BINARY_DIR}/olap/run_length_byte_test
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]