|
@@ -241,6 +241,7 @@ public class FairSchedulerConfiguration extends Configuration {
|
|
|
public static Resource parseResourceConfigValue(String val)
|
|
|
throws AllocationConfigurationException {
|
|
|
try {
|
|
|
+ val = val.toLowerCase();
|
|
|
int memory = findResource(val, "mb");
|
|
|
int vcores = findResource(val, "vcores");
|
|
|
return BuilderUtils.newResource(memory, vcores);
|
|
@@ -258,7 +259,7 @@ public class FairSchedulerConfiguration extends Configuration {
|
|
|
|
|
|
private static int findResource(String val, String units)
|
|
|
throws AllocationConfigurationException {
|
|
|
- Pattern pattern = Pattern.compile("(\\d+) ?" + units);
|
|
|
+ Pattern pattern = Pattern.compile("(\\d+)\\s*" + units);
|
|
|
Matcher matcher = pattern.matcher(val);
|
|
|
if (!matcher.find()) {
|
|
|
throw new AllocationConfigurationException("Missing resource: " + units);
|