Skip to content

Commit 1edb62c

Browse files
committed
License check
1 parent d399b53 commit 1edb62c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plan/logical/ChangePoint.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import org.elasticsearch.common.io.stream.StreamOutput;
1010
import org.elasticsearch.compute.operator.ChangePointOperator;
11+
import org.elasticsearch.license.XPackLicenseState;
12+
import org.elasticsearch.xpack.esql.LicenseAware;
1113
import org.elasticsearch.xpack.esql.capabilities.PostAnalysisVerificationAware;
1214
import org.elasticsearch.xpack.esql.common.Failures;
1315
import org.elasticsearch.xpack.esql.core.expression.Attribute;
@@ -19,6 +21,7 @@
1921
import org.elasticsearch.xpack.esql.core.type.DataType;
2022
import org.elasticsearch.xpack.esql.expression.NamedExpressions;
2123
import org.elasticsearch.xpack.esql.expression.Order;
24+
import org.elasticsearch.xpack.ml.MachineLearning;
2225

2326
import java.io.IOException;
2427
import java.util.List;
@@ -38,7 +41,7 @@
3841
* Furthermore, ChangePoint should be called with at most 1000 data points. That's
3942
* enforced by the Limit in the surrogate plan.
4043
*/
41-
public class ChangePoint extends UnaryPlan implements SurrogateLogicalPlan, PostAnalysisVerificationAware {
44+
public class ChangePoint extends UnaryPlan implements SurrogateLogicalPlan, PostAnalysisVerificationAware, LicenseAware {
4245

4346
private final Attribute value;
4447
private final Attribute key;
@@ -153,4 +156,9 @@ public void postAnalysisVerification(Failures failures) {
153156
failures.add(fail(this, "change point value [" + value.name() + "] must be numeric"));
154157
}
155158
}
159+
160+
@Override
161+
public boolean licenseCheck(XPackLicenseState state) {
162+
return MachineLearning.CHANGE_POINT_AGG_FEATURE.check(state);
163+
}
156164
}

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/MachineLearning.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ public class MachineLearning extends Plugin
540540
"inference-agg",
541541
License.OperationMode.PLATINUM
542542
);
543-
private static final LicensedFeature.Momentary CHANGE_POINT_AGG_FEATURE = LicensedFeature.momentary(
543+
public static final LicensedFeature.Momentary CHANGE_POINT_AGG_FEATURE = LicensedFeature.momentary(
544544
MachineLearningField.ML_FEATURE_FAMILY,
545545
"change-point-agg",
546546
License.OperationMode.PLATINUM

0 commit comments

Comments
 (0)