@@ -15,7 +15,7 @@ use nodedb_raft::message::LogEntry;
1515use crate :: catalog:: ClusterCatalog ;
1616use crate :: conf_change:: ConfChange ;
1717use crate :: error:: Result ;
18- use crate :: forward:: RequestForwarder ;
18+ use crate :: forward:: { NoopPlanExecutor , PlanExecutor } ;
1919use crate :: metadata_group:: applier:: { MetadataApplier , NoopMetadataApplier } ;
2020use crate :: multi_raft:: MultiRaft ;
2121use crate :: topology:: ClusterTopology ;
@@ -53,17 +53,20 @@ pub type VShardEnvelopeHandler = Arc<
5353/// ticks. Implements [`crate::transport::RaftRpcHandler`] (in
5454/// [`super::handle_rpc`]) so it can be passed directly to
5555/// [`NexarTransport::serve`] for incoming RPC dispatch.
56- pub struct RaftLoop < A : CommitApplier , F : RequestForwarder = crate :: forward:: NoopForwarder > {
56+ ///
57+ /// The `F: RequestForwarder` generic parameter was removed in C-δ.6 when the
58+ /// SQL-string forwarding path was retired. Cross-node SQL routing now goes
59+ /// through `gateway.execute / ExecuteRequest` (C-β path).
60+ pub struct RaftLoop < A : CommitApplier , P : PlanExecutor = NoopPlanExecutor > {
5761 pub ( super ) node_id : u64 ,
5862 pub ( super ) multi_raft : Arc < Mutex < MultiRaft > > ,
5963 pub ( super ) transport : Arc < NexarTransport > ,
6064 pub ( super ) topology : Arc < RwLock < ClusterTopology > > ,
6165 pub ( super ) applier : A ,
6266 /// Applies committed entries from the metadata Raft group (group 0).
63- /// Every node has one; defaults to a no-op until the host crate wires
64- /// in a real [`MetadataApplier`] via [`Self::with_metadata_applier`].
6567 pub ( super ) metadata_applier : Arc < dyn MetadataApplier > ,
66- pub ( super ) forwarder : Arc < F > ,
68+ /// Executes incoming `ExecuteRequest` RPCs without SQL re-planning.
69+ pub ( super ) plan_executor : Arc < P > ,
6770 pub ( super ) tick_interval : Duration ,
6871 /// Optional handler for incoming VShardEnvelope messages.
6972 /// Set when the Event Plane or other subsystems need cross-node messaging.
@@ -119,7 +122,7 @@ impl<A: CommitApplier> RaftLoop<A> {
119122 topology,
120123 applier,
121124 metadata_applier : Arc :: new ( NoopMetadataApplier ) ,
122- forwarder : Arc :: new ( crate :: forward :: NoopForwarder ) ,
125+ plan_executor : Arc :: new ( NoopPlanExecutor ) ,
123126 tick_interval : DEFAULT_TICK_INTERVAL ,
124127 vshard_handler : None ,
125128 catalog : None ,
@@ -129,31 +132,22 @@ impl<A: CommitApplier> RaftLoop<A> {
129132 }
130133}
131134
132- impl < A : CommitApplier , F : RequestForwarder > RaftLoop < A , F > {
133- /// Create a RaftLoop with a custom request forwarder (for cluster mode).
134- pub fn with_forwarder (
135- multi_raft : MultiRaft ,
136- transport : Arc < NexarTransport > ,
137- topology : Arc < RwLock < ClusterTopology > > ,
138- applier : A ,
139- forwarder : Arc < F > ,
140- ) -> Self {
141- let node_id = multi_raft. node_id ( ) ;
142- let ( shutdown_watch, _) = tokio:: sync:: watch:: channel ( false ) ;
143- let ( ready_watch, _) = tokio:: sync:: watch:: channel ( false ) ;
144- Self {
145- node_id,
146- multi_raft : Arc :: new ( Mutex :: new ( multi_raft) ) ,
147- transport,
148- topology,
149- applier,
150- metadata_applier : Arc :: new ( NoopMetadataApplier ) ,
151- forwarder,
152- tick_interval : DEFAULT_TICK_INTERVAL ,
153- vshard_handler : None ,
154- catalog : None ,
155- shutdown_watch,
156- ready_watch,
135+ impl < A : CommitApplier , P : PlanExecutor > RaftLoop < A , P > {
136+ /// Install a custom plan executor (for cluster mode — C-β path).
137+ pub fn with_plan_executor < P2 : PlanExecutor > ( self , executor : Arc < P2 > ) -> RaftLoop < A , P2 > {
138+ RaftLoop {
139+ node_id : self . node_id ,
140+ multi_raft : self . multi_raft ,
141+ transport : self . transport ,
142+ topology : self . topology ,
143+ applier : self . applier ,
144+ metadata_applier : self . metadata_applier ,
145+ plan_executor : executor,
146+ tick_interval : self . tick_interval ,
147+ vshard_handler : self . vshard_handler ,
148+ catalog : self . catalog ,
149+ shutdown_watch : self . shutdown_watch ,
150+ ready_watch : self . ready_watch ,
157151 }
158152 }
159153
0 commit comments