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 f8c38ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions cluster/src/shard_operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ impl ShardOperator {
(shard_info, tables)
};

// Lock the shard in local, and then recover it.
info!("ShardOperator open sequentially begin, shard_id:{shard_info:?}");

let table_defs = tables
Expand Down Expand Up @@ -227,16 +226,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 f8c38ed

Please sign in to comment.