Skip to content

Commit e9c5479

Browse files
committed
minor performance improvements
1 parent 2d37869 commit e9c5479

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/src/main/java/org/elasticsearch/ingest/SamplingService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ public boolean atLeastOneSampleConfigured() {
252252

253253
@Override
254254
public void clusterChanged(ClusterChangedEvent event) {
255+
if (RANDOM_SAMPLING_FEATURE_FLAG == false) {
256+
return;
257+
}
258+
if (samples.isEmpty()) {
259+
return;
260+
}
255261
// We want to remove any samples if their sampling configuration has been deleted or modified.
256262
if (event.metadataChanged()) {
257263
/*

0 commit comments

Comments
 (0)