mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
Merge remote-tracking branch 'upstream-main/main' into merge-main-22-01-25T12
This commit is contained in:
commit
569c1fc1cd
260 changed files with 399 additions and 2274 deletions
13
docs/changelog/120108.yaml
Normal file
13
docs/changelog/120108.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
pr: 120108
|
||||||
|
summary: Remove the ability to read frozen indices
|
||||||
|
area: Indices APIs
|
||||||
|
type: breaking
|
||||||
|
issues: []
|
||||||
|
breaking:
|
||||||
|
title: Remove the ability to read frozen indices
|
||||||
|
area: Index setting
|
||||||
|
details: >-
|
||||||
|
The ability to read frozen indices has been removed. (Frozen indices are no longer useful due to improvements in
|
||||||
|
heap memory usage. The ability to freeze indices was removed in 8.0.)
|
||||||
|
impact: Users must unfreeze any frozen indices before upgrading.
|
||||||
|
notable: false
|
5
docs/changelog/120591.yaml
Normal file
5
docs/changelog/120591.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pr: 120591
|
||||||
|
summary: Increase field limit for OTel metrics to 10 000
|
||||||
|
area: TSDB
|
||||||
|
type: enhancement
|
||||||
|
issues: []
|
|
@ -95,10 +95,6 @@ Example response:
|
||||||
"available" : true,
|
"available" : true,
|
||||||
"enabled" : true
|
"enabled" : true
|
||||||
},
|
},
|
||||||
"frozen_indices" : {
|
|
||||||
"available" : true,
|
|
||||||
"enabled" : true
|
|
||||||
},
|
|
||||||
"graph" : {
|
"graph" : {
|
||||||
"available" : true,
|
"available" : true,
|
||||||
"enabled" : true
|
"enabled" : true
|
||||||
|
|
|
@ -356,11 +356,6 @@ GET /_xpack/usage
|
||||||
"full_copy_indices_count" : 0,
|
"full_copy_indices_count" : 0,
|
||||||
"shared_cache_indices_count" : 0
|
"shared_cache_indices_count" : 0
|
||||||
},
|
},
|
||||||
"frozen_indices" : {
|
|
||||||
"available" : true,
|
|
||||||
"enabled" : true,
|
|
||||||
"indices_count" : 0
|
|
||||||
},
|
|
||||||
"spatial" : {
|
"spatial" : {
|
||||||
"available" : true,
|
"available" : true,
|
||||||
"enabled" : true
|
"enabled" : true
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.MetadataCreateDataStreamService;
|
import org.elasticsearch.cluster.metadata.MetadataCreateDataStreamService;
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -41,7 +40,6 @@ public class CreateDataStreamTransportAction extends AcknowledgedTransportMaster
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
MetadataCreateDataStreamService metadataCreateDataStreamService,
|
MetadataCreateDataStreamService metadataCreateDataStreamService,
|
||||||
SystemIndices systemIndices
|
SystemIndices systemIndices
|
||||||
) {
|
) {
|
||||||
|
@ -52,7 +50,6 @@ public class CreateDataStreamTransportAction extends AcknowledgedTransportMaster
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
CreateDataStreamAction.Request::new,
|
CreateDataStreamAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
|
|
@ -53,6 +53,7 @@ public class DeleteDataStreamTransportAction extends AcknowledgedTransportMaster
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(DeleteDataStreamTransportAction.class);
|
private static final Logger LOGGER = LogManager.getLogger(DeleteDataStreamTransportAction.class);
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
|
||||||
|
@ -73,9 +74,9 @@ public class DeleteDataStreamTransportAction extends AcknowledgedTransportMaster
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteDataStreamAction.Request::new,
|
DeleteDataStreamAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ public class MigrateToDataStreamTransportAction extends AcknowledgedTransportMas
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
MigrateToDataStreamAction.Request::new,
|
MigrateToDataStreamAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.metadataMigrateToDataStreamService = new MetadataMigrateToDataStreamService(
|
this.metadataMigrateToDataStreamService = new MetadataMigrateToDataStreamService(
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.elasticsearch.transport.TransportService;
|
||||||
|
|
||||||
public class ModifyDataStreamsTransportAction extends AcknowledgedTransportMasterNodeProjectAction<ModifyDataStreamsAction.Request> {
|
public class ModifyDataStreamsTransportAction extends AcknowledgedTransportMasterNodeProjectAction<ModifyDataStreamsAction.Request> {
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final MetadataDataStreamsService metadataDataStreamsService;
|
private final MetadataDataStreamsService metadataDataStreamsService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -48,9 +49,9 @@ public class ModifyDataStreamsTransportAction extends AcknowledgedTransportMaste
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ModifyDataStreamsAction.Request::new,
|
ModifyDataStreamsAction.Request::new,
|
||||||
projectResolver,
|
projectResolver,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.metadataDataStreamsService = metadataDataStreamsService;
|
this.metadataDataStreamsService = metadataDataStreamsService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ public class PromoteDataStreamTransportAction extends AcknowledgedTransportMaste
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PromoteDataStreamAction.Request::new,
|
PromoteDataStreamAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
|
|
|
@ -63,6 +63,7 @@ public class TransportGetDataStreamsAction extends TransportMasterNodeReadProjec
|
||||||
GetDataStreamAction.Response> {
|
GetDataStreamAction.Response> {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(TransportGetDataStreamsAction.class);
|
private static final Logger LOGGER = LogManager.getLogger(TransportGetDataStreamsAction.class);
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
private final ClusterSettings clusterSettings;
|
private final ClusterSettings clusterSettings;
|
||||||
private final DataStreamGlobalRetentionSettings globalRetentionSettings;
|
private final DataStreamGlobalRetentionSettings globalRetentionSettings;
|
||||||
|
@ -90,10 +91,10 @@ public class TransportGetDataStreamsAction extends TransportMasterNodeReadProjec
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetDataStreamAction.Request::new,
|
GetDataStreamAction.Request::new,
|
||||||
projectResolver,
|
projectResolver,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetDataStreamAction.Response::new,
|
GetDataStreamAction.Response::new,
|
||||||
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
|
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
this.globalRetentionSettings = globalRetentionSettings;
|
this.globalRetentionSettings = globalRetentionSettings;
|
||||||
clusterSettings = clusterService.getClusterSettings();
|
clusterSettings = clusterService.getClusterSettings();
|
||||||
|
|
|
@ -35,6 +35,7 @@ import java.util.List;
|
||||||
public class TransportDeleteDataStreamLifecycleAction extends AcknowledgedTransportMasterNodeProjectAction<
|
public class TransportDeleteDataStreamLifecycleAction extends AcknowledgedTransportMasterNodeProjectAction<
|
||||||
DeleteDataStreamLifecycleAction.Request> {
|
DeleteDataStreamLifecycleAction.Request> {
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final MetadataDataStreamsService metadataDataStreamsService;
|
private final MetadataDataStreamsService metadataDataStreamsService;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
|
|
||||||
|
@ -57,9 +58,9 @@ public class TransportDeleteDataStreamLifecycleAction extends AcknowledgedTransp
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteDataStreamLifecycleAction.Request::new,
|
DeleteDataStreamLifecycleAction.Request::new,
|
||||||
projectResolver,
|
projectResolver,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.metadataDataStreamsService = metadataDataStreamsService;
|
this.metadataDataStreamsService = metadataDataStreamsService;
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ public class TransportExplainDataStreamLifecycleAction extends TransportMasterNo
|
||||||
ExplainDataStreamLifecycleAction.Request,
|
ExplainDataStreamLifecycleAction.Request,
|
||||||
ExplainDataStreamLifecycleAction.Response> {
|
ExplainDataStreamLifecycleAction.Response> {
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final DataStreamLifecycleErrorStore errorStore;
|
private final DataStreamLifecycleErrorStore errorStore;
|
||||||
private final DataStreamGlobalRetentionSettings globalRetentionSettings;
|
private final DataStreamGlobalRetentionSettings globalRetentionSettings;
|
||||||
|
|
||||||
|
@ -64,10 +65,10 @@ public class TransportExplainDataStreamLifecycleAction extends TransportMasterNo
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ExplainDataStreamLifecycleAction.Request::new,
|
ExplainDataStreamLifecycleAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
ExplainDataStreamLifecycleAction.Response::new,
|
ExplainDataStreamLifecycleAction.Response::new,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.errorStore = dataLifecycleServiceErrorStore;
|
this.errorStore = dataLifecycleServiceErrorStore;
|
||||||
this.globalRetentionSettings = globalRetentionSettings;
|
this.globalRetentionSettings = globalRetentionSettings;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class TransportGetDataStreamLifecycleAction extends TransportMasterNodeRe
|
||||||
GetDataStreamLifecycleAction.Request,
|
GetDataStreamLifecycleAction.Request,
|
||||||
GetDataStreamLifecycleAction.Response> {
|
GetDataStreamLifecycleAction.Response> {
|
||||||
private final ClusterSettings clusterSettings;
|
private final ClusterSettings clusterSettings;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final DataStreamGlobalRetentionSettings globalRetentionSettings;
|
private final DataStreamGlobalRetentionSettings globalRetentionSettings;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -62,11 +63,11 @@ public class TransportGetDataStreamLifecycleAction extends TransportMasterNodeRe
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetDataStreamLifecycleAction.Request::new,
|
GetDataStreamLifecycleAction.Request::new,
|
||||||
projectResolver,
|
projectResolver,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetDataStreamLifecycleAction.Response::new,
|
GetDataStreamLifecycleAction.Response::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
clusterSettings = clusterService.getClusterSettings();
|
clusterSettings = clusterService.getClusterSettings();
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.globalRetentionSettings = globalRetentionSettings;
|
this.globalRetentionSettings = globalRetentionSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ public class TransportGetDataStreamLifecycleStatsAction extends TransportMasterN
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetDataStreamLifecycleStatsAction.Request::new,
|
GetDataStreamLifecycleStatsAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetDataStreamLifecycleStatsAction.Response::new,
|
GetDataStreamLifecycleStatsAction.Response::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,6 +36,7 @@ import java.util.List;
|
||||||
public class TransportPutDataStreamLifecycleAction extends AcknowledgedTransportMasterNodeProjectAction<
|
public class TransportPutDataStreamLifecycleAction extends AcknowledgedTransportMasterNodeProjectAction<
|
||||||
PutDataStreamLifecycleAction.Request> {
|
PutDataStreamLifecycleAction.Request> {
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final MetadataDataStreamsService metadataDataStreamsService;
|
private final MetadataDataStreamsService metadataDataStreamsService;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
|
|
||||||
|
@ -58,9 +59,9 @@ public class TransportPutDataStreamLifecycleAction extends AcknowledgedTransport
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutDataStreamLifecycleAction.Request::new,
|
PutDataStreamLifecycleAction.Request::new,
|
||||||
projectResolver,
|
projectResolver,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.metadataDataStreamsService = metadataDataStreamsService;
|
this.metadataDataStreamsService = metadataDataStreamsService;
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ import java.util.List;
|
||||||
public class TransportDeleteDataStreamOptionsAction extends AcknowledgedTransportMasterNodeProjectAction<
|
public class TransportDeleteDataStreamOptionsAction extends AcknowledgedTransportMasterNodeProjectAction<
|
||||||
DeleteDataStreamOptionsAction.Request> {
|
DeleteDataStreamOptionsAction.Request> {
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final MetadataDataStreamsService metadataDataStreamsService;
|
private final MetadataDataStreamsService metadataDataStreamsService;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
|
|
||||||
|
@ -57,9 +58,9 @@ public class TransportDeleteDataStreamOptionsAction extends AcknowledgedTranspor
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteDataStreamOptionsAction.Request::new,
|
DeleteDataStreamOptionsAction.Request::new,
|
||||||
projectResolver,
|
projectResolver,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.metadataDataStreamsService = metadataDataStreamsService;
|
this.metadataDataStreamsService = metadataDataStreamsService;
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public class TransportGetDataStreamOptionsAction extends TransportMasterNodeRead
|
||||||
GetDataStreamOptionsAction.Request,
|
GetDataStreamOptionsAction.Request,
|
||||||
GetDataStreamOptionsAction.Response> {
|
GetDataStreamOptionsAction.Response> {
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -59,10 +60,10 @@ public class TransportGetDataStreamOptionsAction extends TransportMasterNodeRead
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetDataStreamOptionsAction.Request::new,
|
GetDataStreamOptionsAction.Request::new,
|
||||||
projectResolver,
|
projectResolver,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetDataStreamOptionsAction.Response::new,
|
GetDataStreamOptionsAction.Response::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class TransportPutDataStreamOptionsAction extends AcknowledgedTransportMasterNodeProjectAction<PutDataStreamOptionsAction.Request> {
|
public class TransportPutDataStreamOptionsAction extends AcknowledgedTransportMasterNodeProjectAction<PutDataStreamOptionsAction.Request> {
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final MetadataDataStreamsService metadataDataStreamsService;
|
private final MetadataDataStreamsService metadataDataStreamsService;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
|
|
||||||
|
@ -56,9 +57,9 @@ public class TransportPutDataStreamOptionsAction extends AcknowledgedTransportMa
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutDataStreamOptionsAction.Request::new,
|
PutDataStreamOptionsAction.Request::new,
|
||||||
projectResolver,
|
projectResolver,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.metadataDataStreamsService = metadataDataStreamsService;
|
this.metadataDataStreamsService = metadataDataStreamsService;
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,6 @@ public class TransportDeleteDatabaseConfigurationAction extends TransportMasterN
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
Request::new,
|
Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
AcknowledgedResponse::readFrom,
|
AcknowledgedResponse::readFrom,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -75,7 +75,6 @@ public class TransportPutDatabaseConfigurationAction extends TransportMasterNode
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
Request::new,
|
Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
AcknowledgedResponse::readFrom,
|
AcknowledgedResponse::readFrom,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -240,6 +240,25 @@ tests:
|
||||||
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
|
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
|
||||||
method: testEnrichExplosionManyMatches
|
method: testEnrichExplosionManyMatches
|
||||||
issue: https://github.com/elastic/elasticsearch/issues/120587
|
issue: https://github.com/elastic/elasticsearch/issues/120587
|
||||||
|
- class: org.elasticsearch.lucene.FullClusterRestartLuceneIndexCompatibilityIT
|
||||||
|
issue: https://github.com/elastic/elasticsearch/issues/120597
|
||||||
|
- class: org.elasticsearch.lucene.RollingUpgradeLuceneIndexCompatibilityTestCase
|
||||||
|
issue: https://github.com/elastic/elasticsearch/issues/120598
|
||||||
|
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
|
||||||
|
method: test {lookup-join.NonUniqueRightKeyOnTheCoordinator ASYNC}
|
||||||
|
issue: https://github.com/elastic/elasticsearch/issues/120600
|
||||||
|
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
|
||||||
|
method: test {lookup-join.NonUniqueRightKeyFromRow ASYNC}
|
||||||
|
issue: https://github.com/elastic/elasticsearch/issues/120601
|
||||||
|
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
|
||||||
|
method: test {lookup-join.NonUniqueRightKeyFromRow SYNC}
|
||||||
|
issue: https://github.com/elastic/elasticsearch/issues/120602
|
||||||
|
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
|
||||||
|
method: test {lookup-join.NonUniqueRightKeyOnTheCoordinator SYNC}
|
||||||
|
issue: https://github.com/elastic/elasticsearch/issues/120603
|
||||||
|
- class: org.elasticsearch.index.reindex.BulkByScrollUsesAllScrollDocumentsAfterConflictsIntegTests
|
||||||
|
method: testReindex
|
||||||
|
issue: https://github.com/elastic/elasticsearch/issues/120605
|
||||||
|
|
||||||
# Examples:
|
# Examples:
|
||||||
#
|
#
|
||||||
|
|
|
@ -37,6 +37,7 @@ import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
import static org.elasticsearch.cluster.metadata.MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING;
|
||||||
import static org.elasticsearch.test.cluster.util.Version.CURRENT;
|
import static org.elasticsearch.test.cluster.util.Version.CURRENT;
|
||||||
import static org.elasticsearch.test.cluster.util.Version.fromString;
|
import static org.elasticsearch.test.cluster.util.Version.fromString;
|
||||||
import static org.elasticsearch.test.rest.ObjectPath.createFromResponse;
|
import static org.elasticsearch.test.rest.ObjectPath.createFromResponse;
|
||||||
|
@ -259,13 +260,21 @@ public abstract class AbstractIndexCompatibilityTestCase extends ESRestTestCase
|
||||||
return IndexMetadata.State.fromString((String) state) == IndexMetadata.State.CLOSE;
|
return IndexMetadata.State.fromString((String) state) == IndexMetadata.State.CLOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void addIndexWriteBlock(String indexName) throws Exception {
|
|
||||||
assertAcknowledged(client().performRequest(new Request("PUT", Strings.format("/%s/_block/write", indexName))));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected static void forceMerge(String indexName, int maxNumSegments) throws Exception {
|
protected static void forceMerge(String indexName, int maxNumSegments) throws Exception {
|
||||||
var request = new Request("POST", '/' + indexName + "/_forcemerge");
|
var request = new Request("POST", '/' + indexName + "/_forcemerge");
|
||||||
request.addParameter("max_num_segments", String.valueOf(maxNumSegments));
|
request.addParameter("max_num_segments", String.valueOf(maxNumSegments));
|
||||||
assertOK(client().performRequest(request));
|
assertOK(client().performRequest(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void addIndexBlock(String indexName, IndexMetadata.APIBlock apiBlock) throws Exception {
|
||||||
|
logger.debug("--> adding index block [{}] to [{}]", apiBlock, indexName);
|
||||||
|
var request = new Request("PUT", Strings.format("/%s/_block/%s", indexName, apiBlock.name().toLowerCase(Locale.ROOT)));
|
||||||
|
assertAcknowledged(client().performRequest(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void assertThatIndexBlock(String indexName, IndexMetadata.APIBlock apiBlock) throws Exception {
|
||||||
|
var indexSettings = getIndexSettingsAsMap(indexName);
|
||||||
|
assertThat(indexSettings.get(VERIFIED_READ_ONLY_SETTING.getKey()), equalTo(Boolean.TRUE.toString()));
|
||||||
|
assertThat(indexSettings.get(apiBlock.settingName()), equalTo(Boolean.TRUE.toString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.index.IndexSettings;
|
||||||
import org.elasticsearch.repositories.fs.FsRepository;
|
import org.elasticsearch.repositories.fs.FsRepository;
|
||||||
import org.elasticsearch.test.cluster.util.Version;
|
import org.elasticsearch.test.cluster.util.Version;
|
||||||
|
|
||||||
import static org.elasticsearch.cluster.metadata.MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING;
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRestartIndexCompatibilityTestCase {
|
public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRestartIndexCompatibilityTestCase {
|
||||||
|
@ -58,14 +57,7 @@ public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRes
|
||||||
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
assertDocCount(client(), index, numDocs);
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
logger.debug("--> flushing [{}]", index);
|
addIndexBlock(index, IndexMetadata.APIBlock.WRITE);
|
||||||
flush(index, true);
|
|
||||||
|
|
||||||
logger.debug("--> applying write block on [{}]", index);
|
|
||||||
addIndexWriteBlock(index);
|
|
||||||
|
|
||||||
logger.debug("--> applying verified read-only setting on [{}]", index);
|
|
||||||
updateIndexSettings(index, Settings.builder().put(VERIFIED_READ_ONLY_SETTING.getKey(), true));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,9 +67,7 @@ public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRes
|
||||||
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
assertDocCount(client(), index, numDocs);
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
var indexSettings = getIndexSettingsAsMap(index);
|
assertThatIndexBlock(index, IndexMetadata.APIBlock.WRITE);
|
||||||
assertThat(indexSettings.get(IndexMetadata.APIBlock.WRITE.settingName()), equalTo(Boolean.TRUE.toString()));
|
|
||||||
assertThat(indexSettings.get(VERIFIED_READ_ONLY_SETTING.getKey()), equalTo(Boolean.TRUE.toString()));
|
|
||||||
|
|
||||||
var numberOfReplicas = getNumberOfReplicas(index);
|
var numberOfReplicas = getNumberOfReplicas(index);
|
||||||
if (0 < numberOfReplicas) {
|
if (0 < numberOfReplicas) {
|
||||||
|
@ -111,6 +101,50 @@ public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Similar to {@link #testIndexUpgrade()} but with a read_only block.
|
||||||
|
*/
|
||||||
|
public void testIndexUpgradeReadOnlyBlock() throws Exception {
|
||||||
|
final String index = suffix("index");
|
||||||
|
final int numDocs = 2531;
|
||||||
|
|
||||||
|
if (isFullyUpgradedTo(VERSION_MINUS_2)) {
|
||||||
|
logger.debug("--> creating index [{}]", index);
|
||||||
|
createIndex(
|
||||||
|
client(),
|
||||||
|
index,
|
||||||
|
Settings.builder()
|
||||||
|
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
|
||||||
|
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, randomInt(2))
|
||||||
|
.put(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
logger.debug("--> indexing [{}] docs in [{}]", numDocs, index);
|
||||||
|
indexDocs(index, numDocs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFullyUpgradedTo(VERSION_MINUS_1)) {
|
||||||
|
ensureGreen(index);
|
||||||
|
|
||||||
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
|
addIndexBlock(index, IndexMetadata.APIBlock.READ_ONLY);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFullyUpgradedTo(VERSION_CURRENT)) {
|
||||||
|
ensureGreen(index);
|
||||||
|
|
||||||
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
|
assertThatIndexBlock(index, IndexMetadata.APIBlock.READ_ONLY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an index on N-2, marks as read-only on N-1 and creates a snapshot, then restores the snapshot on N.
|
* Creates an index on N-2, marks as read-only on N-1 and creates a snapshot, then restores the snapshot on N.
|
||||||
*/
|
*/
|
||||||
|
@ -146,14 +180,7 @@ public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRes
|
||||||
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
assertDocCount(client(), index, numDocs);
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
logger.debug("--> flushing [{}]", index);
|
addIndexBlock(index, IndexMetadata.APIBlock.WRITE);
|
||||||
flush(index, true);
|
|
||||||
|
|
||||||
logger.debug("--> applying write block on [{}]", index);
|
|
||||||
addIndexWriteBlock(index);
|
|
||||||
|
|
||||||
logger.debug("--> applying verified read-only setting on [{}]", index);
|
|
||||||
updateIndexSettings(index, Settings.builder().put(VERIFIED_READ_ONLY_SETTING.getKey(), true));
|
|
||||||
|
|
||||||
logger.debug("--> creating snapshot [{}]", snapshot);
|
logger.debug("--> creating snapshot [{}]", snapshot);
|
||||||
createSnapshot(client(), repository, snapshot, true);
|
createSnapshot(client(), repository, snapshot, true);
|
||||||
|
@ -169,6 +196,7 @@ public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRes
|
||||||
restoreIndex(repository, snapshot, index, restoredIndex);
|
restoreIndex(repository, snapshot, index, restoredIndex);
|
||||||
ensureGreen(restoredIndex);
|
ensureGreen(restoredIndex);
|
||||||
|
|
||||||
|
assertThatIndexBlock(restoredIndex, IndexMetadata.APIBlock.WRITE);
|
||||||
assertThat(indexVersion(restoredIndex), equalTo(VERSION_MINUS_2));
|
assertThat(indexVersion(restoredIndex), equalTo(VERSION_MINUS_2));
|
||||||
assertDocCount(client(), restoredIndex, numDocs);
|
assertDocCount(client(), restoredIndex, numDocs);
|
||||||
|
|
||||||
|
@ -233,14 +261,7 @@ public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRes
|
||||||
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
assertDocCount(client(), index, numDocs);
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
logger.debug("--> flushing [{}]", index);
|
addIndexBlock(index, IndexMetadata.APIBlock.WRITE);
|
||||||
flush(index, true);
|
|
||||||
|
|
||||||
logger.debug("--> applying write block on [{}]", index);
|
|
||||||
addIndexWriteBlock(index);
|
|
||||||
|
|
||||||
logger.debug("--> applying verified read-only setting on [{}]", index);
|
|
||||||
updateIndexSettings(index, Settings.builder().put(VERIFIED_READ_ONLY_SETTING.getKey(), true));
|
|
||||||
|
|
||||||
logger.debug("--> creating snapshot [{}]", snapshot);
|
logger.debug("--> creating snapshot [{}]", snapshot);
|
||||||
createSnapshot(client(), repository, snapshot, true);
|
createSnapshot(client(), repository, snapshot, true);
|
||||||
|
@ -255,10 +276,8 @@ public class FullClusterRestartLuceneIndexCompatibilityIT extends FullClusterRes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFullyUpgradedTo(VERSION_CURRENT)) {
|
if (isFullyUpgradedTo(VERSION_CURRENT)) {
|
||||||
var indexSettings = getIndexSettingsAsMap(index);
|
|
||||||
assertThat(indexSettings.get(IndexMetadata.APIBlock.WRITE.settingName()), equalTo(Boolean.TRUE.toString()));
|
|
||||||
assertThat(indexSettings.get(VERIFIED_READ_ONLY_SETTING.getKey()), equalTo(Boolean.TRUE.toString()));
|
|
||||||
assertThat(isIndexClosed(index), equalTo(true));
|
assertThat(isIndexClosed(index), equalTo(true));
|
||||||
|
assertThatIndexBlock(index, IndexMetadata.APIBlock.WRITE);
|
||||||
|
|
||||||
logger.debug("--> restoring index [{}] over existing closed index", index);
|
logger.debug("--> restoring index [{}] over existing closed index", index);
|
||||||
restoreIndex(repository, snapshot, index, index);
|
restoreIndex(repository, snapshot, index, index);
|
||||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.test.cluster.util.Version;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.elasticsearch.cluster.metadata.MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING;
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
public class RollingUpgradeLuceneIndexCompatibilityTestCase extends RollingUpgradeIndexCompatibilityTestCase {
|
public class RollingUpgradeLuceneIndexCompatibilityTestCase extends RollingUpgradeIndexCompatibilityTestCase {
|
||||||
|
@ -62,21 +61,12 @@ public class RollingUpgradeLuceneIndexCompatibilityTestCase extends RollingUpgra
|
||||||
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
assertDocCount(client(), index, numDocs);
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
logger.debug("--> flushing [{}]", index);
|
addIndexBlock(index, IndexMetadata.APIBlock.WRITE);
|
||||||
flush(index, true);
|
|
||||||
|
|
||||||
logger.debug("--> applying write block on [{}]", index);
|
|
||||||
addIndexWriteBlock(index);
|
|
||||||
|
|
||||||
logger.debug("--> applying verified read-only setting on [{}]", index);
|
|
||||||
updateIndexSettings(index, Settings.builder().put(VERIFIED_READ_ONLY_SETTING.getKey(), true));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodesVersions().values().stream().anyMatch(v -> v.onOrAfter(VERSION_CURRENT))) {
|
if (nodesVersions().values().stream().anyMatch(v -> v.onOrAfter(VERSION_CURRENT))) {
|
||||||
var indexSettings = getIndexSettingsAsMap(index);
|
assertThatIndexBlock(index, IndexMetadata.APIBlock.WRITE);
|
||||||
assertThat(indexSettings.get(IndexMetadata.APIBlock.WRITE.settingName()), equalTo(Boolean.TRUE.toString()));
|
|
||||||
assertThat(indexSettings.get(VERIFIED_READ_ONLY_SETTING.getKey()), equalTo(Boolean.TRUE.toString()));
|
|
||||||
|
|
||||||
if (isIndexClosed(index)) {
|
if (isIndexClosed(index)) {
|
||||||
logger.debug("--> re-opening index [{}] after upgrade", index);
|
logger.debug("--> re-opening index [{}] after upgrade", index);
|
||||||
|
@ -98,6 +88,48 @@ public class RollingUpgradeLuceneIndexCompatibilityTestCase extends RollingUpgra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Similar to {@link #testIndexUpgrade()} but with a read_only block.
|
||||||
|
*/
|
||||||
|
public void testIndexUpgradeReadOnlyBlock() throws Exception {
|
||||||
|
final String index = suffix("index-");
|
||||||
|
final int numDocs = 2573;
|
||||||
|
|
||||||
|
if (isFullyUpgradedTo(VERSION_MINUS_2)) {
|
||||||
|
logger.debug("--> creating index [{}]", index);
|
||||||
|
createIndex(
|
||||||
|
client(),
|
||||||
|
index,
|
||||||
|
Settings.builder()
|
||||||
|
.put(IndexMetadata.SETTING_NUMBER_OF_SHARDS, 1)
|
||||||
|
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)
|
||||||
|
.put(IndexSettings.INDEX_SOFT_DELETES_SETTING.getKey(), true)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
logger.debug("--> indexing [{}] docs in [{}]", numDocs, index);
|
||||||
|
indexDocs(index, numDocs);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ensureGreen(index);
|
||||||
|
|
||||||
|
if (isFullyUpgradedTo(VERSION_MINUS_1)) {
|
||||||
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
|
addIndexBlock(index, IndexMetadata.APIBlock.READ_ONLY);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nodesVersions().values().stream().anyMatch(v -> v.onOrAfter(VERSION_CURRENT))) {
|
||||||
|
assertThatIndexBlock(index, IndexMetadata.APIBlock.READ_ONLY);
|
||||||
|
|
||||||
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
|
assertDocCount(client(), index, numDocs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an index on N-2, marks as read-only on N-1 and creates a snapshot, then restores the snapshot during rolling upgrades to N.
|
* Creates an index on N-2, marks as read-only on N-1 and creates a snapshot, then restores the snapshot during rolling upgrades to N.
|
||||||
*/
|
*/
|
||||||
|
@ -133,14 +165,7 @@ public class RollingUpgradeLuceneIndexCompatibilityTestCase extends RollingUpgra
|
||||||
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
assertThat(indexVersion(index), equalTo(VERSION_MINUS_2));
|
||||||
assertDocCount(client(), index, numDocs);
|
assertDocCount(client(), index, numDocs);
|
||||||
|
|
||||||
logger.debug("--> flushing [{}]", index);
|
addIndexBlock(index, IndexMetadata.APIBlock.WRITE);
|
||||||
flush(index, true);
|
|
||||||
|
|
||||||
logger.debug("--> applying write block on [{}]", index);
|
|
||||||
addIndexWriteBlock(index);
|
|
||||||
|
|
||||||
logger.debug("--> applying verified read-only setting on [{}]", index);
|
|
||||||
updateIndexSettings(index, Settings.builder().put(VERIFIED_READ_ONLY_SETTING.getKey(), true));
|
|
||||||
|
|
||||||
logger.debug("--> creating snapshot [{}]", snapshot);
|
logger.debug("--> creating snapshot [{}]", snapshot);
|
||||||
createSnapshot(client(), repository, snapshot, true);
|
createSnapshot(client(), repository, snapshot, true);
|
||||||
|
@ -158,6 +183,7 @@ public class RollingUpgradeLuceneIndexCompatibilityTestCase extends RollingUpgra
|
||||||
restoreIndex(repository, snapshot, index, restoredIndex);
|
restoreIndex(repository, snapshot, index, restoredIndex);
|
||||||
ensureGreen(restoredIndex);
|
ensureGreen(restoredIndex);
|
||||||
|
|
||||||
|
assertThatIndexBlock(restoredIndex, IndexMetadata.APIBlock.WRITE);
|
||||||
assertThat(indexVersion(restoredIndex), equalTo(VERSION_MINUS_2));
|
assertThat(indexVersion(restoredIndex), equalTo(VERSION_MINUS_2));
|
||||||
assertDocCount(client(), restoredIndex, numDocs);
|
assertDocCount(client(), restoredIndex, numDocs);
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,13 @@ import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||||
import org.elasticsearch.TransportVersions;
|
import org.elasticsearch.TransportVersions;
|
||||||
import org.elasticsearch.client.Request;
|
import org.elasticsearch.client.Request;
|
||||||
import org.elasticsearch.client.ResponseException;
|
import org.elasticsearch.client.ResponseException;
|
||||||
|
import org.elasticsearch.cluster.metadata.IndexMetadata;
|
||||||
import org.elasticsearch.cluster.metadata.MetadataIndexStateService;
|
import org.elasticsearch.cluster.metadata.MetadataIndexStateService;
|
||||||
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.hamcrest.Matchers;
|
import org.hamcrest.Matchers;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class AddIndexBlockRollingUpgradeIT extends AbstractRollingUpgradeTestCase {
|
public class AddIndexBlockRollingUpgradeIT extends AbstractRollingUpgradeTestCase {
|
||||||
|
@ -40,16 +43,33 @@ public class AddIndexBlockRollingUpgradeIT extends AbstractRollingUpgradeTestCas
|
||||||
assertNull(verifiedSettingValue());
|
assertNull(verifiedSettingValue());
|
||||||
} else {
|
} else {
|
||||||
assertThat(verifiedSettingValue(), Matchers.equalTo("true"));
|
assertThat(verifiedSettingValue(), Matchers.equalTo("true"));
|
||||||
|
|
||||||
|
expectThrows(
|
||||||
|
ResponseException.class,
|
||||||
|
() -> updateIndexSettings(
|
||||||
|
INDEX_NAME,
|
||||||
|
Settings.builder().putNull(MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey())
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assertTrue(isUpgradedCluster());
|
assertTrue(isUpgradedCluster());
|
||||||
blockWrites();
|
blockWrites();
|
||||||
assertThat(verifiedSettingValue(), Matchers.equalTo("true"));
|
assertThat(verifiedSettingValue(), Matchers.equalTo("true"));
|
||||||
|
|
||||||
|
expectThrows(
|
||||||
|
ResponseException.class,
|
||||||
|
() -> updateIndexSettings(
|
||||||
|
INDEX_NAME,
|
||||||
|
Settings.builder().putNull(MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey())
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void blockWrites() throws IOException {
|
private static void blockWrites() throws IOException {
|
||||||
client().performRequest(new Request(HttpMethod.PUT.name(), "/" + INDEX_NAME + "/_block/write"));
|
var block = randomFrom(IndexMetadata.APIBlock.READ_ONLY, IndexMetadata.APIBlock.WRITE).name().toLowerCase(Locale.ROOT);
|
||||||
|
client().performRequest(new Request(HttpMethod.PUT.name(), "/" + INDEX_NAME + "/_block/" + block));
|
||||||
|
|
||||||
expectThrows(
|
expectThrows(
|
||||||
ResponseException.class,
|
ResponseException.class,
|
||||||
|
|
|
@ -267,7 +267,6 @@ public class TransportMasterNodeActionIT extends ESIntegTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
TestRequest::new,
|
TestRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
in -> ActionResponse.Empty.INSTANCE,
|
in -> ActionResponse.Empty.INSTANCE,
|
||||||
threadPool.generic()
|
threadPool.generic()
|
||||||
);
|
);
|
||||||
|
|
|
@ -82,7 +82,6 @@ public class TransportClusterAllocationExplainAction extends TransportMasterNode
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ClusterAllocationExplainRequest::new,
|
ClusterAllocationExplainRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
ClusterAllocationExplainResponse::new,
|
ClusterAllocationExplainResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
|
|
@ -57,7 +57,6 @@ public class TransportDeleteDesiredBalanceAction extends TransportMasterNodeActi
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DesiredBalanceRequest::new,
|
DesiredBalanceRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
in -> ActionResponse.Empty.INSTANCE,
|
in -> ActionResponse.Empty.INSTANCE,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
|
|
@ -65,7 +65,6 @@ public class TransportGetAllocationStatsAction extends TransportMasterNodeReadAc
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
TransportGetAllocationStatsAction.Request::new,
|
TransportGetAllocationStatsAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
TransportGetAllocationStatsAction.Response::new,
|
TransportGetAllocationStatsAction.Response::new,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
|
|
@ -68,7 +68,6 @@ public class TransportGetDesiredBalanceAction extends TransportMasterNodeReadAct
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DesiredBalanceRequest::new,
|
DesiredBalanceRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
DesiredBalanceResponse::from,
|
DesiredBalanceResponse::from,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
|
|
@ -83,7 +83,6 @@ public class TransportAddVotingConfigExclusionsAction extends TransportMasterNod
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
AddVotingConfigExclusionsRequest::new,
|
AddVotingConfigExclusionsRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
in -> ActionResponse.Empty.INSTANCE,
|
in -> ActionResponse.Empty.INSTANCE,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -65,7 +65,6 @@ public class TransportClearVotingConfigExclusionsAction extends TransportMasterN
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ClearVotingConfigExclusionsRequest::new,
|
ClearVotingConfigExclusionsRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
in -> ActionResponse.Empty.INSTANCE,
|
in -> ActionResponse.Empty.INSTANCE,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -56,7 +56,6 @@ public class TransportDeleteDesiredNodesAction extends TransportMasterNodeAction
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
AcknowledgedRequest.Plain::new,
|
AcknowledgedRequest.Plain::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
in -> ActionResponse.Empty.INSTANCE,
|
in -> ActionResponse.Empty.INSTANCE,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -43,7 +43,6 @@ public class TransportGetDesiredNodesAction extends TransportMasterNodeReadActio
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetDesiredNodesAction.Request::new,
|
GetDesiredNodesAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetDesiredNodesAction.Response::new,
|
GetDesiredNodesAction.Response::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -64,7 +64,6 @@ public class TransportUpdateDesiredNodesAction extends TransportMasterNodeAction
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
UpdateDesiredNodesRequest::new,
|
UpdateDesiredNodesRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
UpdateDesiredNodesResponse::new,
|
UpdateDesiredNodesResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -56,6 +56,7 @@ public class TransportClusterHealthAction extends TransportMasterNodeReadAction<
|
||||||
public static final ActionType<ClusterHealthResponse> TYPE = new ActionType<ClusterHealthResponse>(NAME);
|
public static final ActionType<ClusterHealthResponse> TYPE = new ActionType<ClusterHealthResponse>(NAME);
|
||||||
private static final Logger logger = LogManager.getLogger(TransportClusterHealthAction.class);
|
private static final Logger logger = LogManager.getLogger(TransportClusterHealthAction.class);
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final AllocationService allocationService;
|
private final AllocationService allocationService;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
|
||||||
|
@ -77,11 +78,11 @@ public class TransportClusterHealthAction extends TransportMasterNodeReadAction<
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ClusterHealthRequest::new,
|
ClusterHealthRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
ClusterHealthResponse::new,
|
ClusterHealthResponse::new,
|
||||||
// fork to management since the health computation can become expensive for large cluster states.
|
// fork to management since the health computation can become expensive for large cluster states.
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.allocationService = allocationService;
|
this.allocationService = allocationService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,6 @@ public class TransportGetFeatureUpgradeStatusAction extends TransportMasterNodeA
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetFeatureUpgradeStatusRequest::new,
|
GetFeatureUpgradeStatusRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetFeatureUpgradeStatusResponse::new,
|
GetFeatureUpgradeStatusResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -63,7 +63,6 @@ public class TransportPostFeatureUpgradeAction extends TransportMasterNodeAction
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PostFeatureUpgradeRequest::new,
|
PostFeatureUpgradeRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
PostFeatureUpgradeResponse::new,
|
PostFeatureUpgradeResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -76,7 +76,6 @@ public class TransportPrevalidateNodeRemovalAction extends TransportMasterNodeRe
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PrevalidateNodeRemovalRequest::new,
|
PrevalidateNodeRemovalRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
PrevalidateNodeRemovalResponse::new,
|
PrevalidateNodeRemovalResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -82,7 +82,6 @@ public final class TransportCleanupRepositoryAction extends TransportMasterNodeA
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
CleanupRepositoryRequest::readFrom,
|
CleanupRepositoryRequest::readFrom,
|
||||||
indexNameExpressionResolver,
|
|
||||||
CleanupRepositoryResponse::new,
|
CleanupRepositoryResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -54,7 +54,6 @@ public class TransportDeleteRepositoryAction extends AcknowledgedTransportMaster
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteRepositoryRequest::new,
|
DeleteRepositoryRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.repositoriesService = repositoriesService;
|
this.repositoriesService = repositoriesService;
|
||||||
|
|
|
@ -46,7 +46,6 @@ public class TransportGetRepositoriesAction extends TransportMasterNodeReadActio
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetRepositoriesRequest::new,
|
GetRepositoriesRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetRepositoriesResponse::new,
|
GetRepositoriesResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -54,7 +54,6 @@ public class TransportPutRepositoryAction extends AcknowledgedTransportMasterNod
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutRepositoryRequest::new,
|
PutRepositoryRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.repositoriesService = repositoriesService;
|
this.repositoriesService = repositoriesService;
|
||||||
|
|
|
@ -48,7 +48,6 @@ public class TransportVerifyRepositoryAction extends TransportMasterNodeAction<V
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
VerifyRepositoryRequest::new,
|
VerifyRepositoryRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
VerifyRepositoryResponse::new,
|
VerifyRepositoryResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -79,7 +79,6 @@ public class TransportClusterRerouteAction extends TransportMasterNodeAction<Clu
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ClusterRerouteRequest::new,
|
ClusterRerouteRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
ClusterRerouteResponse::new,
|
ClusterRerouteResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -71,7 +71,6 @@ public class TransportClusterUpdateSettingsAction extends TransportMasterNodeAct
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ClusterUpdateSettingsRequest::new,
|
ClusterUpdateSettingsRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
ClusterUpdateSettingsResponse::new,
|
ClusterUpdateSettingsResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class TransportClusterSearchShardsAction extends TransportMasterNodeReadA
|
||||||
|
|
||||||
private final IndicesService indicesService;
|
private final IndicesService indicesService;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TransportClusterSearchShardsAction(
|
public TransportClusterSearchShardsAction(
|
||||||
|
@ -66,12 +67,12 @@ public class TransportClusterSearchShardsAction extends TransportMasterNodeReadA
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ClusterSearchShardsRequest::new,
|
ClusterSearchShardsRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
ClusterSearchShardsResponse::new,
|
ClusterSearchShardsResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION)
|
threadPool.executor(ThreadPool.Names.SEARCH_COORDINATION)
|
||||||
);
|
);
|
||||||
this.indicesService = indicesService;
|
this.indicesService = indicesService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -50,7 +50,6 @@ public final class TransportCloneSnapshotAction extends AcknowledgedTransportMas
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
CloneSnapshotRequest::new,
|
CloneSnapshotRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.snapshotsService = snapshotsService;
|
this.snapshotsService = snapshotsService;
|
||||||
|
|
|
@ -49,7 +49,6 @@ public class TransportCreateSnapshotAction extends TransportMasterNodeAction<Cre
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
CreateSnapshotRequest::new,
|
CreateSnapshotRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
CreateSnapshotResponse::new,
|
CreateSnapshotResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -50,7 +50,6 @@ public class TransportDeleteSnapshotAction extends AcknowledgedTransportMasterNo
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteSnapshotRequest::new,
|
DeleteSnapshotRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.snapshotsService = snapshotsService;
|
this.snapshotsService = snapshotsService;
|
||||||
|
|
|
@ -54,7 +54,6 @@ public class TransportResetFeatureStateAction extends TransportMasterNodeAction<
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ResetFeatureStateRequest::fromStream,
|
ResetFeatureStateRequest::fromStream,
|
||||||
indexNameExpressionResolver,
|
|
||||||
ResetFeatureStateResponse::new,
|
ResetFeatureStateResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -46,7 +46,6 @@ public class TransportSnapshottableFeaturesAction extends TransportMasterNodeAct
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetSnapshottableFeaturesRequest::new,
|
GetSnapshottableFeaturesRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetSnapshottableFeaturesResponse::new,
|
GetSnapshottableFeaturesResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -123,7 +123,6 @@ public class TransportGetSnapshotsAction extends TransportMasterNodeAction<GetSn
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetSnapshotsRequest::new,
|
GetSnapshotsRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetSnapshotsResponse::new,
|
GetSnapshotsResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT) // see [NOTE ON THREADING]
|
threadPool.executor(ThreadPool.Names.MANAGEMENT) // see [NOTE ON THREADING]
|
||||||
);
|
);
|
||||||
|
|
|
@ -60,7 +60,6 @@ public class TransportGetShardSnapshotAction extends TransportMasterNodeAction<G
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetShardSnapshotRequest::new,
|
GetShardSnapshotRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetShardSnapshotResponse::new,
|
GetShardSnapshotResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -47,7 +47,6 @@ public class TransportRestoreSnapshotAction extends TransportMasterNodeAction<Re
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
RestoreSnapshotRequest::new,
|
RestoreSnapshotRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
RestoreSnapshotResponse::new,
|
RestoreSnapshotResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.SNAPSHOT_META)
|
threadPool.executor(ThreadPool.Names.SNAPSHOT_META)
|
||||||
);
|
);
|
||||||
|
|
|
@ -91,7 +91,6 @@ public class TransportSnapshotsStatusAction extends TransportMasterNodeAction<Sn
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
SnapshotsStatusRequest::new,
|
SnapshotsStatusRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
SnapshotsStatusResponse::new,
|
SnapshotsStatusResponse::new,
|
||||||
// building the response is somewhat expensive for large snapshots, so we fork.
|
// building the response is somewhat expensive for large snapshots, so we fork.
|
||||||
threadPool.executor(ThreadPool.Names.SNAPSHOT_META)
|
threadPool.executor(ThreadPool.Names.SNAPSHOT_META)
|
||||||
|
|
|
@ -53,7 +53,9 @@ import java.util.function.Predicate;
|
||||||
public class TransportClusterStateAction extends TransportMasterNodeReadAction<ClusterStateRequest, ClusterStateResponse> {
|
public class TransportClusterStateAction extends TransportMasterNodeReadAction<ClusterStateRequest, ClusterStateResponse> {
|
||||||
|
|
||||||
private static final Logger logger = LogManager.getLogger(TransportClusterStateAction.class);
|
private static final Logger logger = LogManager.getLogger(TransportClusterStateAction.class);
|
||||||
|
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TransportClusterStateAction(
|
public TransportClusterStateAction(
|
||||||
|
@ -72,11 +74,11 @@ public class TransportClusterStateAction extends TransportMasterNodeReadAction<C
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ClusterStateRequest::new,
|
ClusterStateRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
ClusterStateResponse::new,
|
ClusterStateResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -45,7 +45,6 @@ public class TransportDeleteStoredScriptAction extends AcknowledgedTransportMast
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteStoredScriptRequest::new,
|
DeleteStoredScriptRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@ public class TransportGetStoredScriptAction extends TransportMasterNodeReadActio
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetStoredScriptRequest::new,
|
GetStoredScriptRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetStoredScriptResponse::new,
|
GetStoredScriptResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -47,7 +47,6 @@ public class TransportPutStoredScriptAction extends AcknowledgedTransportMasterN
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutStoredScriptRequest::new,
|
PutStoredScriptRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.scriptService = scriptService;
|
this.scriptService = scriptService;
|
||||||
|
|
|
@ -50,7 +50,6 @@ public class TransportPendingClusterTasksAction extends TransportMasterNodeReadA
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PendingClusterTasksRequest::new,
|
PendingClusterTasksRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
PendingClusterTasksResponse::new,
|
PendingClusterTasksResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -67,6 +67,7 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeAction<Ind
|
||||||
|
|
||||||
private final MetadataIndexAliasesService indexAliasesService;
|
private final MetadataIndexAliasesService indexAliasesService;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final RequestValidators<IndicesAliasesRequest> requestValidators;
|
private final RequestValidators<IndicesAliasesRequest> requestValidators;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
|
|
||||||
|
@ -89,12 +90,12 @@ public class TransportIndicesAliasesAction extends TransportMasterNodeAction<Ind
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
IndicesAliasesRequest::new,
|
IndicesAliasesRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
IndicesAliasesResponse::new,
|
IndicesAliasesResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.indexAliasesService = indexAliasesService;
|
this.indexAliasesService = indexAliasesService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.requestValidators = Objects.requireNonNull(requestValidators);
|
this.requestValidators = Objects.requireNonNull(requestValidators);
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
|
||||||
|
|
||||||
private final MetadataIndexStateService indexStateService;
|
private final MetadataIndexStateService indexStateService;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final DestructiveOperations destructiveOperations;
|
private final DestructiveOperations destructiveOperations;
|
||||||
private volatile boolean closeIndexEnabled;
|
private volatile boolean closeIndexEnabled;
|
||||||
public static final Setting<Boolean> CLUSTER_INDICES_CLOSE_ENABLE_SETTING = Setting.boolSetting(
|
public static final Setting<Boolean> CLUSTER_INDICES_CLOSE_ENABLE_SETTING = Setting.boolSetting(
|
||||||
|
@ -78,12 +79,12 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
CloseIndexRequest::new,
|
CloseIndexRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
CloseIndexResponse::new,
|
CloseIndexResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.indexStateService = indexStateService;
|
this.indexStateService = indexStateService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.destructiveOperations = destructiveOperations;
|
this.destructiveOperations = destructiveOperations;
|
||||||
this.closeIndexEnabled = CLUSTER_INDICES_CLOSE_ENABLE_SETTING.get(settings);
|
this.closeIndexEnabled = CLUSTER_INDICES_CLOSE_ENABLE_SETTING.get(settings);
|
||||||
clusterSettings.addSettingsUpdateConsumer(CLUSTER_INDICES_CLOSE_ENABLE_SETTING, this::setCloseIndexEnabled);
|
clusterSettings.addSettingsUpdateConsumer(CLUSTER_INDICES_CLOSE_ENABLE_SETTING, this::setCloseIndexEnabled);
|
||||||
|
|
|
@ -107,7 +107,6 @@ public final class AutoCreateAction extends ActionType<CreateIndexResponse> {
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
CreateIndexRequest::new,
|
CreateIndexRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
CreateIndexResponse::new,
|
CreateIndexResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -61,7 +61,6 @@ public class TransportCreateIndexAction extends TransportMasterNodeAction<Create
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
MetadataCreateIndexService createIndexService,
|
MetadataCreateIndexService createIndexService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
SystemIndices systemIndices,
|
SystemIndices systemIndices,
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
|
@ -72,7 +71,6 @@ public class TransportCreateIndexAction extends TransportMasterNodeAction<Create
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
CreateIndexRequest::new,
|
CreateIndexRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
CreateIndexResponse::new,
|
CreateIndexResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -73,7 +73,6 @@ public class TransportDeleteDanglingIndexAction extends AcknowledgedTransportMas
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteDanglingIndexRequest::new,
|
DeleteDanglingIndexRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
threadPool.executor(ThreadPool.Names.GENERIC)
|
threadPool.executor(ThreadPool.Names.GENERIC)
|
||||||
);
|
);
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
|
|
|
@ -45,6 +45,7 @@ public class TransportDeleteIndexAction extends AcknowledgedTransportMasterNodeA
|
||||||
|
|
||||||
private final MetadataDeleteIndexService deleteIndexService;
|
private final MetadataDeleteIndexService deleteIndexService;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final DestructiveOperations destructiveOperations;
|
private final DestructiveOperations destructiveOperations;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -65,11 +66,11 @@ public class TransportDeleteIndexAction extends AcknowledgedTransportMasterNodeA
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteIndexRequest::new,
|
DeleteIndexRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.deleteIndexService = deleteIndexService;
|
this.deleteIndexService = deleteIndexService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.destructiveOperations = destructiveOperations;
|
this.destructiveOperations = destructiveOperations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.action.support.master.AcknowledgedTransportMasterNodeAc
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.metadata.MetadataMappingService;
|
import org.elasticsearch.cluster.metadata.MetadataMappingService;
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -49,7 +48,6 @@ public class TransportAutoPutMappingAction extends AcknowledgedTransportMasterNo
|
||||||
final MetadataMappingService metadataMappingService,
|
final MetadataMappingService metadataMappingService,
|
||||||
final ActionFilters actionFilters,
|
final ActionFilters actionFilters,
|
||||||
final ProjectResolver projectResolver,
|
final ProjectResolver projectResolver,
|
||||||
final IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
final SystemIndices systemIndices
|
final SystemIndices systemIndices
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
@ -59,7 +57,6 @@ public class TransportAutoPutMappingAction extends AcknowledgedTransportMasterNo
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutMappingRequest::new,
|
PutMappingRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.metadataMappingService = metadataMappingService;
|
this.metadataMappingService = metadataMappingService;
|
||||||
|
|
|
@ -56,6 +56,7 @@ public class TransportPutMappingAction extends AcknowledgedTransportMasterNodeAc
|
||||||
private static final Logger logger = LogManager.getLogger(TransportPutMappingAction.class);
|
private static final Logger logger = LogManager.getLogger(TransportPutMappingAction.class);
|
||||||
|
|
||||||
private final MetadataMappingService metadataMappingService;
|
private final MetadataMappingService metadataMappingService;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final RequestValidators<PutMappingRequest> requestValidators;
|
private final RequestValidators<PutMappingRequest> requestValidators;
|
||||||
private final SystemIndices systemIndices;
|
private final SystemIndices systemIndices;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
@ -79,10 +80,10 @@ public class TransportPutMappingAction extends AcknowledgedTransportMasterNodeAc
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutMappingRequest::new,
|
PutMappingRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.metadataMappingService = metadataMappingService;
|
this.metadataMappingService = metadataMappingService;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.requestValidators = Objects.requireNonNull(requestValidators);
|
this.requestValidators = Objects.requireNonNull(requestValidators);
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class TransportOpenIndexAction extends TransportMasterNodeAction<OpenInde
|
||||||
|
|
||||||
private final MetadataIndexStateService indexStateService;
|
private final MetadataIndexStateService indexStateService;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final DestructiveOperations destructiveOperations;
|
private final DestructiveOperations destructiveOperations;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -62,12 +63,12 @@ public class TransportOpenIndexAction extends TransportMasterNodeAction<OpenInde
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
OpenIndexRequest::new,
|
OpenIndexRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
OpenIndexResponse::new,
|
OpenIndexResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.indexStateService = indexStateService;
|
this.indexStateService = indexStateService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.destructiveOperations = destructiveOperations;
|
this.destructiveOperations = destructiveOperations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class TransportAddIndexBlockAction extends TransportMasterNodeAction<AddI
|
||||||
|
|
||||||
private final MetadataIndexStateService indexStateService;
|
private final MetadataIndexStateService indexStateService;
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final DestructiveOperations destructiveOperations;
|
private final DestructiveOperations destructiveOperations;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -69,12 +70,12 @@ public class TransportAddIndexBlockAction extends TransportMasterNodeAction<AddI
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
AddIndexBlockRequest::new,
|
AddIndexBlockRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
AddIndexBlockResponse::new,
|
AddIndexBlockResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.indexStateService = indexStateService;
|
this.indexStateService = indexStateService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.destructiveOperations = destructiveOperations;
|
this.destructiveOperations = destructiveOperations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ public class TransportRolloverAction extends TransportMasterNodeAction<RolloverR
|
||||||
|
|
||||||
private static final Logger logger = LogManager.getLogger(TransportRolloverAction.class);
|
private static final Logger logger = LogManager.getLogger(TransportRolloverAction.class);
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final MasterServiceTaskQueue<RolloverTask> rolloverTaskQueue;
|
private final MasterServiceTaskQueue<RolloverTask> rolloverTaskQueue;
|
||||||
private final MetadataDataStreamsService metadataDataStreamsService;
|
private final MetadataDataStreamsService metadataDataStreamsService;
|
||||||
|
@ -135,10 +136,10 @@ public class TransportRolloverAction extends TransportMasterNodeAction<RolloverR
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
RolloverRequest::new,
|
RolloverRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
RolloverResponse::new,
|
RolloverResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.rolloverTaskQueue = clusterService.createTaskQueue(
|
this.rolloverTaskQueue = clusterService.createTaskQueue(
|
||||||
"rollover",
|
"rollover",
|
||||||
|
|
|
@ -39,6 +39,7 @@ public class TransportGetSettingsAction extends TransportMasterNodeReadAction<Ge
|
||||||
|
|
||||||
private final SettingsFilter settingsFilter;
|
private final SettingsFilter settingsFilter;
|
||||||
private final IndexScopedSettings indexScopedSettings;
|
private final IndexScopedSettings indexScopedSettings;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TransportGetSettingsAction(
|
public TransportGetSettingsAction(
|
||||||
|
@ -57,12 +58,12 @@ public class TransportGetSettingsAction extends TransportMasterNodeReadAction<Ge
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
GetSettingsRequest::new,
|
GetSettingsRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
GetSettingsResponse::new,
|
GetSettingsResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
this.settingsFilter = settingsFilter;
|
this.settingsFilter = settingsFilter;
|
||||||
this.indexScopedSettings = indexedScopedSettings;
|
this.indexScopedSettings = indexedScopedSettings;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -52,8 +52,9 @@ public class TransportUpdateSettingsAction extends AcknowledgedTransportMasterNo
|
||||||
private static final Logger logger = LogManager.getLogger(TransportUpdateSettingsAction.class);
|
private static final Logger logger = LogManager.getLogger(TransportUpdateSettingsAction.class);
|
||||||
|
|
||||||
private final MetadataUpdateSettingsService updateSettingsService;
|
private final MetadataUpdateSettingsService updateSettingsService;
|
||||||
private final SystemIndices systemIndices;
|
|
||||||
private final ProjectResolver projectResolver;
|
private final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
|
private final SystemIndices systemIndices;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TransportUpdateSettingsAction(
|
public TransportUpdateSettingsAction(
|
||||||
|
@ -73,11 +74,11 @@ public class TransportUpdateSettingsAction extends AcknowledgedTransportMasterNo
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
UpdateSettingsRequest::new,
|
UpdateSettingsRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.updateSettingsService = updateSettingsService;
|
this.updateSettingsService = updateSettingsService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.systemIndices = systemIndices;
|
this.systemIndices = systemIndices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ public class TransportIndicesShardStoresAction extends TransportMasterNodeReadAc
|
||||||
|
|
||||||
private static final Logger logger = LogManager.getLogger(TransportIndicesShardStoresAction.class);
|
private static final Logger logger = LogManager.getLogger(TransportIndicesShardStoresAction.class);
|
||||||
|
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
private final NodeClient client;
|
private final NodeClient client;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@ -86,10 +87,10 @@ public class TransportIndicesShardStoresAction extends TransportMasterNodeReadAc
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
IndicesShardStoresRequest::new,
|
IndicesShardStoresRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
IndicesShardStoresResponse::new,
|
IndicesShardStoresResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,6 @@ public class TransportResizeAction extends TransportMasterNodeAction<ResizeReque
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
ResizeRequest::new,
|
ResizeRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
CreateIndexResponse::new,
|
CreateIndexResponse::new,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -60,16 +60,7 @@ public class TransportDeleteComponentTemplateAction extends AcknowledgedTranspor
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
super(
|
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
||||||
TYPE.name(),
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
Request::new,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
|
||||||
);
|
|
||||||
this.indexTemplateService = indexTemplateService;
|
this.indexTemplateService = indexTemplateService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,16 +59,7 @@ public class TransportDeleteComposableIndexTemplateAction extends AcknowledgedTr
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
super(
|
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
||||||
TYPE.name(),
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
Request::new,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
|
||||||
);
|
|
||||||
this.indexTemplateService = indexTemplateService;
|
this.indexTemplateService = indexTemplateService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,6 @@ public class TransportDeleteIndexTemplateAction extends AcknowledgedTransportMas
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeleteIndexTemplateRequest::new,
|
DeleteIndexTemplateRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.indexTemplateService = indexTemplateService;
|
this.indexTemplateService = indexTemplateService;
|
||||||
|
|
|
@ -60,7 +60,6 @@ public class TransportPutComponentTemplateAction extends AcknowledgedTransportMa
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutComponentTemplateAction.Request::new,
|
PutComponentTemplateAction.Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.indexTemplateService = indexTemplateService;
|
this.indexTemplateService = indexTemplateService;
|
||||||
|
|
|
@ -70,16 +70,7 @@ public class TransportPutComposableIndexTemplateAction extends AcknowledgedTrans
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||||
ProjectResolver projectResolver
|
ProjectResolver projectResolver
|
||||||
) {
|
) {
|
||||||
super(
|
super(TYPE.name(), transportService, clusterService, threadPool, actionFilters, Request::new, EsExecutors.DIRECT_EXECUTOR_SERVICE);
|
||||||
TYPE.name(),
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
Request::new,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
|
||||||
);
|
|
||||||
this.indexTemplateService = indexTemplateService;
|
this.indexTemplateService = indexTemplateService;
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,6 @@ public class TransportPutIndexTemplateAction extends AcknowledgedTransportMaster
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutIndexTemplateRequest::new,
|
PutIndexTemplateRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.indexTemplateService = indexTemplateService;
|
this.indexTemplateService = indexTemplateService;
|
||||||
|
|
|
@ -51,7 +51,6 @@ public class DeletePipelineTransportAction extends AcknowledgedTransportMasterNo
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
DeletePipelineRequest::new,
|
DeletePipelineRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
this.ingestService = ingestService;
|
this.ingestService = ingestService;
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.elasticsearch.client.internal.node.NodeClient;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
import org.elasticsearch.common.util.concurrent.EsExecutors;
|
||||||
import org.elasticsearch.ingest.IngestService;
|
import org.elasticsearch.ingest.IngestService;
|
||||||
|
@ -47,7 +46,6 @@ public class PutPipelineTransportAction extends AcknowledgedTransportMasterNodeA
|
||||||
TransportService transportService,
|
TransportService transportService,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
IngestService ingestService,
|
IngestService ingestService,
|
||||||
NodeClient client
|
NodeClient client
|
||||||
) {
|
) {
|
||||||
|
@ -58,7 +56,6 @@ public class PutPipelineTransportAction extends AcknowledgedTransportMasterNodeA
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
PutPipelineRequest::new,
|
PutPipelineRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
// This client is only used to perform an internal implementation detail,
|
// This client is only used to perform an internal implementation detail,
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
package org.elasticsearch.action.support.master;
|
package org.elasticsearch.action.support.master;
|
||||||
|
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
|
@ -32,20 +31,9 @@ public abstract class AcknowledgedTransportMasterNodeAction<Request extends Mast
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
super(
|
super(actionName, transportService, clusterService, threadPool, actionFilters, request, AcknowledgedResponse::readFrom, executor);
|
||||||
actionName,
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
request,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
AcknowledgedResponse::readFrom,
|
|
||||||
executor
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AcknowledgedTransportMasterNodeAction(
|
protected AcknowledgedTransportMasterNodeAction(
|
||||||
|
@ -56,7 +44,6 @@ public abstract class AcknowledgedTransportMasterNodeAction<Request extends Mast
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
super(
|
super(
|
||||||
|
@ -67,7 +54,6 @@ public abstract class AcknowledgedTransportMasterNodeAction<Request extends Mast
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
request,
|
request,
|
||||||
indexNameExpressionResolver,
|
|
||||||
AcknowledgedResponse::readFrom,
|
AcknowledgedResponse::readFrom,
|
||||||
executor
|
executor
|
||||||
);
|
);
|
||||||
|
|
|
@ -14,7 +14,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.ProjectState;
|
import org.elasticsearch.cluster.ProjectState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
|
@ -38,20 +37,9 @@ public abstract class AcknowledgedTransportMasterNodeProjectAction<Request exten
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
super(
|
super(actionName, canTripCircuitBreaker, transportService, clusterService, threadPool, actionFilters, request, executor);
|
||||||
actionName,
|
|
||||||
canTripCircuitBreaker,
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
request,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
executor
|
|
||||||
);
|
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,10 +51,9 @@ public abstract class AcknowledgedTransportMasterNodeProjectAction<Request exten
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
super(actionName, transportService, clusterService, threadPool, actionFilters, request, indexNameExpressionResolver, executor);
|
super(actionName, transportService, clusterService, threadPool, actionFilters, request, executor);
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ import org.elasticsearch.cluster.ClusterStateObserver;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlock;
|
import org.elasticsearch.cluster.block.ClusterBlock;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
|
@ -65,7 +64,6 @@ public abstract class TransportMasterNodeAction<Request extends MasterNodeReques
|
||||||
protected final ThreadPool threadPool;
|
protected final ThreadPool threadPool;
|
||||||
protected final TransportService transportService;
|
protected final TransportService transportService;
|
||||||
protected final ClusterService clusterService;
|
protected final ClusterService clusterService;
|
||||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
|
||||||
|
|
||||||
private final Writeable.Reader<Response> responseReader;
|
private final Writeable.Reader<Response> responseReader;
|
||||||
|
|
||||||
|
@ -78,22 +76,10 @@ public abstract class TransportMasterNodeAction<Request extends MasterNodeReques
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Writeable.Reader<Response> response,
|
Writeable.Reader<Response> response,
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
this(
|
this(actionName, true, transportService, clusterService, threadPool, actionFilters, request, response, executor);
|
||||||
actionName,
|
|
||||||
true,
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
request,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
response,
|
|
||||||
executor
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TransportMasterNodeAction(
|
protected TransportMasterNodeAction(
|
||||||
|
@ -104,7 +90,6 @@ public abstract class TransportMasterNodeAction<Request extends MasterNodeReques
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Writeable.Reader<Response> response,
|
Writeable.Reader<Response> response,
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
|
@ -112,7 +97,6 @@ public abstract class TransportMasterNodeAction<Request extends MasterNodeReques
|
||||||
this.transportService = transportService;
|
this.transportService = transportService;
|
||||||
this.clusterService = clusterService;
|
this.clusterService = clusterService;
|
||||||
this.threadPool = threadPool;
|
this.threadPool = threadPool;
|
||||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
|
||||||
this.executor = executor;
|
this.executor = executor;
|
||||||
this.responseReader = response;
|
this.responseReader = response;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ package org.elasticsearch.action.support.master;
|
||||||
|
|
||||||
import org.elasticsearch.action.ActionResponse;
|
import org.elasticsearch.action.ActionResponse;
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
|
@ -33,22 +32,10 @@ public abstract class TransportMasterNodeReadAction<Request extends MasterNodeRe
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Writeable.Reader<Response> response,
|
Writeable.Reader<Response> response,
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
this(
|
this(actionName, true, transportService, clusterService, threadPool, actionFilters, request, response, executor);
|
||||||
actionName,
|
|
||||||
true,
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
request,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
response,
|
|
||||||
executor
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TransportMasterNodeReadAction(
|
protected TransportMasterNodeReadAction(
|
||||||
|
@ -59,22 +46,10 @@ public abstract class TransportMasterNodeReadAction<Request extends MasterNodeRe
|
||||||
ThreadPool threadPool,
|
ThreadPool threadPool,
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Writeable.Reader<Response> response,
|
Writeable.Reader<Response> response,
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
super(
|
super(actionName, canTripCircuitBreaker, transportService, clusterService, threadPool, actionFilters, request, response, executor);
|
||||||
actionName,
|
|
||||||
canTripCircuitBreaker,
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
request,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
response,
|
|
||||||
executor
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.ProjectState;
|
import org.elasticsearch.cluster.ProjectState;
|
||||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|
||||||
import org.elasticsearch.cluster.project.ProjectResolver;
|
import org.elasticsearch.cluster.project.ProjectResolver;
|
||||||
import org.elasticsearch.cluster.service.ClusterService;
|
import org.elasticsearch.cluster.service.ClusterService;
|
||||||
import org.elasticsearch.common.io.stream.Writeable;
|
import org.elasticsearch.common.io.stream.Writeable;
|
||||||
|
@ -41,21 +40,10 @@ public abstract class TransportMasterNodeReadProjectAction<Request extends Maste
|
||||||
ActionFilters actionFilters,
|
ActionFilters actionFilters,
|
||||||
Writeable.Reader<Request> request,
|
Writeable.Reader<Request> request,
|
||||||
ProjectResolver projectResolver,
|
ProjectResolver projectResolver,
|
||||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
|
||||||
Writeable.Reader<Response> response,
|
Writeable.Reader<Response> response,
|
||||||
Executor executor
|
Executor executor
|
||||||
) {
|
) {
|
||||||
super(
|
super(actionName, transportService, clusterService, threadPool, actionFilters, request, response, executor);
|
||||||
actionName,
|
|
||||||
transportService,
|
|
||||||
clusterService,
|
|
||||||
threadPool,
|
|
||||||
actionFilters,
|
|
||||||
request,
|
|
||||||
indexNameExpressionResolver,
|
|
||||||
response,
|
|
||||||
executor
|
|
||||||
);
|
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ public abstract class TransportClusterInfoAction<Request extends ClusterInfoRequ
|
||||||
TransportMasterNodeReadAction<Request, Response> {
|
TransportMasterNodeReadAction<Request, Response> {
|
||||||
|
|
||||||
protected final ProjectResolver projectResolver;
|
protected final ProjectResolver projectResolver;
|
||||||
|
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||||
|
|
||||||
public TransportClusterInfoAction(
|
public TransportClusterInfoAction(
|
||||||
String actionName,
|
String actionName,
|
||||||
|
@ -48,11 +49,11 @@ public abstract class TransportClusterInfoAction<Request extends ClusterInfoRequ
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
request,
|
request,
|
||||||
indexNameExpressionResolver,
|
|
||||||
response,
|
response,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
this.projectResolver = projectResolver;
|
this.projectResolver = projectResolver;
|
||||||
|
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -209,10 +209,11 @@ public class IndexMetadataVerifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean hasIndexWritesBlock(IndexMetadata indexMetadata) {
|
private static boolean hasIndexWritesBlock(IndexMetadata indexMetadata) {
|
||||||
if (IndexMetadata.INDEX_BLOCKS_WRITE_SETTING.get(indexMetadata.getSettings())) {
|
var indexSettings = indexMetadata.getSettings();
|
||||||
|
if (IndexMetadata.INDEX_BLOCKS_WRITE_SETTING.get(indexSettings) || IndexMetadata.INDEX_READ_ONLY_SETTING.get(indexSettings)) {
|
||||||
return indexMetadata.isSearchableSnapshot()
|
return indexMetadata.isSearchableSnapshot()
|
||||||
|| indexMetadata.getCreationVersion().isLegacyIndexVersion()
|
|| indexMetadata.getCreationVersion().isLegacyIndexVersion()
|
||||||
|| MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.get(indexMetadata.getSettings());
|
|| MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.get(indexSettings);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ package org.elasticsearch.cluster.metadata;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.Build;
|
|
||||||
import org.elasticsearch.ElasticsearchException;
|
import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.TransportVersions;
|
import org.elasticsearch.TransportVersions;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
|
@ -123,8 +122,7 @@ public class MetadataIndexStateService {
|
||||||
false,
|
false,
|
||||||
Setting.Property.IndexScope,
|
Setting.Property.IndexScope,
|
||||||
Setting.Property.NotCopyableOnResize,
|
Setting.Property.NotCopyableOnResize,
|
||||||
// Allow the setting to be updated in snapshot builds
|
Setting.Property.PrivateIndex
|
||||||
Build.current().isSnapshot() ? Setting.Property.OperatorDynamic : Setting.Property.PrivateIndex
|
|
||||||
);
|
);
|
||||||
|
|
||||||
private final ClusterService clusterService;
|
private final ClusterService clusterService;
|
||||||
|
|
|
@ -125,7 +125,6 @@ public class CompletionPersistentTaskAction {
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
Request::new,
|
Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
PersistentTaskResponse::new,
|
PersistentTaskResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.GENERIC)
|
threadPool.executor(ThreadPool.Names.GENERIC)
|
||||||
);
|
);
|
||||||
|
|
|
@ -94,7 +94,6 @@ public class RemovePersistentTaskAction {
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
Request::new,
|
Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
PersistentTaskResponse::new,
|
PersistentTaskResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
|
|
@ -137,7 +137,6 @@ public class StartPersistentTaskAction {
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
Request::new,
|
Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
PersistentTaskResponse::new,
|
PersistentTaskResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.GENERIC)
|
threadPool.executor(ThreadPool.Names.GENERIC)
|
||||||
);
|
);
|
||||||
|
|
|
@ -124,7 +124,6 @@ public class UpdatePersistentTaskStatusAction {
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
Request::new,
|
Request::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
PersistentTaskResponse::new,
|
PersistentTaskResponse::new,
|
||||||
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
threadPool.executor(ThreadPool.Names.MANAGEMENT)
|
||||||
);
|
);
|
||||||
|
|
|
@ -9,12 +9,10 @@
|
||||||
package org.elasticsearch.search.aggregations.metrics;
|
package org.elasticsearch.search.aggregations.metrics;
|
||||||
|
|
||||||
import org.elasticsearch.common.util.BigArrays;
|
import org.elasticsearch.common.util.BigArrays;
|
||||||
import org.elasticsearch.common.util.DoubleArray;
|
|
||||||
import org.elasticsearch.common.util.LongArray;
|
import org.elasticsearch.common.util.LongArray;
|
||||||
import org.elasticsearch.core.Releasables;
|
import org.elasticsearch.core.Releasables;
|
||||||
import org.elasticsearch.index.fielddata.NumericDoubleValues;
|
import org.elasticsearch.index.fielddata.NumericDoubleValues;
|
||||||
import org.elasticsearch.index.fielddata.SortedNumericDoubleValues;
|
import org.elasticsearch.index.fielddata.SortedNumericDoubleValues;
|
||||||
import org.elasticsearch.search.DocValueFormat;
|
|
||||||
import org.elasticsearch.search.aggregations.Aggregator;
|
import org.elasticsearch.search.aggregations.Aggregator;
|
||||||
import org.elasticsearch.search.aggregations.InternalAggregation;
|
import org.elasticsearch.search.aggregations.InternalAggregation;
|
||||||
import org.elasticsearch.search.aggregations.LeafBucketCollector;
|
import org.elasticsearch.search.aggregations.LeafBucketCollector;
|
||||||
|
@ -25,12 +23,9 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceConfig;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
class AvgAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
class AvgAggregator extends SumAggregator {
|
||||||
|
|
||||||
LongArray counts;
|
LongArray counts;
|
||||||
DoubleArray sums;
|
|
||||||
DoubleArray compensations;
|
|
||||||
DocValueFormat format;
|
|
||||||
|
|
||||||
AvgAggregator(
|
AvgAggregator(
|
||||||
String name,
|
String name,
|
||||||
|
@ -40,32 +35,17 @@ class AvgAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
||||||
Map<String, Object> metadata
|
Map<String, Object> metadata
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
super(name, valuesSourceConfig, context, parent, metadata);
|
super(name, valuesSourceConfig, context, parent, metadata);
|
||||||
assert valuesSourceConfig.hasValues();
|
counts = context.bigArrays().newLongArray(1, true);
|
||||||
this.format = valuesSourceConfig.format();
|
|
||||||
final BigArrays bigArrays = context.bigArrays();
|
|
||||||
counts = bigArrays.newLongArray(1, true);
|
|
||||||
sums = bigArrays.newDoubleArray(1, true);
|
|
||||||
compensations = bigArrays.newDoubleArray(1, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LeafBucketCollector getLeafCollector(SortedNumericDoubleValues values, final LeafBucketCollector sub) {
|
protected LeafBucketCollector getLeafCollector(SortedNumericDoubleValues values, final LeafBucketCollector sub) {
|
||||||
final CompensatedSum kahanSummation = new CompensatedSum(0, 0);
|
|
||||||
return new LeafBucketCollectorBase(sub, values) {
|
return new LeafBucketCollectorBase(sub, values) {
|
||||||
@Override
|
@Override
|
||||||
public void collect(int doc, long bucket) throws IOException {
|
public void collect(int doc, long bucket) throws IOException {
|
||||||
if (values.advanceExact(doc)) {
|
if (values.advanceExact(doc)) {
|
||||||
maybeGrow(bucket);
|
maybeGrow(bucket);
|
||||||
final int valueCount = values.docValueCount();
|
counts.increment(bucket, sumSortedDoubles(bucket, values, sums, compensations));
|
||||||
counts.increment(bucket, valueCount);
|
|
||||||
// Compute the sum of double values with Kahan summation algorithm which is more
|
|
||||||
// accurate than naive summation.
|
|
||||||
kahanSummation.reset(sums.get(bucket), compensations.get(bucket));
|
|
||||||
for (int i = 0; i < valueCount; i++) {
|
|
||||||
kahanSummation.add(values.nextValue());
|
|
||||||
}
|
|
||||||
sums.set(bucket, kahanSummation.value());
|
|
||||||
compensations.set(bucket, kahanSummation.delta());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -73,30 +53,22 @@ class AvgAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LeafBucketCollector getLeafCollector(NumericDoubleValues values, final LeafBucketCollector sub) {
|
protected LeafBucketCollector getLeafCollector(NumericDoubleValues values, final LeafBucketCollector sub) {
|
||||||
final CompensatedSum kahanSummation = new CompensatedSum(0, 0);
|
|
||||||
return new LeafBucketCollectorBase(sub, values) {
|
return new LeafBucketCollectorBase(sub, values) {
|
||||||
@Override
|
@Override
|
||||||
public void collect(int doc, long bucket) throws IOException {
|
public void collect(int doc, long bucket) throws IOException {
|
||||||
if (values.advanceExact(doc)) {
|
if (values.advanceExact(doc)) {
|
||||||
maybeGrow(bucket);
|
maybeGrow(bucket);
|
||||||
|
computeSum(bucket, values, sums, compensations);
|
||||||
counts.increment(bucket, 1L);
|
counts.increment(bucket, 1L);
|
||||||
// Compute the sum of double values with Kahan summation algorithm which is more
|
|
||||||
// accurate than naive summation.
|
|
||||||
kahanSummation.reset(sums.get(bucket), compensations.get(bucket));
|
|
||||||
kahanSummation.add(values.doubleValue());
|
|
||||||
sums.set(bucket, kahanSummation.value());
|
|
||||||
compensations.set(bucket, kahanSummation.delta());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maybeGrow(long bucket) {
|
@Override
|
||||||
if (bucket >= counts.size()) {
|
protected void doGrow(long bucket, BigArrays bigArrays) {
|
||||||
counts = bigArrays().grow(counts, bucket + 1);
|
super.doGrow(bucket, bigArrays);
|
||||||
sums = bigArrays().grow(sums, bucket + 1);
|
counts = bigArrays.grow(counts, bucket + 1);
|
||||||
compensations = bigArrays().grow(compensations, bucket + 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -122,7 +94,8 @@ class AvgAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doClose() {
|
public void doClose() {
|
||||||
Releasables.close(counts, sums, compensations);
|
super.doClose();
|
||||||
|
Releasables.close(counts);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.search.aggregations.metrics;
|
package org.elasticsearch.search.aggregations.metrics;
|
||||||
|
|
||||||
|
import org.elasticsearch.common.util.BigArrays;
|
||||||
import org.elasticsearch.common.util.DoubleArray;
|
import org.elasticsearch.common.util.DoubleArray;
|
||||||
import org.elasticsearch.core.Releasables;
|
import org.elasticsearch.core.Releasables;
|
||||||
import org.elasticsearch.index.fielddata.NumericDoubleValues;
|
import org.elasticsearch.index.fielddata.NumericDoubleValues;
|
||||||
|
@ -25,10 +26,9 @@ import java.util.Map;
|
||||||
|
|
||||||
public class SumAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
public class SumAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
||||||
|
|
||||||
private final DocValueFormat format;
|
protected final DocValueFormat format;
|
||||||
|
protected DoubleArray sums;
|
||||||
private DoubleArray sums;
|
protected DoubleArray compensations;
|
||||||
private DoubleArray compensations;
|
|
||||||
|
|
||||||
SumAggregator(
|
SumAggregator(
|
||||||
String name,
|
String name,
|
||||||
|
@ -40,31 +40,56 @@ public class SumAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
||||||
super(name, valuesSourceConfig, context, parent, metadata);
|
super(name, valuesSourceConfig, context, parent, metadata);
|
||||||
assert valuesSourceConfig.hasValues();
|
assert valuesSourceConfig.hasValues();
|
||||||
this.format = valuesSourceConfig.format();
|
this.format = valuesSourceConfig.format();
|
||||||
sums = bigArrays().newDoubleArray(1, true);
|
var bigArrays = context.bigArrays();
|
||||||
compensations = bigArrays().newDoubleArray(1, true);
|
sums = bigArrays.newDoubleArray(1, true);
|
||||||
|
compensations = bigArrays.newDoubleArray(1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LeafBucketCollector getLeafCollector(SortedNumericDoubleValues values, final LeafBucketCollector sub) {
|
protected LeafBucketCollector getLeafCollector(SortedNumericDoubleValues values, final LeafBucketCollector sub) {
|
||||||
final CompensatedSum kahanSummation = new CompensatedSum(0, 0);
|
|
||||||
return new LeafBucketCollectorBase(sub, values) {
|
return new LeafBucketCollectorBase(sub, values) {
|
||||||
@Override
|
@Override
|
||||||
public void collect(int doc, long bucket) throws IOException {
|
public void collect(int doc, long bucket) throws IOException {
|
||||||
if (values.advanceExact(doc)) {
|
if (values.advanceExact(doc)) {
|
||||||
maybeGrow(bucket);
|
maybeGrow(bucket);
|
||||||
// Compute the sum of double values with Kahan summation algorithm which is more
|
sumSortedDoubles(bucket, values, sums, compensations);
|
||||||
// accurate than naive summation.
|
|
||||||
kahanSummation.reset(sums.get(bucket), compensations.get(bucket));
|
|
||||||
for (int i = 0; i < values.docValueCount(); i++) {
|
|
||||||
kahanSummation.add(values.nextValue());
|
|
||||||
}
|
|
||||||
compensations.set(bucket, kahanSummation.delta());
|
|
||||||
sums.set(bucket, kahanSummation.value());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// returns number of values added
|
||||||
|
static int sumSortedDoubles(long bucket, SortedNumericDoubleValues values, DoubleArray sums, DoubleArray compensations)
|
||||||
|
throws IOException {
|
||||||
|
final int valueCount = values.docValueCount();
|
||||||
|
// Compute the sum of double values with Kahan summation algorithm which is more
|
||||||
|
// accurate than naive summation.
|
||||||
|
double value = sums.get(bucket);
|
||||||
|
double delta = compensations.get(bucket);
|
||||||
|
for (int i = 0; i < valueCount; i++) {
|
||||||
|
double added = values.nextValue();
|
||||||
|
value = addIfNonOrInf(added, value);
|
||||||
|
if (Double.isFinite(value)) {
|
||||||
|
double correctedSum = added + delta;
|
||||||
|
double updatedValue = value + correctedSum;
|
||||||
|
delta = correctedSum - (updatedValue - value);
|
||||||
|
value = updatedValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compensations.set(bucket, delta);
|
||||||
|
sums.set(bucket, value);
|
||||||
|
return valueCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double addIfNonOrInf(double added, double value) {
|
||||||
|
// If the value is Inf or NaN, just add it to the running tally to "convert" to
|
||||||
|
// Inf/NaN. This keeps the behavior bwc from before kahan summing
|
||||||
|
if (Double.isFinite(added)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return added + value;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected LeafBucketCollector getLeafCollector(NumericDoubleValues values, final LeafBucketCollector sub) {
|
protected LeafBucketCollector getLeafCollector(NumericDoubleValues values, final LeafBucketCollector sub) {
|
||||||
return new LeafBucketCollectorBase(sub, values) {
|
return new LeafBucketCollectorBase(sub, values) {
|
||||||
|
@ -72,21 +97,20 @@ public class SumAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
||||||
public void collect(int doc, long bucket) throws IOException {
|
public void collect(int doc, long bucket) throws IOException {
|
||||||
if (values.advanceExact(doc)) {
|
if (values.advanceExact(doc)) {
|
||||||
maybeGrow(bucket);
|
maybeGrow(bucket);
|
||||||
var sums = SumAggregator.this.sums;
|
computeSum(bucket, values, sums, compensations);
|
||||||
// Compute the sum of double values with Kahan summation algorithm which is more
|
}
|
||||||
// accurate than naive summation.
|
}
|
||||||
double value = sums.get(bucket);
|
};
|
||||||
// If the value is Inf or NaN, just add it to the running tally to "convert" to
|
|
||||||
// Inf/NaN. This keeps the behavior bwc from before kahan summing
|
|
||||||
double v = values.doubleValue();
|
|
||||||
if (Double.isFinite(v) == false) {
|
|
||||||
value = v + value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void computeSum(long bucket, NumericDoubleValues values, DoubleArray sums, DoubleArray compensations) throws IOException {
|
||||||
|
// Compute the sum of double values with Kahan summation algorithm which is more
|
||||||
|
// accurate than naive summation.
|
||||||
|
double added = values.doubleValue();
|
||||||
|
double value = addIfNonOrInf(added, sums.get(bucket));
|
||||||
if (Double.isFinite(value)) {
|
if (Double.isFinite(value)) {
|
||||||
var compensations = SumAggregator.this.compensations;
|
|
||||||
double delta = compensations.get(bucket);
|
double delta = compensations.get(bucket);
|
||||||
double correctedSum = v + delta;
|
double correctedSum = added + delta;
|
||||||
double updatedValue = value + correctedSum;
|
double updatedValue = value + correctedSum;
|
||||||
delta = correctedSum - (updatedValue - value);
|
delta = correctedSum - (updatedValue - value);
|
||||||
value = updatedValue;
|
value = updatedValue;
|
||||||
|
@ -95,15 +119,17 @@ public class SumAggregator extends NumericMetricsAggregator.SingleDoubleValue {
|
||||||
|
|
||||||
sums.set(bucket, value);
|
sums.set(bucket, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected final void maybeGrow(long bucket) {
|
||||||
|
if (bucket >= sums.size()) {
|
||||||
|
var bigArrays = bigArrays();
|
||||||
|
doGrow(bucket, bigArrays);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maybeGrow(long bucket) {
|
protected void doGrow(long bucket, BigArrays bigArrays) {
|
||||||
if (bucket >= sums.size()) {
|
sums = bigArrays.grow(sums, bucket + 1);
|
||||||
sums = bigArrays().grow(sums, bucket + 1);
|
compensations = bigArrays.grow(compensations, bucket + 1);
|
||||||
compensations = bigArrays().grow(compensations, bucket + 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3673,7 +3673,6 @@ public final class SnapshotsService extends AbstractLifecycleComponent implement
|
||||||
threadPool,
|
threadPool,
|
||||||
actionFilters,
|
actionFilters,
|
||||||
UpdateIndexShardSnapshotStatusRequest::new,
|
UpdateIndexShardSnapshotStatusRequest::new,
|
||||||
indexNameExpressionResolver,
|
|
||||||
in -> ActionResponse.Empty.INSTANCE,
|
in -> ActionResponse.Empty.INSTANCE,
|
||||||
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
EsExecutors.DIRECT_EXECUTOR_SERVICE
|
||||||
);
|
);
|
||||||
|
|
|
@ -147,7 +147,6 @@ public class TransportCreateIndexActionTests extends ESTestCase {
|
||||||
threadPool,
|
threadPool,
|
||||||
metadataCreateIndexService,
|
metadataCreateIndexService,
|
||||||
mock(ActionFilters.class),
|
mock(ActionFilters.class),
|
||||||
indexNameExpressionResolver,
|
|
||||||
SYSTEM_INDICES,
|
SYSTEM_INDICES,
|
||||||
projectResolver
|
projectResolver
|
||||||
);
|
);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue