Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Little-Wallace <[email protected]>
  • Loading branch information
Little-Wallace committed May 16, 2024
1 parent 3ccc35c commit 059e527
Showing 1 changed file with 27 additions and 41 deletions.
68 changes: 27 additions & 41 deletions src/storage/benches/bench_multi_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use risingwave_storage::hummock::iterator::{ConcatIterator, ConcatIteratorInner,
use risingwave_storage::hummock::multi_builder::{CapacitySplitTableBuilder, TableBuilderFactory};
use risingwave_storage::hummock::value::HummockValue;
use risingwave_storage::hummock::{
BackwardSstableIterator, BatchSstableWriterFactory, CachePolicy, FileCache, HummockResult,
BackwardSstableIterator, BatchSstableWriterFactory, CachePolicy, HummockResult,
MemoryLimiter, SstableBuilder, SstableBuilderOptions, SstableIteratorReadOptions, SstableStore,
SstableStoreConfig, SstableWriterFactory, SstableWriterOptions, StreamingSstableWriterFactory,
Xor16FilterBuilder,
Expand Down Expand Up @@ -131,23 +131,33 @@ async fn build_tables<F: SstableWriterFactory>(
ssts
}

fn generate_sstable_store(object_store: Arc<ObjectStoreImpl>) -> SstableStore {
SstableStore::new(SstableStoreConfig {
async fn generate_sstable_store(object_store: Arc<ObjectStoreImpl>) -> Arc<SstableStore> {
let meta_cache_v2 = HybridCacheBuilder::new()
.memory(64 << 20)
.with_shards(2)
.storage()
.build()
.await
.unwrap();
let block_cache_v2 = HybridCacheBuilder::new()
.memory(128 << 20)
.with_shards(2)
.storage()
.build()
.await
.unwrap();
Arc::new(SstableStore::new(SstableStoreConfig {
store: object_store,
path: "test".to_string(),
block_cache_capacity: 64 << 20,
meta_cache_capacity: 128 << 20,
meta_cache_shard_num: 2,
block_cache_shard_num: 2,
block_cache_eviction: EvictionConfig::for_test(),
meta_cache_eviction: EvictionConfig::for_test(),
prefetch_buffer_capacity: 64 << 20,
max_prefetch_block_number: 16,
data_file_cache: FileCache::none(),
meta_file_cache: FileCache::none(),
recent_filter: None,
state_store_metrics: Arc::new(global_hummock_state_store_metrics(MetricLevel::Disabled)),
})
state_store_metrics: Arc::new(global_hummock_state_store_metrics(
MetricLevel::Disabled,
)),
meta_cache_v2,
block_cache_v2,
}))
}

fn bench_builder(
Expand All @@ -171,34 +181,8 @@ fn bench_builder(
});
let object_store = Arc::new(ObjectStoreImpl::S3(object_store));


let sstable_store = runtime.block_on(async {
let meta_cache_v2 = HybridCacheBuilder::new()
.memory(64 << 20)
.with_shards(2)
.storage()
.build()
.await
.unwrap();
let block_cache_v2 = HybridCacheBuilder::new()
.memory(128 << 20)
.with_shards(2)
.storage()
.build()
.await
.unwrap();
Arc::new(SstableStore::new(SstableStoreConfig {
store: object_store,
path: "test".to_string(),
prefetch_buffer_capacity: 64 << 20,
max_prefetch_block_number: 16,
recent_filter: None,
state_store_metrics: Arc::new(global_hummock_state_store_metrics(
MetricLevel::Disabled,
)),
meta_cache_v2,
block_cache_v2,
}))
generate_sstable_store(object_store).await
});

let mut group = c.benchmark_group("bench_multi_builder");
Expand Down Expand Up @@ -255,7 +239,9 @@ fn bench_table_scan(c: &mut Criterion) {
Arc::new(ObjectStoreConfig::default()),
);
let object_store = Arc::new(ObjectStoreImpl::InMem(store));
let sstable_store = Arc::new(generate_sstable_store(object_store));
let sstable_store = runtime.block_on(async {
generate_sstable_store(object_store).await
});

let ssts = runtime.block_on(async {
build_tables(CapacitySplitTableBuilder::for_test(
Expand Down

0 comments on commit 059e527

Please sign in to comment.