mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-25 22:36:20 +00:00
[ML] Default model_snapshots_retention_days to 1 (elastic/x-pack-elasticsearch#759)
relates elastic/x-pack-elasticsearch#722 Original commit: elastic/x-pack-elasticsearch@e68aaf229c
This commit is contained in:
parent
30ea37943c
commit
ca931f4b39
@ -510,7 +510,7 @@ public class Job extends AbstractDiffable<Job> implements Writeable, ToXContent
|
|||||||
private ModelDebugConfig modelDebugConfig;
|
private ModelDebugConfig modelDebugConfig;
|
||||||
private Long renormalizationWindowDays;
|
private Long renormalizationWindowDays;
|
||||||
private TimeValue backgroundPersistInterval;
|
private TimeValue backgroundPersistInterval;
|
||||||
private Long modelSnapshotRetentionDays;
|
private Long modelSnapshotRetentionDays = 1L;
|
||||||
private Long resultsRetentionDays;
|
private Long resultsRetentionDays;
|
||||||
private Map<String, Object> customSettings;
|
private Map<String, Object> customSettings;
|
||||||
private String modelSnapshotId;
|
private String modelSnapshotId;
|
||||||
|
@ -119,9 +119,9 @@ public class DeleteExpiredDataIT extends SecurityIntegTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testDeleteExpiredData() throws Exception {
|
public void testDeleteExpiredData() throws Exception {
|
||||||
jobs.add(newJobBuilder("no-retention").build());
|
jobs.add(newJobBuilder("no-retention").setResultsRetentionDays(null).setModelSnapshotRetentionDays(null).build());
|
||||||
jobs.add(newJobBuilder("results-retention").setResultsRetentionDays(1L).build());
|
jobs.add(newJobBuilder("results-retention").setResultsRetentionDays(1L).setModelSnapshotRetentionDays(null).build());
|
||||||
jobs.add(newJobBuilder("snapshots-retention").setModelSnapshotRetentionDays(2L).build());
|
jobs.add(newJobBuilder("snapshots-retention").setResultsRetentionDays(null).setModelSnapshotRetentionDays(2L).build());
|
||||||
jobs.add(newJobBuilder("results-and-snapshots-retention").setResultsRetentionDays(1L).setModelSnapshotRetentionDays(2L).build());
|
jobs.add(newJobBuilder("results-and-snapshots-retention").setResultsRetentionDays(1L).setModelSnapshotRetentionDays(2L).build());
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
|
@ -21,6 +21,8 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
|
||||||
public class JobTests extends AbstractSerializingTestCase<Job> {
|
public class JobTests extends AbstractSerializingTestCase<Job> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -53,7 +55,7 @@ public class JobTests extends AbstractSerializingTestCase<Job> {
|
|||||||
assertNull(job.getModelDebugConfig());
|
assertNull(job.getModelDebugConfig());
|
||||||
assertNull(job.getRenormalizationWindowDays());
|
assertNull(job.getRenormalizationWindowDays());
|
||||||
assertNull(job.getBackgroundPersistInterval());
|
assertNull(job.getBackgroundPersistInterval());
|
||||||
assertNull(job.getModelSnapshotRetentionDays());
|
assertThat(job.getModelSnapshotRetentionDays(), equalTo(1L));
|
||||||
assertNull(job.getResultsRetentionDays());
|
assertNull(job.getResultsRetentionDays());
|
||||||
assertNotNull(job.allFields());
|
assertNotNull(job.allFields());
|
||||||
assertFalse(job.allFields().isEmpty());
|
assertFalse(job.allFields().isEmpty());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user