use of org.opensearch.index.store.FsDirectoryFactory in project OpenSearch by opensearch-project.
the class MockFSDirectoryFactory method randomDirectoryService.
private Directory randomDirectoryService(Random random, IndexSettings indexSettings, ShardPath path) throws IOException {
final IndexMetadata build = IndexMetadata.builder(indexSettings.getIndexMetadata()).settings(Settings.builder().put(indexSettings.getIndexMetadata().getSettings()).put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), RandomPicks.randomFrom(random, IndexModule.Type.values()).getSettingsKey())).build();
final IndexSettings newIndexSettings = new IndexSettings(build, indexSettings.getNodeSettings());
return new FsDirectoryFactory().newDirectory(newIndexSettings, path);
}
Aggregations