Skip to content

Commit

Permalink
[ML] Remove unused code for ready legacy DFA progress (#81767)
Browse files Browse the repository at this point in the history
This is a follow up to #80029.
  • Loading branch information
dimitris-athanasiou authored Dec 16, 2021
1 parent a9d68bc commit 5b1b0fb
Showing 1 changed file with 0 additions and 35 deletions.
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

0 comments on commit 5b1b0fb

Please sign in to comment.