Skip to content

Commit

Permalink
Revert "[Enhancement](show-backends-disks) Add show backends disks (a…
Browse files Browse the repository at this point in the history
…pache#24229)" (apache#25389)

This reverts commit 21223e6.
  • Loading branch information
yiguolei authored Oct 13, 2023
1 parent 6f9a084 commit 6757d2f
Show file tree
Hide file tree
Showing 27 changed files with 20 additions and 502 deletions.
21 changes: 1 addition & 20 deletions be/src/agent/task_worker_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <fmt/format.h>
#include <gen_cpp/AgentService_types.h>
#include <gen_cpp/HeartbeatService_types.h>
#include <gen_cpp/MasterService_types.h>
#include <gen_cpp/Status_types.h>
#include <gen_cpp/Types_types.h>
#include <unistd.h>
Expand Down Expand Up @@ -54,7 +55,6 @@
#include "olap/olap_common.h"
#include "olap/rowset/rowset_meta.h"
#include "olap/snapshot_manager.h"
#include "olap/special_dir.h"
#include "olap/storage_engine.h"
#include "olap/storage_policy.h"
#include "olap/tablet.h"
Expand Down Expand Up @@ -677,13 +677,8 @@ void TaskWorkerPool::_report_disk_state_worker_thread_callback() {
disk.__set_disk_available_capacity(root_path_info.available);
disk.__set_trash_used_capacity(root_path_info.trash_used_capacity);
disk.__set_used(root_path_info.is_used);
disk.__set_dir_type(TDiskType::STORAGE);
request.disks[root_path_info.path] = disk;
}

_set_disk_infos(request, TDiskType::LOG);
_set_disk_infos(request, TDiskType::DEPLOY);

request.__set_num_cores(CpuInfo::num_cores());
request.__set_pipeline_executor_size(config::pipeline_executor_size > 0
? config::pipeline_executor_size
Expand Down Expand Up @@ -1101,20 +1096,6 @@ void TaskWorkerPool::_handle_report(const TReportRequest& request, ReportType ty
}
}

void TaskWorkerPool::_set_disk_infos(TReportRequest& request, TDiskType::type type) {
SpecialDirInfo dir_info;
StorageEngine::instance()->get_special_dir_info(&dir_info, type);

TDisk special_disk;
special_disk.__set_root_path(dir_info.path);
special_disk.__set_data_used_capacity(0);
special_disk.__set_disk_total_capacity(dir_info.capacity);
special_disk.__set_disk_available_capacity(dir_info.available);
special_disk.__set_used(dir_info.is_used);
special_disk.__set_dir_type(type);
request.disks[dir_info.path] = special_disk;
}

void TaskWorkerPool::_random_sleep(int second) {
Random rnd(UnixMillis());
sleep(rnd.Uniform(second) + 1);
Expand Down
2 changes: 0 additions & 2 deletions be/src/agent/task_worker_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <butil/macros.h>
#include <gen_cpp/AgentService_types.h>
#include <gen_cpp/MasterService_types.h>
#include <gen_cpp/Types_types.h>
#include <stdint.h>

Expand Down Expand Up @@ -212,7 +211,6 @@ class TaskWorkerPool {
TFinishTaskRequest* finish_task_request);

void _handle_report(const TReportRequest& request, ReportType type);
void _set_disk_infos(TReportRequest& request, TDiskType::type type);

Status _get_tablet_info(const TTabletId tablet_id, const TSchemaHash schema_hash,
int64_t signature, TTabletInfo* tablet_info);
Expand Down
9 changes: 0 additions & 9 deletions be/src/olap/olap_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,11 @@ struct DataDirInfo {
bool is_used = false; // whether available mark
TStorageMedium::type storage_medium = TStorageMedium::HDD; // Storage medium type: SSD|HDD
};

struct SpecialDirInfo {
std::string path;
int64_t capacity = 1; // actual disk capacity
int64_t available = 0; // available space, in bytes unit
bool is_used = false;
};

struct PredicateFilterInfo {
int type = 0;
uint64_t input_row = 0;
uint64_t filtered_row = 0;
};

// Sort DataDirInfo by available space.
struct DataDirInfoLessAvailability {
bool operator()(const DataDirInfo& left, const DataDirInfo& right) const {
Expand Down
67 changes: 0 additions & 67 deletions be/src/olap/special_dir.cpp

This file was deleted.

57 changes: 0 additions & 57 deletions be/src/olap/special_dir.h

This file was deleted.

22 changes: 1 addition & 21 deletions be/src/olap/storage_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ StorageEngine::StorageEngine(const EngineOptions& options)
_calc_delete_bitmap_executor(nullptr),
_default_rowset_type(BETA_ROWSET),
_heartbeat_flags(nullptr),
_stream_load_recorder(nullptr),
_log_dir(new SpecialDir(config::sys_log_dir)),
_deploy_dir(new SpecialDir(std::string(std::getenv("DORIS_HOME")))) {
_stream_load_recorder(nullptr) {
REGISTER_HOOK_METRIC(unused_rowsets_count, [this]() {
// std::lock_guard<std::mutex> lock(_gc_mutex);
return _unused_rowsets.size();
Expand Down Expand Up @@ -362,24 +360,6 @@ Status StorageEngine::get_all_data_dir_info(std::vector<DataDirInfo>* data_dir_i
return res;
}

void StorageEngine::get_special_dir_info(SpecialDirInfo* special_dir_infos, TDiskType::type type) {
switch (type) {
case TDiskType::LOG:
_log_dir->health_check();
static_cast<void>(_log_dir->update_capacity());
_log_dir->get_dir_info(special_dir_infos);
break;
case TDiskType::DEPLOY:
_deploy_dir->health_check();
static_cast<void>(_deploy_dir->update_capacity());
_deploy_dir->get_dir_info(special_dir_infos);
break;
default:
break;
}
return;
}

int64_t StorageEngine::get_file_or_directory_size(const std::string& file_path) {
if (!std::filesystem::exists(file_path)) {
return 0;
Expand Down
5 changes: 0 additions & 5 deletions be/src/olap/storage_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include "olap/rowset/rowset.h"
#include "olap/rowset/rowset_id_generator.h"
#include "olap/rowset/segment_v2/segment.h"
#include "olap/special_dir.h"
#include "olap/tablet.h"
#include "olap/task/index_builder.h"
#include "runtime/exec_env.h"
Expand All @@ -55,7 +54,6 @@
namespace doris {

class DataDir;
class SpecialDir;
class EngineTask;
class MemTableFlushExecutor;
class SegcompactionWorker;
Expand Down Expand Up @@ -103,7 +101,6 @@ class StorageEngine {

// get all info of root_path
Status get_all_data_dir_info(std::vector<DataDirInfo>* data_dir_infos, bool need_update);
void get_special_dir_info(SpecialDirInfo* dir_infos, TDiskType::type type);

int64_t get_file_or_directory_size(const std::string& file_path);

Expand Down Expand Up @@ -474,8 +471,6 @@ class StorageEngine {
std::condition_variable _compaction_producer_sleep_cv;

std::shared_ptr<StreamLoadRecorder> _stream_load_recorder;
std::unique_ptr<SpecialDir> _log_dir;
std::unique_ptr<SpecialDir> _deploy_dir;

// we use unordered_map to store all cumulative compaction policy sharded ptr
std::unordered_map<std::string_view, std::shared_ptr<CumulativeCompactionPolicy>>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ mysql> show frontends disks;

### Keywords

SHOW, FRONTENDS, DISK, DISKS
SHOW, FRONTENDS

### Best Practice

Loading

0 comments on commit 6757d2f

Please sign in to comment.