@@ -133,7 +133,7 @@ pub type OnStoreCallback = Box<
133133
134134pub trait Storage : Send + Sync + ' static {
135135 type Segment : Segment ;
136- type Config ;
136+ type Config : Clone + Send ;
137137 /// store the passed segment for `namespace`. This function is called in a context where
138138 /// blocking is acceptable.
139139 /// returns a future that resolves when the segment is stored
@@ -142,43 +142,44 @@ pub trait Storage: Send + Sync + 'static {
142142 & self ,
143143 namespace : & NamespaceName ,
144144 seg : Self :: Segment ,
145- config_override : Option < Arc < Self :: Config > > ,
145+ config_override : Option < Self :: Config > ,
146146 on_store : OnStoreCallback ,
147147 ) ;
148148
149149 fn durable_frame_no_sync (
150150 & self ,
151151 namespace : & NamespaceName ,
152- config_override : Option < Arc < Self :: Config > > ,
152+ config_override : Option < Self :: Config > ,
153153 ) -> u64 ;
154154
155155 async fn durable_frame_no (
156156 & self ,
157157 namespace : & NamespaceName ,
158- config_override : Option < Arc < Self :: Config > > ,
158+ config_override : Option < Self :: Config > ,
159159 ) -> u64 ;
160160
161161 async fn restore (
162162 & self ,
163163 file : impl FileExt ,
164164 namespace : & NamespaceName ,
165165 restore_options : RestoreOptions ,
166- config_override : Option < Arc < Self :: Config > > ,
166+ config_override : Option < Self :: Config > ,
167167 ) -> Result < ( ) > ;
168168
169169 async fn find_segment (
170170 & self ,
171171 namespace : & NamespaceName ,
172172 frame_no : u64 ,
173- config_override : Option < Arc < Self :: Config > > ,
174173 ) -> Result < SegmentKey > ;
174+ config_override: Option <Self :: Config >,
175175
176176 async fn fetch_segment_index (
177177 & self ,
178178 namespace : & NamespaceName ,
179179 key : & SegmentKey ,
180- config_override : Option < Arc < Self :: Config > > ,
181180 ) -> Result < Map < Arc < [ u8 ] > > > ;
181+ config_override: Option <Self :: Config >,
182+ config_override: Option <Self :: Config >,
182183
183184 async fn fetch_segment_data (
184185 fn shutdown ( & self ) -> impl Future < Output = ( ) > + Send {
@@ -187,8 +188,8 @@ pub trait Storage: Send + Sync + 'static {
187188 & self ,
188189 namespace: & NamespaceName ,
189190 key: & SegmentKey ,
190- config_override: Option <Arc <Self :: Config >>,
191191 ) -> Result <CompactedSegment <impl FileExt >>;
192+ config_override: Option <Self :: Config >,
192193}
193194
194195/// a placeholder storage that doesn't store segment
@@ -211,7 +212,7 @@ impl Storage for NoStorage {
211212 async fn durable_frame_no (
212213 & self ,
213214 namespace : & NamespaceName ,
214- config : Option < Arc < Self :: Config > > ,
215+ config : Option < Self :: Config > ,
215216 ) -> u64 {
216217 self . durable_frame_no_sync ( namespace, config)
217218 }
@@ -221,15 +222,15 @@ impl Storage for NoStorage {
221222 _file : impl FileExt ,
222223 _namespace : & NamespaceName ,
223224 _restore_options : RestoreOptions ,
224- _config_override : Option < Arc < Self :: Config > > ,
225+ _config_override : Option < Self :: Config > ,
225226 ) -> Result < ( ) > {
226227 panic ! ( "can restore from no storage" )
227228 }
228229
229230 fn durable_frame_no_sync (
230231 & self ,
231232 _namespace : & NamespaceName ,
232- _config_override : Option < Arc < Self :: Config > > ,
233+ _config_override : Option < Self :: Config > ,
233234 ) -> u64 {
234235 u64:: MAX
235236 }
@@ -256,7 +257,7 @@ impl Storage for NoStorage {
256257 & self ,
257258 _namespace : & NamespaceName ,
258259 _key : & SegmentKey ,
259- _config_override : Option < Arc < Self :: Config > > ,
260+ _config_override : Option < Self :: Config > ,
260261 ) -> Result < CompactedSegment < impl FileExt > > {
261262 unimplemented ! ( ) ;
262263 #[ allow( unreachable_code) ]
@@ -321,7 +322,7 @@ impl<IO: Io> Storage for TestStorage<IO> {
321322 & self ,
322323 namespace : & NamespaceName ,
323324 seg : Self :: Segment ,
324- _config : Option < Arc < Self :: Config > > ,
325+ _config : Option < Self :: Config > ,
325326 on_store : OnStoreCallback ,
326327 ) {
327328 let mut inner = self . inner . lock ( ) ;
@@ -350,7 +351,7 @@ impl<IO: Io> Storage for TestStorage<IO> {
350351 async fn durable_frame_no (
351352 & self ,
352353 namespace : & NamespaceName ,
353- config : Option < Arc < Self :: Config > > ,
354+ config : Option < Self :: Config > ,
354355 ) -> u64 {
355356 self . durable_frame_no_sync ( namespace, config)
356357 }
@@ -360,15 +361,15 @@ impl<IO: Io> Storage for TestStorage<IO> {
360361 _file : impl FileExt ,
361362 _namespace : & NamespaceName ,
362363 _restore_options : RestoreOptions ,
363- _config_override : Option < Arc < Self :: Config > > ,
364+ _config_override : Option < Self :: Config > ,
364365 ) -> Result < ( ) > {
365366 todo ! ( ) ;
366367 }
367368
368369 fn durable_frame_no_sync (
369370 & self ,
370371 namespace : & NamespaceName ,
371- _config_override : Option < Arc < Self :: Config > > ,
372+ _config_override : Option < Self :: Config > ,
372373 ) -> u64 {
373374 let inner = self . inner . lock ( ) ;
374375 if inner. store {
@@ -385,7 +386,7 @@ impl<IO: Io> Storage for TestStorage<IO> {
385386 & self ,
386387 namespace : & NamespaceName ,
387388 frame_no : u64 ,
388- _config_override : Option < Arc < Self :: Config > > ,
389+ _config_override : Option < Self :: Config > ,
389390 ) -> Result < SegmentKey > {
390391 let inner = self . inner . lock ( ) ;
391392 if inner. store {
@@ -406,7 +407,7 @@ impl<IO: Io> Storage for TestStorage<IO> {
406407 & self ,
407408 namespace : & NamespaceName ,
408409 key : & SegmentKey ,
409- _config_override : Option < Arc < Self :: Config > > ,
410+ _config_override : Option < Self :: Config > ,
410411 ) -> Result < Map < Arc < [ u8 ] > > > {
411412 let inner = self . inner . lock ( ) ;
412413 if inner. store {
@@ -423,7 +424,7 @@ impl<IO: Io> Storage for TestStorage<IO> {
423424 & self ,
424425 namespace : & NamespaceName ,
425426 key : & SegmentKey ,
426- _config_override : Option < Arc < Self :: Config > > ,
427+ _config_override : Option < Self :: Config > ,
427428 ) -> Result < CompactedSegment < impl FileExt > > {
428429 let inner = self . inner . lock ( ) ;
429430 if inner. store {
0 commit comments