File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,28 @@ impl GarbageCollection for PartitionHandle {
220
220
}
221
221
222
222
impl PartitionHandle {
223
+ /// Ingests a sorted stream of key-value pairs into the partition.
224
+ ///
225
+ /// Can only be called on a new fresh, empty partition.
226
+ ///
227
+ /// # Errors
228
+ ///
229
+ /// Will return `Err` if an IO error occurs.
230
+ ///
231
+ /// # Panics
232
+ ///
233
+ /// Panics if the partition is **not** initially empty.
234
+ ///
235
+ /// Will panic if the input iterator is not sorted in ascending order.
236
+ pub fn ingest < K : Into < UserKey > , V : Into < UserValue > > (
237
+ & self ,
238
+ iter : impl Iterator < Item = ( K , V ) > ,
239
+ ) -> crate :: Result < ( ) > {
240
+ self . tree
241
+ . ingest ( iter. map ( |( k, v) | ( k. into ( ) , v. into ( ) ) ) )
242
+ . map_err ( Into :: into)
243
+ }
244
+
223
245
pub ( crate ) fn from_keyspace (
224
246
keyspace : & Keyspace ,
225
247
tree : AnyTree ,
You can’t perform that action at this time.
0 commit comments