Open cmacdonald opened 4 years ago
The method Index.setIndexLoadingProfileAsRetrieval() was always a hack.
I propose extending the IndexFactory.of() with an optional IndexProfile enum, which will hint to the Index(Loader) how it should load.
class IndexFactory { public Index of(IndexRef ref, IndexProfile profile); public Index of(IndexRef ref) { of (ref, IndexProfile.NORMAL); } }
public enum IndexProfile { SMALL, NORMAL, FAST }
For IndexOnDisk, this will be interpreted as follows:
Per-structure configuration:
An alternative would be an option called String[] preload, (or List preload) that specifies the structures that should be loaded into memory?
This last option could be used internally, but not exposed; avoid to give users too much rope... one simple strategy pattern is enough :-)
The method Index.setIndexLoadingProfileAsRetrieval() was always a hack.
I propose extending the IndexFactory.of() with an optional IndexProfile enum, which will hint to the Index(Loader) how it should load.
For IndexOnDisk, this will be interpreted as follows:
Per-structure configuration: