File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
server/src/main/java/org/elasticsearch/action/admin/indices/sampling Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,11 @@ public TransportGetSampleAction(
6363 @ Override
6464 protected Void createActionContext (Task task , Request request ) {
6565 String indexName = request .indices ()[0 ];
66- SamplingMetadata samplingMetadata = projectResolver .getProjectMetadata (clusterService .state ()).custom (SamplingMetadata .TYPE );
67- if (samplingMetadata == null || samplingMetadata .getIndexToSamplingConfigMap ().get (indexName ) == null ) {
66+ SamplingConfiguration samplingConfiguration = samplingService .getSamplingConfiguration (
67+ projectResolver .getProjectMetadata (clusterService .state ()),
68+ request .indices ()[0 ]
69+ );
70+ if (samplingConfiguration == null ) {
6871 throw new ResourceNotFoundException ("No sampling configuration found for [" + indexName + "]" );
6972 }
7073 return null ;
Original file line number Diff line number Diff line change @@ -59,8 +59,11 @@ public TransportGetSampleStatsAction(
5959 @ Override
6060 protected Void createActionContext (Task task , GetSampleStatsAction .Request request ) {
6161 String indexName = request .indices ()[0 ];
62- SamplingMetadata samplingMetadata = projectResolver .getProjectMetadata (clusterService .state ()).custom (SamplingMetadata .TYPE );
63- if (samplingMetadata == null || samplingMetadata .getIndexToSamplingConfigMap ().get (indexName ) == null ) {
62+ SamplingConfiguration samplingConfiguration = samplingService .getSamplingConfiguration (
63+ projectResolver .getProjectMetadata (clusterService .state ()),
64+ request .indices ()[0 ]
65+ );
66+ if (samplingConfiguration == null ) {
6467 throw new ResourceNotFoundException ("No sampling configuration found for [" + indexName + "]" );
6568 }
6669 return null ;
You can’t perform that action at this time.
0 commit comments