Skip to content

Commit

Permalink
chore: apply suggestions from CR
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Jan 4, 2024
1 parent 1f5dbc9 commit aa2d4bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/metric-engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ impl RegionEngine for MetricEngine {
/// Note: Returns `None` if it's a logical region.
async fn region_disk_usage(&self, region_id: RegionId) -> Option<i64> {
if self.inner.is_physical_region(region_id).await {
None
} else {
self.inner.mito.region_disk_usage(region_id).await
} else {
None
}
}

Expand Down Expand Up @@ -203,9 +203,9 @@ impl RegionEngine for MetricEngine {
/// Note: Returns `None` if it's a logical region.
async fn role(&self, region_id: RegionId) -> Option<RegionRole> {
if self.inner.is_physical_region(region_id).await {
None
} else {
self.inner.mito.role(region_id).await
} else {
None
}
}

Expand Down Expand Up @@ -319,7 +319,7 @@ mod test {
let physical_region_id = env.default_physical_region_id();

assert!(env.metric().role(logical_region_id).await.is_none());
assert!(env.metric().role(physical_region_id).await.is_none());
assert!(env.metric().role(physical_region_id).await.is_some());
}

#[tokio::test]
Expand All @@ -339,6 +339,6 @@ mod test {
.metric()
.region_disk_usage(physical_region_id)
.await
.is_none());
.is_some());
}
}

0 comments on commit aa2d4bb

Please sign in to comment.