File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ impl<W: std::io::Write + std::io::Seek> FilterWriter<W> for FullFilterWriter {
5050 file_writer : & mut sfa:: Writer < ChecksummedWriter < BufWriter < File > > > ,
5151 ) -> crate :: Result < usize > {
5252 if self . bloom_hash_buffer . is_empty ( ) {
53- log:: trace!( "Filter write has no buffered hashes - not building filter" ) ;
53+ log:: trace!( "Filter writer has no buffered hashes - not building filter" ) ;
5454 } else {
5555 file_writer. start ( "filter" ) ?;
5656
Original file line number Diff line number Diff line change @@ -170,21 +170,24 @@ impl<W: std::io::Write + std::io::Seek> FilterWriter<W> for PartitionedFilterWri
170170 mut self : Box < Self > ,
171171 file_writer : & mut sfa:: Writer < ChecksummedWriter < BufWriter < File > > > ,
172172 ) -> crate :: Result < usize > {
173- if !self . bloom_hash_buffer . is_empty ( ) {
173+ if self . bloom_hash_buffer . is_empty ( ) {
174+ log:: trace!( "Filter writer has no buffered hashes - not building filter" ) ;
175+ Ok ( 0 )
176+ } else {
174177 let last_key = self . last_key . take ( ) . expect ( "last key should exist" ) ;
175178 self . spill_filter_partition ( & last_key) ?;
176- }
177179
178- let index_base_offset = BlockOffset ( file_writer. get_mut ( ) . stream_position ( ) ?) ;
180+ let index_base_offset = BlockOffset ( file_writer. get_mut ( ) . stream_position ( ) ?) ;
179181
180- file_writer. start ( "filter" ) ?;
181- file_writer. write_all ( & self . final_filter_buffer ) ?;
182- log:: trace!( "Concatted filter partitions onto blocks file" ) ;
182+ file_writer. start ( "filter" ) ?;
183+ file_writer. write_all ( & self . final_filter_buffer ) ?;
184+ log:: trace!( "Concatted filter partitions onto blocks file" ) ;
183185
184- let block_count = self . tli_handles . len ( ) ;
186+ let block_count = self . tli_handles . len ( ) ;
185187
186- self . write_top_level_index ( file_writer, index_base_offset) ?;
188+ self . write_top_level_index ( file_writer, index_base_offset) ?;
187189
188- Ok ( block_count)
190+ Ok ( block_count)
191+ }
189192 }
190193}
Original file line number Diff line number Diff line change @@ -359,9 +359,11 @@ impl Writer {
359359 }
360360
361361 // Write index
362+ log:: trace!( "Finishing index writer" ) ;
362363 let index_block_count = self . index_writer . finish ( & mut self . file_writer ) ?;
363364
364365 // Write filter
366+ log:: trace!( "Finishing filter writer" ) ;
365367 let filter_block_count = self . filter_writer . finish ( & mut self . file_writer ) ?;
366368
367369 if !self . linked_blob_files . is_empty ( ) {
You can’t perform that action at this time.
0 commit comments