Function yaque::recovery::guess_recv_metadata[][src]

pub fn guess_recv_metadata<P: AsRef<Path>>(base: P) -> Result<()>

Guesses the receive metadata for a given queue. This equals to the bottom position in the smallest segment present in the directory or the existing receiver metadata, whichever is greater. The reason for this is that the receive metadata is a lower bound of where the receiver actually was and this guess is always lower than that.

It is important to note two things:

  1. The data in the current segment will be lost.
  2. You don’t need to use this function when replays are acceptable, since the existing metadata file is already a lower bound of the actual state of the queue.

You should not use this function if you suppose that your data was corrupted.

Panics

This function panics if there is a file in the queue folder with extension .q whose name is not an integer, such as foo.q.