Skip to content

Commit 655d2bd

Browse files
authored
feat(sst-dump): support more features (risingwavelabs#8580)
1 parent 8648ff8 commit 655d2bd

File tree

13 files changed

+312
-114
lines changed

13 files changed

+312
-114
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ctl/src/cmd_impl/bench.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use size::Size;
2626
use tokio::task::JoinHandle;
2727

2828
use super::table::{get_table_catalog, make_state_table};
29+
use crate::common::HummockServiceOpts;
2930
use crate::CtlContext;
3031

3132
#[derive(Subcommand)]
@@ -37,6 +38,7 @@ pub enum BenchCommands {
3738
/// number of futures doing scan
3839
#[clap(long, default_value_t = 1)]
3940
threads: usize,
41+
data_dir: Option<String>,
4042
},
4143
}
4244

@@ -74,11 +76,17 @@ impl InterestedMetrics {
7476

7577
pub async fn do_bench(context: &CtlContext, cmd: BenchCommands) -> Result<()> {
7678
let meta = context.meta_client().await?;
77-
let (hummock, metrics) = context.hummock_store_with_metrics().await?;
7879
let next_cnt = Arc::new(AtomicU64::new(0));
7980
let iter_cnt = Arc::new(AtomicU64::new(0));
8081
match cmd {
81-
BenchCommands::Scan { mv_name, threads } => {
82+
BenchCommands::Scan {
83+
mv_name,
84+
threads,
85+
data_dir,
86+
} => {
87+
let (hummock, metrics) = context
88+
.hummock_store_with_metrics(HummockServiceOpts::from_env(data_dir)?)
89+
.await?;
8290
let table = get_table_catalog(meta.clone(), mv_name).await?;
8391
let mut handlers = vec![];
8492
for i in 0..threads {

src/ctl/src/cmd_impl/hummock/list_kv.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ use core::ops::Bound::Unbounded;
1717
use risingwave_common::catalog::TableId;
1818
use risingwave_storage::store::{PrefetchOptions, ReadOptions, StateStoreReadExt};
1919

20+
use crate::common::HummockServiceOpts;
2021
use crate::CtlContext;
2122

22-
pub async fn list_kv(context: &CtlContext, epoch: u64, table_id: u32) -> anyhow::Result<()> {
23-
let hummock = context.hummock_store().await?;
23+
pub async fn list_kv(
24+
context: &CtlContext,
25+
epoch: u64,
26+
table_id: u32,
27+
data_dir: Option<String>,
28+
) -> anyhow::Result<()> {
29+
let hummock = context
30+
.hummock_store(HummockServiceOpts::from_env(data_dir)?)
31+
.await?;
2432
if epoch == u64::MAX {
2533
tracing::info!("using u64::MAX as epoch");
2634
}

0 commit comments

Comments
 (0)