Skip to content

Commit

Permalink
fix: the empty default value of intermediate_path
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 committed Jun 26, 2024
1 parent 71b4b2e commit b51d8bf
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions config/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
| `region_engine.mito.inverted_index.create_on_compaction` | String | `auto` | Whether to create the index on compaction.<br/>- `auto`: automatically<br/>- `disable`: never |
| `region_engine.mito.inverted_index.apply_on_query` | String | `auto` | Whether to apply the index on query<br/>- `auto`: automatically<br/>- `disable`: never |
| `region_engine.mito.inverted_index.mem_threshold_on_create` | String | `64M` | Memory threshold for performing an external sort during index creation.<br/>Setting to empty will disable external sorting, forcing all sorting operations to happen in memory. |
| `region_engine.mito.inverted_index.intermediate_path` | String | `""` | File system path to store intermediate files for external sorting (default `{data_home}/index_intermediate`). |
| `region_engine.mito.inverted_index.intermediate_path` | String | `/tmp/greptimedb/index_intermediate/` | File system path to store intermediate files for external sorting (default `{data_home}/index_intermediate`). |
| `region_engine.mito.memtable` | -- | -- | -- |
| `region_engine.mito.memtable.type` | String | `time_series` | Memtable type.<br/>- `time_series`: time-series memtable<br/>- `partition_tree`: partition tree memtable (experimental) |
| `region_engine.mito.memtable.index_max_keys_per_shard` | Integer | `8192` | The max number of keys in one shard.<br/>Only available for `partition_tree` memtable. |
Expand Down Expand Up @@ -403,7 +403,7 @@
| `region_engine.mito.inverted_index.create_on_compaction` | String | `auto` | Whether to create the index on compaction.<br/>- `auto`: automatically<br/>- `disable`: never |
| `region_engine.mito.inverted_index.apply_on_query` | String | `auto` | Whether to apply the index on query<br/>- `auto`: automatically<br/>- `disable`: never |
| `region_engine.mito.inverted_index.mem_threshold_on_create` | String | `64M` | Memory threshold for performing an external sort during index creation.<br/>Setting to empty will disable external sorting, forcing all sorting operations to happen in memory. |
| `region_engine.mito.inverted_index.intermediate_path` | String | `""` | File system path to store intermediate files for external sorting (default `{data_home}/index_intermediate`). |
| `region_engine.mito.inverted_index.intermediate_path` | String | `/tmp/greptimedb/index_intermediate/` | File system path to store intermediate files for external sorting (default `{data_home}/index_intermediate`). |
| `region_engine.mito.memtable` | -- | -- | -- |
| `region_engine.mito.memtable.type` | String | `time_series` | Memtable type.<br/>- `time_series`: time-series memtable<br/>- `partition_tree`: partition tree memtable (experimental) |
| `region_engine.mito.memtable.index_max_keys_per_shard` | Integer | `8192` | The max number of keys in one shard.<br/>Only available for `partition_tree` memtable. |
Expand Down
2 changes: 1 addition & 1 deletion config/datanode.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ apply_on_query = "auto"
mem_threshold_on_create = "64M"

## File system path to store intermediate files for external sorting (default `{data_home}/index_intermediate`).
intermediate_path = ""
intermediate_path = "/tmp/greptimedb/index_intermediate/"

[region_engine.mito.memtable]
## Memtable type.
Expand Down
2 changes: 1 addition & 1 deletion config/standalone.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ apply_on_query = "auto"
mem_threshold_on_create = "64M"

## File system path to store intermediate files for external sorting (default `{data_home}/index_intermediate`).
intermediate_path = ""
intermediate_path = "/tmp/greptimedb/index_intermediate/"

[region_engine.mito.memtable]
## Memtable type.
Expand Down
3 changes: 3 additions & 0 deletions src/common/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ use common_base::readable_size::ReadableSize;
pub use config::*;
use serde::{Deserialize, Serialize};

/// Default data home in file storage.
pub const DEFAULT_DATA_HOME: &str = "/tmp/greptimedb";

pub fn metadata_store_dir(store_dir: &str) -> String {
format!("{store_dir}/metadata")
}
Expand Down
5 changes: 1 addition & 4 deletions src/datanode/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ use servers::Mode;

pub const DEFAULT_OBJECT_STORE_CACHE_SIZE: ReadableSize = ReadableSize::mb(256);

/// Default data home in file storage
const DEFAULT_DATA_HOME: &str = "/tmp/greptimedb";

/// Object storage config
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[serde(tag = "type")]
Expand Down Expand Up @@ -72,7 +69,7 @@ pub struct StorageConfig {
impl Default for StorageConfig {
fn default() -> Self {
Self {
data_home: DEFAULT_DATA_HOME.to_string(),
data_home: common_config::DEFAULT_DATA_HOME.to_string(),
store: ObjectStoreConfig::default(),
providers: vec![],
}
Expand Down
2 changes: 1 addition & 1 deletion src/mito2/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl Default for InvertedIndexConfig {
apply_on_query: Mode::Auto,
write_buffer_size: ReadableSize::mb(8),
mem_threshold_on_create: Some(ReadableSize::mb(64)),
intermediate_path: String::new(),
intermediate_path: join_dir(common_config::DEFAULT_DATA_HOME, "index_intermediate"),
}
}
}
Expand Down

0 comments on commit b51d8bf

Please sign in to comment.