Created
March 23, 2015 16:27
-
-
Save shrijeet/f999a4387536c07d5b79 to your computer and use it in GitHub Desktop.
Only one of local, rack or any is satisfied
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (rackLocalRequest != null && rackLocalRequest.getNumContainers() != 0 | |
&& localRequest != null && localRequest.getNumContainers() != 0) { | |
return assignContainer(node, localRequest, | |
NodeType.NODE_LOCAL, reserved); | |
} | |
if (rackLocalRequest != null && !rackLocalRequest.getRelaxLocality()) { | |
continue; | |
} | |
if (rackLocalRequest != null && rackLocalRequest.getNumContainers() != 0 | |
&& (allowedLocality.equals(NodeType.RACK_LOCAL) || | |
allowedLocality.equals(NodeType.OFF_SWITCH))) { | |
return assignContainer(node, rackLocalRequest, | |
NodeType.RACK_LOCAL, reserved); | |
} | |
ResourceRequest offSwitchRequest = app.getResourceRequest(priority, | |
ResourceRequest.ANY); | |
if (offSwitchRequest != null && !offSwitchRequest.getRelaxLocality()) { | |
continue; | |
} | |
if (offSwitchRequest != null && offSwitchRequest.getNumContainers() != 0 | |
&& allowedLocality.equals(NodeType.OFF_SWITCH)) { | |
return assignContainer(node, offSwitchRequest, | |
NodeType.OFF_SWITCH, reserved); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment