@@ -56,8 +56,8 @@ public class MLModel implements ToXContentObject {
56
56
57
57
// Model level quota and throttling control
58
58
public static final String IS_ENABLED_FIELD = "is_enabled" ;
59
- public static final String MODEL_RATE_LIMITER_CONFIG_FIELD = "model_rate_limiter_config " ;
60
- public static final String IS_MODEL_CONTROLLER_ENABLED_FIELD = "is_model_controller_enabled " ;
59
+ public static final String RATE_LIMITER_FIELD = "rate_limiter " ;
60
+ public static final String IS_CONTROLLER_ENABLED_FIELD = "is_controller_enabled " ;
61
61
public static final String MODEL_CONFIG_FIELD = "model_config" ;
62
62
public static final String CREATED_TIME_FIELD = "created_time" ;
63
63
public static final String LAST_UPDATED_TIME_FIELD = "last_updated_time" ;
@@ -100,8 +100,8 @@ public class MLModel implements ToXContentObject {
100
100
private String modelContentHash ;
101
101
private MLModelConfig modelConfig ;
102
102
private Boolean isEnabled ;
103
- private Boolean isModelControllerEnabled ;
104
- private MLRateLimiter modelRateLimiterConfig ;
103
+ private Boolean isControllerEnabled ;
104
+ private MLRateLimiter rateLimiter ;
105
105
private Instant createdTime ;
106
106
private Instant lastUpdateTime ;
107
107
private Instant lastRegisteredTime ;
@@ -120,7 +120,8 @@ public class MLModel implements ToXContentObject {
120
120
private String [] planningWorkerNodes ; // plan to deploy model to these nodes
121
121
private boolean deployToAllNodes ;
122
122
123
- //is domain manager creates any special hidden model in the cluster this status will be true. Otherwise,
123
+ // is domain manager creates any special hidden model in the cluster this status
124
+ // will be true. Otherwise,
124
125
// False by default
125
126
private Boolean isHidden ;
126
127
@ Setter
@@ -129,35 +130,35 @@ public class MLModel implements ToXContentObject {
129
130
130
131
@ Builder (toBuilder = true )
131
132
public MLModel (String name ,
132
- String modelGroupId ,
133
- FunctionName algorithm ,
134
- String version ,
135
- String content ,
136
- User user ,
137
- String description ,
138
- MLModelFormat modelFormat ,
139
- MLModelState modelState ,
140
- Long modelContentSizeInBytes ,
141
- String modelContentHash ,
142
- Boolean isEnabled ,
143
- Boolean isModelControllerEnabled ,
144
- MLRateLimiter modelRateLimiterConfig ,
145
- MLModelConfig modelConfig ,
146
- Instant createdTime ,
147
- Instant lastUpdateTime ,
148
- Instant lastRegisteredTime ,
149
- Instant lastDeployedTime ,
150
- Instant lastUndeployedTime ,
151
- Integer autoRedeployRetryTimes ,
152
- String modelId , Integer chunkNumber ,
153
- Integer totalChunks ,
154
- Integer planningWorkerNodeCount ,
155
- Integer currentWorkerNodeCount ,
156
- String [] planningWorkerNodes ,
157
- boolean deployToAllNodes ,
158
- Boolean isHidden ,
159
- Connector connector ,
160
- String connectorId ) {
133
+ String modelGroupId ,
134
+ FunctionName algorithm ,
135
+ String version ,
136
+ String content ,
137
+ User user ,
138
+ String description ,
139
+ MLModelFormat modelFormat ,
140
+ MLModelState modelState ,
141
+ Long modelContentSizeInBytes ,
142
+ String modelContentHash ,
143
+ Boolean isEnabled ,
144
+ Boolean isControllerEnabled ,
145
+ MLRateLimiter rateLimiter ,
146
+ MLModelConfig modelConfig ,
147
+ Instant createdTime ,
148
+ Instant lastUpdateTime ,
149
+ Instant lastRegisteredTime ,
150
+ Instant lastDeployedTime ,
151
+ Instant lastUndeployedTime ,
152
+ Integer autoRedeployRetryTimes ,
153
+ String modelId , Integer chunkNumber ,
154
+ Integer totalChunks ,
155
+ Integer planningWorkerNodeCount ,
156
+ Integer currentWorkerNodeCount ,
157
+ String [] planningWorkerNodes ,
158
+ boolean deployToAllNodes ,
159
+ Boolean isHidden ,
160
+ Connector connector ,
161
+ String connectorId ) {
161
162
this .name = name ;
162
163
this .modelGroupId = modelGroupId ;
163
164
this .algorithm = algorithm ;
@@ -170,8 +171,8 @@ public MLModel(String name,
170
171
this .modelContentSizeInBytes = modelContentSizeInBytes ;
171
172
this .modelContentHash = modelContentHash ;
172
173
this .isEnabled = isEnabled ;
173
- this .isModelControllerEnabled = isModelControllerEnabled ;
174
- this .modelRateLimiterConfig = modelRateLimiterConfig ;
174
+ this .isControllerEnabled = isControllerEnabled ;
175
+ this .rateLimiter = rateLimiter ;
175
176
this .modelConfig = modelConfig ;
176
177
this .createdTime = createdTime ;
177
178
this .lastUpdateTime = lastUpdateTime ;
@@ -191,7 +192,7 @@ public MLModel(String name,
191
192
this .connectorId = connectorId ;
192
193
}
193
194
194
- public MLModel (StreamInput input ) throws IOException {
195
+ public MLModel (StreamInput input ) throws IOException {
195
196
name = input .readOptionalString ();
196
197
algorithm = input .readEnum (FunctionName .class );
197
198
version = input .readString ();
@@ -219,9 +220,9 @@ public MLModel(StreamInput input) throws IOException{
219
220
}
220
221
}
221
222
isEnabled = input .readOptionalBoolean ();
222
- isModelControllerEnabled = input .readOptionalBoolean ();
223
+ isControllerEnabled = input .readOptionalBoolean ();
223
224
if (input .readBoolean ()) {
224
- modelRateLimiterConfig = new MLRateLimiter (input );
225
+ rateLimiter = new MLRateLimiter (input );
225
226
}
226
227
createdTime = input .readOptionalInstant ();
227
228
lastUpdateTime = input .readOptionalInstant ();
@@ -278,10 +279,10 @@ public void writeTo(StreamOutput out) throws IOException {
278
279
out .writeBoolean (false );
279
280
}
280
281
out .writeOptionalBoolean (isEnabled );
281
- out .writeOptionalBoolean (isModelControllerEnabled );
282
- if (modelRateLimiterConfig != null ) {
282
+ out .writeOptionalBoolean (isControllerEnabled );
283
+ if (rateLimiter != null ) {
283
284
out .writeBoolean (true );
284
- modelRateLimiterConfig .writeTo (out );
285
+ rateLimiter .writeTo (out );
285
286
} else {
286
287
out .writeBoolean (false );
287
288
}
@@ -351,11 +352,11 @@ public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params par
351
352
if (isEnabled != null ) {
352
353
builder .field (IS_ENABLED_FIELD , isEnabled );
353
354
}
354
- if (isModelControllerEnabled != null ) {
355
- builder .field (IS_MODEL_CONTROLLER_ENABLED_FIELD , isModelControllerEnabled );
355
+ if (isControllerEnabled != null ) {
356
+ builder .field (IS_CONTROLLER_ENABLED_FIELD , isControllerEnabled );
356
357
}
357
- if (modelRateLimiterConfig != null ) {
358
- builder .field (MODEL_RATE_LIMITER_CONFIG_FIELD , modelRateLimiterConfig );
358
+ if (rateLimiter != null ) {
359
+ builder .field (RATE_LIMITER_FIELD , rateLimiter );
359
360
}
360
361
if (createdTime != null ) {
361
362
builder .field (CREATED_TIME_FIELD , createdTime .toEpochMilli ());
@@ -426,8 +427,8 @@ public static MLModel parse(XContentParser parser, String algorithmName) throws
426
427
String modelContentHash = null ;
427
428
MLModelConfig modelConfig = null ;
428
429
Boolean isEnabled = null ;
429
- Boolean isModelControllerEnabled = null ;
430
- MLRateLimiter modelRateLimiterConfig = null ;
430
+ Boolean isControllerEnabled = null ;
431
+ MLRateLimiter rateLimiter = null ;
431
432
Instant createdTime = null ;
432
433
Instant lastUpdateTime = null ;
433
434
Instant lastUploadedTime = null ;
@@ -516,11 +517,11 @@ public static MLModel parse(XContentParser parser, String algorithmName) throws
516
517
case IS_ENABLED_FIELD :
517
518
isEnabled = parser .booleanValue ();
518
519
break ;
519
- case IS_MODEL_CONTROLLER_ENABLED_FIELD :
520
- isModelControllerEnabled = parser .booleanValue ();
520
+ case IS_CONTROLLER_ENABLED_FIELD :
521
+ isControllerEnabled = parser .booleanValue ();
521
522
break ;
522
- case MODEL_RATE_LIMITER_CONFIG_FIELD :
523
- modelRateLimiterConfig = MLRateLimiter .parse (parser );
523
+ case RATE_LIMITER_FIELD :
524
+ rateLimiter = MLRateLimiter .parse (parser );
524
525
break ;
525
526
case PLANNING_WORKER_NODE_COUNT_FIELD :
526
527
planningWorkerNodeCount = parser .intValue ();
@@ -589,13 +590,13 @@ public static MLModel parse(XContentParser parser, String algorithmName) throws
589
590
.modelContentHash (modelContentHash )
590
591
.modelConfig (modelConfig )
591
592
.isEnabled (isEnabled )
592
- .isModelControllerEnabled ( isModelControllerEnabled )
593
- .modelRateLimiterConfig ( modelRateLimiterConfig )
593
+ .isControllerEnabled ( isControllerEnabled )
594
+ .rateLimiter ( rateLimiter )
594
595
.createdTime (createdTime )
595
596
.lastUpdateTime (lastUpdateTime )
596
- .lastRegisteredTime (lastRegisteredTime == null ? lastUploadedTime : lastRegisteredTime )
597
- .lastDeployedTime (lastDeployedTime == null ? lastLoadedTime : lastDeployedTime )
598
- .lastUndeployedTime (lastUndeployedTime == null ? lastUnloadedTime : lastUndeployedTime )
597
+ .lastRegisteredTime (lastRegisteredTime == null ? lastUploadedTime : lastRegisteredTime )
598
+ .lastDeployedTime (lastDeployedTime == null ? lastLoadedTime : lastDeployedTime )
599
+ .lastUndeployedTime (lastUndeployedTime == null ? lastUnloadedTime : lastUndeployedTime )
599
600
.modelId (modelId )
600
601
.autoRedeployRetryTimes (autoRedeployRetryTimes )
601
602
.chunkNumber (chunkNumber )
0 commit comments