16
16
import org .opensearch .core .xcontent .ToXContentObject ;
17
17
import org .opensearch .core .xcontent .XContentBuilder ;
18
18
import org .opensearch .core .xcontent .XContentParser ;
19
- import org .opensearch .ml .common .transport .sync .MLSyncUpInput ;
20
19
21
20
import java .io .IOException ;
22
21
@@ -28,6 +27,7 @@ public class MLDeploySetting implements ToXContentObject, Writeable {
28
27
public static final String IS_AUTO_DEPLOY_ENABLED_FIELD = "is_auto_deploy_enabled" ;
29
28
public static final String MODEL_TTL_MINUTES_FIELD = "model_ttl_minutes" ;
30
29
private static final long DEFAULT_TTL_MINUTES = -1 ;
30
+ public static final Version MINIMAL_SUPPORTED_VERSION_FOR_MODEL_TTL = Version .V_2_14_0 ;
31
31
32
32
private Boolean isAutoDeployEnabled ;
33
33
private Long modelTTLInMinutes ; // in minutes
@@ -44,7 +44,7 @@ public MLDeploySetting(Boolean isAutoDeployEnabled, Long modelTTLInMinutes) {
44
44
public MLDeploySetting (StreamInput in ) throws IOException {
45
45
this .isAutoDeployEnabled = in .readOptionalBoolean ();
46
46
Version streamInputVersion = in .getVersion ();
47
- if (streamInputVersion .onOrAfter (MLSyncUpInput . MINIMAL_SUPPORTED_VERSION_FOR_MODEL_TTL )) {
47
+ if (streamInputVersion .onOrAfter (MINIMAL_SUPPORTED_VERSION_FOR_MODEL_TTL )) {
48
48
this .modelTTLInMinutes = in .readOptionalLong ();
49
49
}
50
50
}
@@ -53,7 +53,7 @@ public MLDeploySetting(StreamInput in) throws IOException {
53
53
public void writeTo (StreamOutput out ) throws IOException {
54
54
Version streamOutputVersion = out .getVersion ();
55
55
out .writeOptionalBoolean (isAutoDeployEnabled );
56
- if (streamOutputVersion .onOrAfter (MLSyncUpInput . MINIMAL_SUPPORTED_VERSION_FOR_MODEL_TTL )) {
56
+ if (streamOutputVersion .onOrAfter (MINIMAL_SUPPORTED_VERSION_FOR_MODEL_TTL )) {
57
57
out .writeOptionalLong (modelTTLInMinutes );
58
58
}
59
59
}
0 commit comments