Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Remove unused method AutodetectParams.Builder.setFilters #63662

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -38,7 +38,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 @@ -75,7 +74,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 @@ -137,7 +135,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 @@ -707,7 +704,6 @@ private AutodetectParams buildAutodetectParams() {
.setModelSizeStats(modelSizeStats)
.setModelSnapshot(modelSnapshot)
.setQuantiles(quantiles)
.setFilters(filters)
.build();
}

Expand Down