Skip to content

Commit 8915d3c

Browse files
committed
Disable CCR REST endpoints if CCR disabled (#33619)
This commit avoids enabling the CCR REST endpoints if CCR is disabled.
1 parent 8c370d0 commit 8915d3c

File tree

1 file changed

+5
-4
lines changed
  • x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr

1 file changed

+5
-4
lines changed

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/Ccr.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ public List<RestHandler> getRestHandlers(Settings settings, RestController restC
169169
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter,
170170
IndexNameExpressionResolver indexNameExpressionResolver,
171171
Supplier<DiscoveryNodes> nodesInCluster) {
172+
if (enabled == false) {
173+
return emptyList();
174+
}
175+
172176
return Arrays.asList(
173177
// stats API
174178
new RestCcrStatsAction(settings, restController),
@@ -234,10 +238,7 @@ public List<ExecutorBuilder<?>> getExecutorBuilders(Settings settings) {
234238
return Collections.emptyList();
235239
}
236240

237-
FixedExecutorBuilder ccrTp = new FixedExecutorBuilder(settings, CCR_THREAD_POOL_NAME,
238-
32, 100, "xpack.ccr.ccr_thread_pool");
239-
240-
return Collections.singletonList(ccrTp);
241+
return Collections.singletonList(new FixedExecutorBuilder(settings, CCR_THREAD_POOL_NAME, 32, 100, "xpack.ccr.ccr_thread_pool"));
241242
}
242243

243244
protected XPackLicenseState getLicenseState() { return XPackPlugin.getSharedLicenseState(); }

0 commit comments

Comments
 (0)