@@ -64,7 +64,6 @@ public class AnalysisConfig implements ToXContentObject, Writeable {
6464 private static final ParseField OVERLAPPING_BUCKETS = new ParseField ("overlapping_buckets" );
6565 private static final ParseField RESULT_FINALIZATION_WINDOW = new ParseField ("result_finalization_window" );
6666 private static final ParseField MULTIVARIATE_BY_FIELDS = new ParseField ("multivariate_by_fields" );
67- private static final ParseField USER_PER_PARTITION_NORMALIZATION = new ParseField ("use_per_partition_normalization" );
6867
6968 public static final String ML_CATEGORY_FIELD = "mlcategory" ;
7069 public static final Set <String > AUTO_CREATED_FIELDS = new HashSet <>(Collections .singletonList (ML_CATEGORY_FIELD ));
@@ -98,7 +97,6 @@ private static ConstructingObjectParser<AnalysisConfig.Builder, Void> createPars
9897 parser .declareBoolean (Builder ::setOverlappingBuckets , OVERLAPPING_BUCKETS );
9998 parser .declareLong (Builder ::setResultFinalizationWindow , RESULT_FINALIZATION_WINDOW );
10099 parser .declareBoolean (Builder ::setMultivariateByFields , MULTIVARIATE_BY_FIELDS );
101- parser .declareBoolean (Builder ::setUsePerPartitionNormalization , USER_PER_PARTITION_NORMALIZATION );
102100
103101 return parser ;
104102 }
@@ -117,12 +115,11 @@ private static ConstructingObjectParser<AnalysisConfig.Builder, Void> createPars
117115 private final Boolean overlappingBuckets ;
118116 private final Long resultFinalizationWindow ;
119117 private final Boolean multivariateByFields ;
120- private final boolean usePerPartitionNormalization ;
121118
122119 private AnalysisConfig (TimeValue bucketSpan , String categorizationFieldName , List <String > categorizationFilters ,
123120 CategorizationAnalyzerConfig categorizationAnalyzerConfig , TimeValue latency , String summaryCountFieldName ,
124121 List <Detector > detectors , List <String > influencers , Boolean overlappingBuckets , Long resultFinalizationWindow ,
125- Boolean multivariateByFields , boolean usePerPartitionNormalization ) {
122+ Boolean multivariateByFields ) {
126123 this .detectors = detectors ;
127124 this .bucketSpan = bucketSpan ;
128125 this .latency = latency ;
@@ -134,7 +131,6 @@ private AnalysisConfig(TimeValue bucketSpan, String categorizationFieldName, Lis
134131 this .overlappingBuckets = overlappingBuckets ;
135132 this .resultFinalizationWindow = resultFinalizationWindow ;
136133 this .multivariateByFields = multivariateByFields ;
137- this .usePerPartitionNormalization = usePerPartitionNormalization ;
138134 }
139135
140136 public AnalysisConfig (StreamInput in ) throws IOException {
@@ -165,7 +161,12 @@ public AnalysisConfig(StreamInput in) throws IOException {
165161 }
166162 }
167163
168- usePerPartitionNormalization = in .readBoolean ();
164+ // BWC for removed per-partition normalization
165+ // Version check is temporarily against the latest to satisfy CI tests
166+ // TODO change to V_6_5_0 after successful backport to 6.x
167+ if (in .getVersion ().before (Version .V_7_0_0_alpha1 )) {
168+ in .readBoolean ();
169+ }
169170 }
170171
171172 @ Override
@@ -195,7 +196,12 @@ public void writeTo(StreamOutput out) throws IOException {
195196 out .writeBoolean (false );
196197 }
197198
198- out .writeBoolean (usePerPartitionNormalization );
199+ // BWC for removed per-partition normalization
200+ // Version check is temporarily against the latest to satisfy CI tests
201+ // TODO change to V_6_5_0 after successful backport to 6.x
202+ if (out .getVersion ().before (Version .V_7_0_0_alpha1 )) {
203+ out .writeBoolean (false );
204+ }
199205 }
200206
201207 /**
@@ -299,10 +305,6 @@ public Boolean getMultivariateByFields() {
299305 return multivariateByFields ;
300306 }
301307
302- public boolean getUsePerPartitionNormalization () {
303- return usePerPartitionNormalization ;
304- }
305-
306308 /**
307309 * Return the set of fields required by the analysis.
308310 * These are the influencer fields, metric field, partition field,
@@ -403,9 +405,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
403405 if (multivariateByFields != null ) {
404406 builder .field (MULTIVARIATE_BY_FIELDS .getPreferredName (), multivariateByFields );
405407 }
406- if (usePerPartitionNormalization ) {
407- builder .field (USER_PER_PARTITION_NORMALIZATION .getPreferredName (), usePerPartitionNormalization );
408- }
409408 builder .endObject ();
410409 return builder ;
411410 }
@@ -416,7 +415,6 @@ public boolean equals(Object o) {
416415 if (o == null || getClass () != o .getClass ()) return false ;
417416 AnalysisConfig that = (AnalysisConfig ) o ;
418417 return Objects .equals (latency , that .latency ) &&
419- usePerPartitionNormalization == that .usePerPartitionNormalization &&
420418 Objects .equals (bucketSpan , that .bucketSpan ) &&
421419 Objects .equals (categorizationFieldName , that .categorizationFieldName ) &&
422420 Objects .equals (categorizationFilters , that .categorizationFilters ) &&
@@ -434,7 +432,7 @@ public int hashCode() {
434432 return Objects .hash (
435433 bucketSpan , categorizationFieldName , categorizationFilters , categorizationAnalyzerConfig , latency ,
436434 summaryCountFieldName , detectors , influencers , overlappingBuckets , resultFinalizationWindow ,
437- multivariateByFields , usePerPartitionNormalization
435+ multivariateByFields
438436 );
439437 }
440438
@@ -453,7 +451,6 @@ public static class Builder {
453451 private Boolean overlappingBuckets ;
454452 private Long resultFinalizationWindow ;
455453 private Boolean multivariateByFields ;
456- private boolean usePerPartitionNormalization = false ;
457454
458455 public Builder (List <Detector > detectors ) {
459456 setDetectors (detectors );
@@ -472,7 +469,6 @@ public Builder(AnalysisConfig analysisConfig) {
472469 this .overlappingBuckets = analysisConfig .overlappingBuckets ;
473470 this .resultFinalizationWindow = analysisConfig .resultFinalizationWindow ;
474471 this .multivariateByFields = analysisConfig .multivariateByFields ;
475- this .usePerPartitionNormalization = analysisConfig .usePerPartitionNormalization ;
476472 }
477473
478474 public void setDetectors (List <Detector > detectors ) {
@@ -535,10 +531,6 @@ public void setMultivariateByFields(Boolean multivariateByFields) {
535531 this .multivariateByFields = multivariateByFields ;
536532 }
537533
538- public void setUsePerPartitionNormalization (boolean usePerPartitionNormalization ) {
539- this .usePerPartitionNormalization = usePerPartitionNormalization ;
540- }
541-
542534 /**
543535 * Checks the configuration is valid
544536 * <ol>
@@ -571,16 +563,11 @@ public AnalysisConfig build() {
571563
572564 overlappingBuckets = verifyOverlappingBucketsConfig (overlappingBuckets , detectors );
573565
574- if (usePerPartitionNormalization ) {
575- checkDetectorsHavePartitionFields (detectors );
576- checkNoInfluencersAreSet (influencers );
577- }
578-
579566 verifyNoInconsistentNestedFieldNames ();
580567
581568 return new AnalysisConfig (bucketSpan , categorizationFieldName , categorizationFilters , categorizationAnalyzerConfig ,
582569 latency , summaryCountFieldName , detectors , influencers , overlappingBuckets ,
583- resultFinalizationWindow , multivariateByFields , usePerPartitionNormalization );
570+ resultFinalizationWindow , multivariateByFields );
584571 }
585572
586573 private void verifyNoMetricFunctionsWhenSummaryCountFieldNameIsSet () {
@@ -704,23 +691,6 @@ private void verifyCategorizationFiltersAreValidRegex() {
704691 }
705692 }
706693
707- private static void checkDetectorsHavePartitionFields (List <Detector > detectors ) {
708- for (Detector detector : detectors ) {
709- if (!Strings .isNullOrEmpty (detector .getPartitionFieldName ())) {
710- return ;
711- }
712- }
713- throw ExceptionsHelper .badRequestException (Messages .getMessage (
714- Messages .JOB_CONFIG_PER_PARTITION_NORMALIZATION_REQUIRES_PARTITION_FIELD ));
715- }
716-
717- private static void checkNoInfluencersAreSet (List <String > influencers ) {
718- if (!influencers .isEmpty ()) {
719- throw ExceptionsHelper .badRequestException (Messages .getMessage (
720- Messages .JOB_CONFIG_PER_PARTITION_NORMALIZATION_CANNOT_USE_INFLUENCERS ));
721- }
722- }
723-
724694 private static boolean isValidRegex (String exp ) {
725695 try {
726696 Pattern .compile (exp );
0 commit comments