Skip to content

Commit

Permalink
[7.x][ML] Remove unused method AutodetectParams.Builder.setFilters (e…
Browse files Browse the repository at this point in the history
…lastic#63662) (elastic#63678)

Backport of elastic#63662

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
dimitris-athanasiou and elasticmachine authored Oct 14, 2020
1 parent 902f217 commit 5d0fae0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,13 @@ public static class Builder {
private TimingStats timingStats;
private ModelSnapshot modelSnapshot;
private Quantiles quantiles;
private Set<MlFilter> filters;
private final Set<MlFilter> filters = new HashSet<>();
private List<ScheduledEvent> scheduledEvents;

public Builder(String jobId) {
dataCounts = new DataCounts(jobId);
modelSizeStats = new ModelSizeStats.Builder(jobId).build();
timingStats = new TimingStats(jobId);
filters = new HashSet<>();
scheduledEvents = new ArrayList<>();
}

Expand Down Expand Up @@ -160,11 +159,6 @@ public Builder addFilter(MlFilter filter) {
return this;
}

public Builder setFilters(Set<MlFilter> filters) {
filters = Objects.requireNonNull(filters);
return this;
}

public AutodetectParams build() {
return new AutodetectParams(dataCounts, modelSizeStats, timingStats, modelSnapshot, quantiles,
filters, scheduledEvents);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.elasticsearch.xpack.core.ml.job.config.JobState;
import org.elasticsearch.xpack.core.ml.job.config.JobTaskState;
import org.elasticsearch.xpack.core.ml.job.config.JobUpdate;
import org.elasticsearch.xpack.core.ml.job.config.MlFilter;
import org.elasticsearch.xpack.core.ml.job.config.ModelPlotConfig;
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex;
import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndexFields;
Expand Down Expand Up @@ -76,7 +75,6 @@
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
Expand Down Expand Up @@ -138,7 +136,6 @@ public class AutodetectProcessManagerTests extends ESTestCase {
private ModelSizeStats modelSizeStats = new ModelSizeStats.Builder("foo").build();
private ModelSnapshot modelSnapshot = new ModelSnapshot.Builder("foo").build();
private Quantiles quantiles = new Quantiles("foo", new Date(), "state");
private Set<MlFilter> filters = new HashSet<>();

@Before
public void setup() throws Exception {
Expand Down Expand Up @@ -711,7 +708,6 @@ private AutodetectParams buildAutodetectParams() {
.setModelSizeStats(modelSizeStats)
.setModelSnapshot(modelSnapshot)
.setQuantiles(quantiles)
.setFilters(filters)
.build();
}

Expand Down

0 comments on commit 5d0fae0

Please sign in to comment.