@@ -5,13 +5,13 @@ use super::job::{IndexedRequest, Job, JobResult};
55use super :: StoreSegmentRequest ;
66use libsql_sys:: name:: NamespaceName ;
77
8- struct NamespaceRequests < C , F > {
9- requests : VecDeque < IndexedRequest < C , F > > ,
8+ struct NamespaceRequests < F > {
9+ requests : VecDeque < IndexedRequest < F > > ,
1010 /// there's work in flight for this namespace
1111 in_flight : bool ,
1212}
1313
14- impl < C , F > Default for NamespaceRequests < C , F > {
14+ impl < F > Default for NamespaceRequests < F > {
1515 fn default ( ) -> Self {
1616 Self {
1717 requests : Default :: default ( ) ,
@@ -28,14 +28,14 @@ impl<C, F> Default for NamespaceRequests<C, F> {
2828/// processed, because only the most recent segment is checked for durability. This property
2929/// ensures that all segments are present up to the max durable index.
3030/// It is generic over C: the storage config type (for config overrides), and T, the segment type
31- pub ( crate ) struct Scheduler < C , T > {
31+ pub ( crate ) struct Scheduler < T > {
3232 /// notify new durability index for namespace
33- requests : HashMap < NamespaceName , NamespaceRequests < C , T > > ,
33+ requests : HashMap < NamespaceName , NamespaceRequests < T > > ,
3434 queue : priority_queue:: PriorityQueue < NamespaceName , Reverse < u64 > > ,
3535 next_request_id : u64 ,
3636}
3737
38- impl < C , T > Scheduler < C , T > {
38+ impl < T > Scheduler < T > {
3939 pub fn new ( ) -> Self {
4040 Self {
4141 requests : Default :: default ( ) ,
@@ -46,7 +46,7 @@ impl<C, T> Scheduler<C, T> {
4646
4747 /// Register a new request with the scheduler
4848 #[ tracing:: instrument( skip_all) ]
49- pub fn register ( & mut self , request : StoreSegmentRequest < C , T > ) {
49+ pub fn register ( & mut self , request : StoreSegmentRequest < T > ) {
5050 // invariant: new segment comes immediately after the latest segment for that namespace. This means:
5151 // - immediately after the last registered segment, if there is any
5252 // - immediately after the last durable index
@@ -71,7 +71,7 @@ impl<C, T> Scheduler<C, T> {
7171 /// be scheduled, and returns description of the job to be performed. No other job for this
7272 /// namespace will be scheduled, until the `JobResult` is reported
7373 #[ tracing:: instrument( skip_all) ]
74- pub fn schedule ( & mut self ) -> Option < Job < C , T > > {
74+ pub fn schedule ( & mut self ) -> Option < Job < T > > {
7575 let ( name, _) = self . queue . pop ( ) ?;
7676 let requests = self
7777 . requests
@@ -90,7 +90,7 @@ impl<C, T> Scheduler<C, T> {
9090 /// Report the job result to the scheduler. If the job result was a success, the request as
9191 /// removed from the queue, else, the job is rescheduled
9292 #[ tracing:: instrument( skip_all, fields( req_id = result. job. request. id) ) ]
93- pub async fn report ( & mut self , result : JobResult < C , T > ) {
93+ pub async fn report ( & mut self , result : JobResult < T > ) {
9494 // re-schedule, or report new max durable frame_no for segment
9595 let name = result. job . request . request . namespace . clone ( ) ;
9696 let requests = self
@@ -151,7 +151,7 @@ mod test {
151151
152152 #[ tokio:: test]
153153 async fn schedule_simple ( ) {
154- let mut scheduler = Scheduler :: < ( ) , ( ) > :: new ( ) ;
154+ let mut scheduler = Scheduler :: < ( ) > :: new ( ) ;
155155
156156 let ns1 = NamespaceName :: from ( "test1" ) ;
157157 let ns2 = NamespaceName :: from ( "test2" ) ;
@@ -224,7 +224,7 @@ mod test {
224224
225225 #[ tokio:: test]
226226 async fn job_error_reschedule ( ) {
227- let mut scheduler = Scheduler :: < ( ) , ( ) > :: new ( ) ;
227+ let mut scheduler = Scheduler :: < ( ) > :: new ( ) ;
228228
229229 let ns1 = NamespaceName :: from ( "test1" ) ;
230230 let ns2 = NamespaceName :: from ( "test2" ) ;
@@ -264,7 +264,7 @@ mod test {
264264
265265 #[ tokio:: test]
266266 async fn schedule_while_in_flight ( ) {
267- let mut scheduler = Scheduler :: < ( ) , ( ) > :: new ( ) ;
267+ let mut scheduler = Scheduler :: < ( ) > :: new ( ) ;
268268
269269 let ns1 = NamespaceName :: from ( "test1" ) ;
270270
0 commit comments