@@ -21,6 +21,8 @@ use crate::store::local::layers::{Handler, OperatorBuilder};
2121use crate :: store:: local:: options:: WriteOptions ;
2222use crate :: store:: local:: read_options:: ReadOptions ;
2323use crate :: store:: local:: sync_io:: SyncLocalIO ;
24+ #[ cfg( feature = "io-uring" ) ]
25+ use crate :: store:: local:: uring_io:: UringIoEngineBuilder ;
2426use crate :: store:: local:: { DiskStat , FileStat , LocalDiskStorage , LocalIO } ;
2527use crate :: store:: DataBytes ;
2628use crate :: util;
@@ -95,7 +97,24 @@ impl LocalDiskDelegator {
9597 Some ( read_capacity. as_u64 ( ) as usize ) ,
9698 ) ;
9799
100+ #[ cfg( feature = "io-uring" ) ]
101+ info ! ( "Binary compiled with the io-uring feature enabled." ) ;
102+
103+ #[ cfg( feature = "io-uring" ) ]
104+ let mut operator_builder = if let Some ( cfg) = & config. io_uring_options {
105+ info ! ( "io-uring engine is activated!" ) ;
106+ OperatorBuilder :: new ( Arc :: new ( Box :: new (
107+ UringIoEngineBuilder :: new ( )
108+ . build ( underlying_io_handler)
109+ . unwrap ( ) ,
110+ ) ) )
111+ } else {
112+ OperatorBuilder :: new ( Arc :: new ( Box :: new ( underlying_io_handler) ) )
113+ } ;
114+
115+ #[ cfg( not( feature = "io-uring" ) ) ]
98116 let mut operator_builder = OperatorBuilder :: new ( Arc :: new ( Box :: new ( underlying_io_handler) ) ) ;
117+
99118 if let Some ( conf) = config. io_limiter . as_ref ( ) {
100119 operator_builder = operator_builder. layer ( ThrottleLayer :: new (
101120 & runtime_manager. localfile_write_runtime ,
0 commit comments