Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#84] config 기반 실행 구현 #88

Merged
merged 4 commits into from
Jun 21, 2024
Merged

[#84] config 기반 실행 구현 #88

merged 4 commits into from
Jun 21, 2024

Conversation

myyrakle
Copy link
Owner

@myyrakle myyrakle commented Mar 31, 2024

resolved: #84

설명

일부 기능 구현 및 개선, 리팩토링

@myyrakle myyrakle self-assigned this Mar 31, 2024
@myyrakle myyrakle linked an issue Mar 31, 2024 that may be closed by this pull request
@myyrakle myyrakle added the feature new feature unit label Mar 31, 2024
@myyrakle myyrakle requested review from DPS0340 and wHoIsDReAmer June 20, 2024 15:49
)]
pub host: String,
#[clap(name = "config", long, help = "config file path")]
pub config: Option<String>,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config 파일을 넘겨서 실행하는 형태로 정리

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

없으면 OS별 기본 config 경로를 사용

pub const DEFAULT_CONFIG_BASEPATH: &str = "C:\\Program Files\\rrdb";

// #[cfg(target_os = "macos")]
// TODO: MacOS 경로 추가
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

플랫폼별 처리 로직을 일단 상수로 정리

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그리고 별도 디렉터리가 필요한 사이즈는 아니라서 정리 차원에서 파일로 내림

@@ -11,7 +11,7 @@ impl Executor {
pub async fn get_table_config(&self, table_name: TableName) -> Result<TableConfig, RRDBError> {
let encoder = StorageEncoder::new();

let base_path = self.get_base_path();
let base_path = self.get_data_directory();
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이젠 전반적으로 data directory를 직접 가져와서 거기다 저장하는 형태로 변경
(data directory는 설정하기에 따라서 유동적으로 변경할 수 있어야 함)

@@ -13,12 +16,14 @@ use tokio::sync::mpsc;
use super::client::ClientInfo;

pub struct Server {
pub option: ServerOption,
pub config: Arc<GlobalConfig>,
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

설정 정보들은 서버가 들고 있다가 executor에게 전달해줘야함 (data directory 등의 정보를 전달하기 위함)

@myyrakle myyrakle changed the title [#84] config.yaml 기반 실행 구현 [#84] config 기반 실행 구현 Jun 20, 2024
@myyrakle myyrakle merged commit 903fc00 into master Jun 21, 2024
1 check passed
@myyrakle myyrakle deleted the feat/#84 branch June 21, 2024 02:32
Copy link
Collaborator

@DPS0340 DPS0340 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature unit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI: config.yaml 기반 실행 구현
3 participants