Skip to content

Commit

Permalink
chore: fix unit test and add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CookiePieWw committed Jan 17, 2025
1 parent a57b6e5 commit 861ba85
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/common/meta/src/wal_options_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ mod tests {
..Default::default()
};
let kv_backend = Arc::new(MemoryKvBackend::new()) as KvBackendRef;
let topic_pool = KafkaTopicPool::new(config.clone(), kv_backend);
let mut topic_pool = KafkaTopicPool::new(config.clone(), kv_backend);
topic_pool.topics.clone_from(&topics);

// Creates an options allocator.
let allocator = WalOptionsAllocator::Kafka(topic_pool);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::wal_options_allocator::selector::{RoundRobinTopicSelector, TopicSelec
/// 2. Creates topics in kafka.
/// 3. Selects topic
pub struct KafkaTopicPool {
topics: Vec<String>,
pub(crate) topics: Vec<String>,
topic_kvbackend_manager: TopicKvBackendManager,
topic_kafka_manager: TopicKafkaManager,
selector: TopicSelectorRef,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::error::{
// The `DEFAULT_PARTITION` refers to the index of the partition.
const DEFAULT_PARTITION: i32 = 0;

/// Manages topics in kafka.
/// Creates topics in kafka.
pub struct TopicKafkaManager {
pub(super) config: MetasrvKafkaConfig,
}
Expand Down
4 changes: 4 additions & 0 deletions src/common/meta/src/wal_options_allocator/kvbackend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ use crate::error::Result;
use crate::key::topic_name::{TopicNameKey, TopicNameKeyManager};
use crate::kv_backend::KvBackendRef;

/// Manages topics in kvbackend.
/// Responsible for:
/// 1. Restors and persisting topics in kvbackend.

Check warning on line 23 in src/common/meta/src/wal_options_allocator/kvbackend.rs

View workflow job for this annotation

GitHub Actions / Check typos and docs

"Restors" should be "Restores".
/// 2. Clears topics in legacy format and restores them in the new format.
pub struct TopicKvBackendManager {
manager: TopicNameKeyManager,
}
Expand Down

0 comments on commit 861ba85

Please sign in to comment.