File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/java/com/netflix/ice/processor Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 27
27
import java .io .DataInput ;
28
28
import java .io .DataOutput ;
29
29
import java .io .IOException ;
30
+ import java .util .HashMap ;
30
31
import java .util .Map ;
31
32
import java .util .TreeMap ;
32
33
import java .util .concurrent .ConcurrentSkipListMap ;
@@ -234,9 +235,20 @@ public static enum ReservationUtilization {
234
235
HEAVY ,
235
236
FIXED ;
236
237
238
+ static final Map <String , String > reservationTypeMap = new HashMap <String , String >();
239
+ static {
240
+ reservationTypeMap .put ("ALL" , "HEAVY" );
241
+ reservationTypeMap .put ("PARTIAL" , "MEDIUM" );
242
+ reservationTypeMap .put ("NO" , "LIGHT" );
243
+ }
244
+
237
245
public static ReservationUtilization get (String offeringType ) {
238
- if (offeringType .indexOf (" " ) > 0 ) {
239
- offeringType = offeringType .substring (0 , offeringType .indexOf (" " )).toUpperCase ();
246
+ int idx = offeringType .indexOf (" " );
247
+ if (idx > 0 ) {
248
+ offeringType = offeringType .substring (0 , idx ).toUpperCase ();
249
+ String mappedValue = reservationTypeMap .get (offeringType );
250
+ if (mappedValue != null )
251
+ offeringType = mappedValue ;
240
252
return valueOf (offeringType );
241
253
}
242
254
else {
You can’t perform that action at this time.
0 commit comments