Skip to content

Commit b63df21

Browse files
authored
chore(*): fix warnings on non-linux platforms (#7397)
Fix the warnings introduced by #7305 Approved-By: st1page Approved-By: yuhao-su Approved-By: BugenZhao Approved-By: BowenXiao1999 Approved-By: ice1000
1 parent cee5a49 commit b63df21

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/compute/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#![feature(type_alias_impl_trait)]
1919
#![feature(let_chains)]
2020
#![feature(result_option_inspect)]
21-
#![feature(allocator_api)]
21+
#![feature(lint_reasons)]
2222
#![cfg_attr(coverage, feature(no_coverage))]
2323

2424
#[macro_use]

src/compute/src/memory_management/memory_manager.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,24 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use std::sync::atomic::{AtomicU64, Ordering};
15+
use std::sync::atomic::AtomicU64;
1616
use std::sync::Arc;
17+
#[cfg(target_os = "linux")]
1718
use std::time::Duration;
1819

1920
use risingwave_batch::task::BatchManager;
21+
#[cfg(target_os = "linux")]
2022
use risingwave_common::util::epoch::Epoch;
2123
use risingwave_stream::executor::monitor::StreamingMetrics;
2224
use risingwave_stream::task::LocalStreamManager;
2325
#[cfg(target_os = "linux")]
2426
use tikv_jemalloc_ctl::{epoch as jemalloc_epoch, stats as jemalloc_stats};
27+
#[cfg(target_os = "linux")]
2528
use tracing;
2629

2730
/// When `enable_managed_cache` is set, compute node will launch a [`GlobalMemoryManager`] to limit
2831
/// the memory usage.
32+
#[cfg_attr(not(target_os = "linux"), expect(dead_code))]
2933
pub struct GlobalMemoryManager {
3034
/// All cached data before the watermark should be evicted.
3135
watermark_epoch: Arc<AtomicU64>,
@@ -39,7 +43,9 @@ pub struct GlobalMemoryManager {
3943
pub type GlobalMemoryManagerRef = Arc<GlobalMemoryManager>;
4044

4145
impl GlobalMemoryManager {
46+
#[cfg(target_os = "linux")]
4247
const EVICTION_THRESHOLD_AGGRESSIVE: f64 = 0.9;
48+
#[cfg(target_os = "linux")]
4349
const EVICTION_THRESHOLD_GRACEFUL: f64 = 0.7;
4450

4551
pub fn new(
@@ -63,7 +69,10 @@ impl GlobalMemoryManager {
6369
self.watermark_epoch.clone()
6470
}
6571

72+
#[cfg(target_os = "linux")]
6673
fn set_watermark_time_ms(&self, time_ms: u64) {
74+
use std::sync::atomic::Ordering;
75+
6776
let epoch = Epoch::from_physical_time(time_ms).0;
6877
let watermark_epoch = self.watermark_epoch.as_ref();
6978
watermark_epoch.store(epoch, Ordering::Relaxed);

0 commit comments

Comments
 (0)