Skip to content

[ML] Remove unused code for ready legacy DFA progress #81767

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

Merged
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 @@ -34,7 +34,6 @@
import org.elasticsearch.xpack.core.ml.utils.ToXContentParams;

import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -207,40 +206,6 @@ public Stats(StreamInput in) throws IOException {
assignmentExplanation = in.readOptionalString();
}

private static List<PhaseProgress> readProgressFromLegacy(DataFrameAnalyticsState state, StreamInput in) throws IOException {
Integer legacyProgressPercent = in.readOptionalInt();
if (legacyProgressPercent == null) {
return Collections.emptyList();
}

int reindexingProgress = 0;
int loadingDataProgress = 0;
int analyzingProgress = 0;
switch (state) {
case ANALYZING:
reindexingProgress = 100;
loadingDataProgress = 100;
analyzingProgress = legacyProgressPercent;
break;
case REINDEXING:
reindexingProgress = legacyProgressPercent;
break;
case STARTING:
case STARTED:
case STOPPED:
case STOPPING:
default:
return null;
}

return Arrays.asList(
new PhaseProgress("reindexing", reindexingProgress),
new PhaseProgress("loading_data", loadingDataProgress),
new PhaseProgress("analyzing", analyzingProgress),
new PhaseProgress("writing_results", 0)
);
}

public String getId() {
return id;
}
Expand Down