Skip to content

Commit

Permalink
Add builder for EngineConfig (opensearch-project#5618)
Browse files Browse the repository at this point in the history
* Add builder for EngineConfig

Signed-off-by: Sachin Kale <kalsac@amazon.com>
Signed-off-by: Ashish Singh <ssashish@amazon.com>
  • Loading branch information
sachinpkale authored and ashking94 committed Jan 18, 2023
1 parent d34a34b commit dd21fdb
Show file tree
Hide file tree
Showing 9 changed files with 499 additions and 532 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,29 @@ EngineConfig engineConfigWithLargerIndexingMemory(EngineConfig config) {
.put("indices.memory.index_buffer_size", "10mb")
.build();
IndexSettings indexSettings = new IndexSettings(config.getIndexSettings().getIndexMetadata(), settings);
return new EngineConfig(
config.getShardId(),
config.getThreadPool(),
indexSettings,
config.getWarmer(),
config.getStore(),
config.getMergePolicy(),
config.getAnalyzer(),
config.getSimilarity(),
new CodecService(null, LogManager.getLogger(IndexingMemoryControllerIT.class)),
config.getEventListener(),
config.getQueryCache(),
config.getQueryCachingPolicy(),
config.getTranslogConfig(),
config.getFlushMergesAfter(),
config.getExternalRefreshListener(),
config.getInternalRefreshListener(),
config.getIndexSort(),
config.getCircuitBreakerService(),
config.getGlobalCheckpointSupplier(),
config.retentionLeasesSupplier(),
config.getPrimaryTermSupplier(),
config.getTombstoneDocSupplier()
);
return new EngineConfig.Builder().shardId(config.getShardId())
.threadPool(config.getThreadPool())
.indexSettings(indexSettings)
.warmer(config.getWarmer())
.store(config.getStore())
.mergePolicy(config.getMergePolicy())
.analyzer(config.getAnalyzer())
.similarity(config.getSimilarity())
.codecService(new CodecService(null, LogManager.getLogger(IndexingMemoryControllerIT.class)))
.eventListener(config.getEventListener())
.queryCache(config.getQueryCache())
.queryCachingPolicy(config.getQueryCachingPolicy())
.translogConfig(config.getTranslogConfig())
.flushMergesAfter(config.getFlushMergesAfter())
.externalRefreshListener(config.getExternalRefreshListener())
.internalRefreshListener(config.getInternalRefreshListener())
.indexSort(config.getIndexSort())
.circuitBreakerService(config.getCircuitBreakerService())
.globalCheckpointSupplier(config.getGlobalCheckpointSupplier())
.retentionLeasesSupplier(config.retentionLeasesSupplier())
.primaryTermSupplier(config.getPrimaryTermSupplier())
.tombstoneDocSupplier(config.getTombstoneDocSupplier())
.build();
}

@Override
Expand Down
Loading

0 comments on commit dd21fdb

Please sign in to comment.