mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-04 16:22:55 +00:00
Reenable unit test.
Consuming CompositeWrite on Close.
This commit is contained in:
@@ -27,7 +27,7 @@ impl<W: Write> CompositeWrite<W> {
|
||||
&mut self.write
|
||||
}
|
||||
|
||||
pub fn close(&mut self) -> io::Result<()> {
|
||||
pub fn close(mut self) -> io::Result<()> {
|
||||
let footer_offset = self.write.written_bytes();
|
||||
VInt(self.offsets.len() as u64).serialize(&mut self.write)?;
|
||||
|
||||
|
||||
@@ -97,17 +97,15 @@ mod tests {
|
||||
{
|
||||
assert_eq!(source.len(), 35 as usize);
|
||||
}
|
||||
// TODO uncomment
|
||||
/*
|
||||
{
|
||||
let fast_field_readers = FastFieldsReader::from_source(source).unwrap();
|
||||
let composite_file = CompositeFile::open(source).unwrap();
|
||||
let field_source = composite_file.open_read(*FIELD).unwrap();
|
||||
let fast_field_reader: U64FastFieldReader =
|
||||
fast_field_readers.open_reader(*FIELD).unwrap();
|
||||
U64FastFieldReader::open(field_source);
|
||||
assert_eq!(fast_field_reader.get(0), 13u64);
|
||||
assert_eq!(fast_field_reader.get(1), 14u64);
|
||||
assert_eq!(fast_field_reader.get(2), 2u64);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -59,7 +59,7 @@ impl FastFieldSerializer {
|
||||
/// Closes the serializer
|
||||
///
|
||||
/// After this call the data must be persistently save on disk.
|
||||
pub fn close(mut self) -> io::Result<()> {
|
||||
pub fn close(self) -> io::Result<()> {
|
||||
self.composite_write.close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ impl InvertedIndexSerializer {
|
||||
}
|
||||
|
||||
/// Closes the serializer.
|
||||
pub fn close(mut self) -> io::Result<()> {
|
||||
pub fn close(self) -> io::Result<()> {
|
||||
self.terms_write.close()?;
|
||||
self.postings_write.close()?;
|
||||
self.positions_write.close()?;
|
||||
@@ -223,9 +223,6 @@ impl<'a> FieldSerializer<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO is the last term always closed?
|
||||
|
||||
|
||||
|
||||
struct PostingsSerializer<W: Write> {
|
||||
postings_write: CountingWriter<W>,
|
||||
|
||||
Reference in New Issue
Block a user