fn write_index(&self, time: u64, offset: u64) -> Result<()> {
// Use BigEndian here to keep consistent with DataOutputStream in Java.
let mut idx_out = self.cur_metric_idx_file.as_ref().unwrap().write().unwrap();
idx_out.write_all(&time.to_be_bytes())?;
idx_out.write_all(&offset.to_be_bytes())?;
idx_out.flush()?;
Ok(())
}
find_offset_to_start read 4 bytes from the idx file as the offset.
But write_index use 8 bytes to store it.