Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
This implementation of IndexFileNames only supplies a handful of minor utility
functions. It has has less in it than the corresponding Lucene class, because
Lucy will delegate much more to the individual index components than Lucene.
For instance, the top level library will remain ignorant of what DocWriter
chooses to name its files. We choose never to rely on filename conventions so
that replacement components can be swapped in without requiring that they
write certain files or adhere to specific naming schemes.
The only important function provided right now is IxFileNames_extract_gen:
/** Skip past the first instance of an underscore in the CharBuf, then * attempt to decode a base 36 number. For example, "snapshot_5.json" * yields 5, and "seg_a1" yields 27. * * @return a generation number, or 0 if no number can be extracted. */ inert i32_t extract_gen(const CharBuf *name);
Later, after Folder is added, we'll add IxFileNames_latest_snapshot, which
will scan the root level of a Folder for the snapshot file with the highest
generation.