Skip to content

Commit

Permalink
remove unnecessary clone, make fields in Shard private.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Jul 11, 2023
1 parent 90a9886 commit 78a7de8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions cluster/src/shard_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,14 @@ impl ShardOperator {
}

// Create the table by operator afterwards.
let catalog_name = ctx.catalog;

let (table_engine, partition_info) = match table_info.partition_info.clone() {
Some(v) => (ctx.partition_table_engine.clone(), Some(v)),
None => (ctx.table_engine.clone(), None),
};

// Build create table request and options.
let create_table_request = CreateTableRequest {
catalog_name: catalog_name.clone(),
catalog_name: ctx.catalog,
schema_name: table_info.schema_name.clone(),
table_name: table_info.name.clone(),
table_id: Some(TableId::new(table_info.id)),
Expand Down
4 changes: 2 additions & 2 deletions cluster/src/shard_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ impl ShardSet {
///
/// NOTICE: all write operations on a shard will be performed sequentially.
pub struct Shard {
pub data: ShardDataRef,
pub operator: tokio::sync::Mutex<ShardOperator>,
data: ShardDataRef,
operator: tokio::sync::Mutex<ShardOperator>,
}

impl std::fmt::Debug for Shard {
Expand Down

0 comments on commit 78a7de8

Please sign in to comment.