@@ -36,21 +36,27 @@ public abstract class ApplicationResourceUsageReport {
36
36
@ Private
37
37
@ Unstable
38
38
public static ApplicationResourceUsageReport newInstance (
39
- int numUsedContainers , int numReservedContainers , Resource usedResources ,
39
+ int numUsedContainers , int numReservedContainers ,
40
+ Resource guaranteedResourcesUsed ,
40
41
Resource reservedResources , Resource neededResources ,
41
- Map <String , Long > resourceSecondsMap , float queueUsagePerc ,
42
- float clusterUsagePerc , Map <String , Long > preemtedResourceSecondsMap ) {
42
+ Map <String , Long > guaranteedResourceSecondsMap , float queueUsagePerc ,
43
+ float clusterUsagePerc , Map <String , Long > preemtedResourceSecondsMap ,
44
+ Resource opportunisticResourcesUsed ,
45
+ Map <String , Long > opportunisticResourcesSecondsMap ) {
46
+
43
47
ApplicationResourceUsageReport report =
44
48
Records .newRecord (ApplicationResourceUsageReport .class );
45
49
report .setNumUsedContainers (numUsedContainers );
46
50
report .setNumReservedContainers (numReservedContainers );
47
- report .setUsedResources ( usedResources );
51
+ report .setGuaranteedResourcesUsed ( guaranteedResourcesUsed );
48
52
report .setReservedResources (reservedResources );
49
53
report .setNeededResources (neededResources );
50
- report .setResourceSecondsMap ( resourceSecondsMap );
54
+ report .setGuaranteedResourceSecondsMap ( guaranteedResourceSecondsMap );
51
55
report .setQueueUsagePercentage (queueUsagePerc );
52
56
report .setClusterUsagePercentage (clusterUsagePerc );
53
57
report .setPreemptedResourceSecondsMap (preemtedResourceSecondsMap );
58
+ report .setOpportunisticResourcesUsed (opportunisticResourcesUsed );
59
+ report .setOpportunisticResourceSecondsMap (opportunisticResourcesSecondsMap );
54
60
return report ;
55
61
}
56
62
@@ -87,16 +93,40 @@ public static ApplicationResourceUsageReport newInstance(
87
93
public abstract void setNumReservedContainers (int num_reserved_containers );
88
94
89
95
/**
90
- * Get the used <code>Resource</code>. -1 for invalid/inaccessible reports.
91
- * @return the used <code>Resource</code>
96
+ * Get the guaranteed <code>Resource</code> used.
97
+ * -1 for invalid/inaccessible reports.
98
+ * @return the guaranteed <code>Resource</code> used
92
99
*/
93
100
@ Public
94
101
@ Stable
102
+ @ Deprecated
95
103
public abstract Resource getUsedResources ();
96
104
105
+ /**
106
+ * Get the guaranteed <code>Resource</code> used.
107
+ * -1 for invalid/inaccessible reports.
108
+ * @return the guaranteed <code>Resource</code> used
109
+ */
110
+ @ Public
111
+ @ Unstable
112
+ public abstract Resource getGuaranteedResourcesUsed ();
113
+
114
+ @ Private
115
+ @ Unstable
116
+ public abstract void setGuaranteedResourcesUsed (Resource resources );
117
+
118
+ /**
119
+ * Get the opportunistic <code>Resource</code> used.
120
+ * -1 for invalid/inaccessible reports.
121
+ * @return the opportunistic <code>Resource</code> used
122
+ */
123
+ @ Public
124
+ @ Unstable
125
+ public abstract Resource getOpportunisticResourcesUsed ();
126
+
97
127
@ Private
98
128
@ Unstable
99
- public abstract void setUsedResources (Resource resources );
129
+ public abstract void setOpportunisticResourcesUsed (Resource resources );
100
130
101
131
/**
102
132
* Get the reserved <code>Resource</code>. -1 for invalid/inaccessible reports.
@@ -123,41 +153,83 @@ public static ApplicationResourceUsageReport newInstance(
123
153
public abstract void setNeededResources (Resource needed_resources );
124
154
125
155
/**
126
- * Set the aggregated amount of memory (in megabytes) the application has
127
- * allocated times the number of seconds the application has been running.
128
- * @param memory_seconds the aggregated amount of memory seconds
156
+ * Set the aggregated amount of guaranteed memory (in megabytes) the
157
+ * application has allocated times the number of seconds the application
158
+ * has been running.
159
+ * @param memorySeconds the aggregated amount of guaranteed memory seconds
129
160
*/
130
161
@ Private
131
162
@ Unstable
132
- public abstract void setMemorySeconds (long memory_seconds );
163
+ public abstract void setGuaranteedMemorySeconds (long memorySeconds );
133
164
134
165
/**
135
- * Get the aggregated amount of memory (in megabytes) the application has
136
- * allocated times the number of seconds the application has been running.
137
- * @return the aggregated amount of memory seconds
166
+ * Get the aggregated amount of guaranteed memory (in megabytes) the
167
+ * application has allocated times the number of seconds the application
168
+ * has been running.
169
+ * @return the aggregated amount of guaranteed memory seconds
170
+ */
171
+ @ Public
172
+ @ Unstable
173
+ public abstract long getGuaranteedMemorySeconds ();
174
+
175
+ /**
176
+ * Get the aggregated amount of guaranteed memory (in megabytes) the
177
+ * application has allocated times the number of seconds the application
178
+ * has been running.
179
+ * @return the aggregated amount of guaranteed memory seconds
138
180
*/
139
181
@ Public
140
182
@ Unstable
183
+ @ Deprecated
141
184
public abstract long getMemorySeconds ();
142
185
143
186
/**
144
- * Set the aggregated number of vcores that the application has allocated
145
- * times the number of seconds the application has been running.
146
- * @param vcore_seconds the aggregated number of vcore seconds
187
+ * Set the aggregated number of guaranteed vcores that the application has
188
+ * allocated times the number of seconds the application has been running.
189
+ * @param vcoreSeconds the aggregated number of guaranteed vcore seconds
147
190
*/
148
191
@ Private
149
192
@ Unstable
150
- public abstract void setVcoreSeconds (long vcore_seconds );
193
+ public abstract void setGuaranteedVcoreSeconds (long vcoreSeconds );
151
194
152
195
/**
153
- * Get the aggregated number of vcores that the application has allocated
154
- * times the number of seconds the application has been running.
155
- * @return the aggregated number of vcore seconds
196
+ * Get the aggregated number of guaranteed vcores that the application has
197
+ * allocated times the number of seconds the application has been running.
198
+ * @return the aggregated number of guaranteed vcore seconds
199
+ */
200
+ @ Public
201
+ @ Unstable
202
+ public abstract long getGuaranteedVcoreSeconds ();
203
+
204
+ /**
205
+ * Get the aggregated number of guaranteed vcores that the application has
206
+ * allocated times the number of seconds the application has been running.
207
+ * @return the aggregated number of guaranteed vcore seconds
156
208
*/
157
209
@ Public
158
210
@ Unstable
211
+ @ Deprecated
159
212
public abstract long getVcoreSeconds ();
160
213
214
+ /**
215
+ * Get the aggregated amount of opportunistic memory (in megabytes) the
216
+ * application has allocated times the number of seconds the application
217
+ * has been running.
218
+ * @return the aggregated amount of opportunistic memory seconds
219
+ */
220
+ @ Public
221
+ @ Unstable
222
+ public abstract long getOpportunisticMemorySeconds ();
223
+
224
+ /**
225
+ * Get the aggregated number of opportunistic vcores that the application
226
+ * has allocated times the number of seconds the application has been running.
227
+ * @return the aggregated number of opportunistic vcore seconds
228
+ */
229
+ @ Public
230
+ @ Unstable
231
+ public abstract long getOpportunisticVcoreSeconds ();
232
+
161
233
/**
162
234
* Get the percentage of resources of the queue that the app is using.
163
235
* @return the percentage of resources of the queue that the app is using.
@@ -231,23 +303,35 @@ public static ApplicationResourceUsageReport newInstance(
231
303
public abstract long getPreemptedVcoreSeconds ();
232
304
233
305
/**
234
- * Get the aggregated number of resources that the application has
306
+ * Get the aggregated number of guaranteed resources that the application has
235
307
* allocated times the number of seconds the application has been running.
236
- * @return map containing the resource name and aggregated resource-seconds
308
+ * @return map containing the resource name and aggregated guaranteed
309
+ * resource-seconds
237
310
*/
238
311
@ Public
239
312
@ Unstable
313
+ @ Deprecated
240
314
public abstract Map <String , Long > getResourceSecondsMap ();
241
315
242
316
/**
243
- * Set the aggregated number of resources that the application has
317
+ * Get the aggregated number of guaranteed resources that the application has
318
+ * allocated times the number of seconds the application has been running.
319
+ * @return map containing the resource name and aggregated guaranteed
320
+ * resource-seconds
321
+ */
322
+ @ Public
323
+ @ Unstable
324
+ public abstract Map <String , Long > getGuaranteedResourceSecondsMap ();
325
+
326
+ /**
327
+ * Set the aggregated number of guaranteed resources that the application has
244
328
* allocated times the number of seconds the application has been running.
245
329
* @param resourceSecondsMap map containing the resource name and aggregated
246
- * resource-seconds
330
+ * guaranteed resource-seconds
247
331
*/
248
332
@ Private
249
333
@ Unstable
250
- public abstract void setResourceSecondsMap (
334
+ public abstract void setGuaranteedResourceSecondsMap (
251
335
Map <String , Long > resourceSecondsMap );
252
336
253
337
@@ -272,4 +356,24 @@ public abstract void setResourceSecondsMap(
272
356
public abstract void setPreemptedResourceSecondsMap (
273
357
Map <String , Long > preemptedResourceSecondsMap );
274
358
359
+ /**
360
+ * Get the aggregated number of opportunistic resources that the application
361
+ * has allocated times the number of seconds the application has been running.
362
+ * @return map containing the resource name and aggregated opportunistic
363
+ * resource-seconds
364
+ */
365
+ @ Public
366
+ @ Unstable
367
+ public abstract Map <String , Long > getOpportunisticResourceSecondsMap ();
368
+
369
+ /**
370
+ * Set the aggregated number of opportunistic resources that the application
371
+ * has allocated times the number of seconds the application has been running.
372
+ * @param opportunisticResourceSecondsMap map containing the resource name
373
+ * and aggregated opportunistic resource-seconds
374
+ */
375
+ @ Private
376
+ @ Unstable
377
+ public abstract void setOpportunisticResourceSecondsMap (
378
+ Map <String , Long > opportunisticResourceSecondsMap );
275
379
}
0 commit comments