Search in sources :

Example 1 with FsDirectoryFactory

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);
}
Also used : FsDirectoryFactory(org.opensearch.index.store.FsDirectoryFactory) IndexSettings(org.opensearch.index.IndexSettings) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata)

Aggregations

IndexMetadata (org.opensearch.cluster.metadata.IndexMetadata)1 IndexSettings (org.opensearch.index.IndexSettings)1 FsDirectoryFactory (org.opensearch.index.store.FsDirectoryFactory)1