Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public ApplicationMaster(String ignitePath, ClusterProperties props) throws Exce
@Override public synchronized void onContainersAllocated(List<Container> conts) {
for (Container c : conts) {
if (checkContainer(c)) {
log.log(Level.INFO, "Container {0} allocated", c.getId());
try {
ContainerLaunchContext ctx = Records.newRecord(ContainerLaunchContext.class);

Expand Down Expand Up @@ -175,7 +176,10 @@ public ApplicationMaster(String ignitePath, ClusterProperties props) throws Exce
}
}
else
{
log.log(Level.WARNING, "Container {0} check failed. Releasing...", c.getId());
rmClient.releaseAssignedContainer(c.getId());
}
}
}

Expand All @@ -186,17 +190,25 @@ public ApplicationMaster(String ignitePath, ClusterProperties props) throws Exce
private boolean checkContainer(Container cont) {
// Check limit on running nodes.
if (props.instances() <= containers.size())
{
log.log(Level.WARNING, "Limit on running nodes exceeded. ({0} of {1} max)",
new Object[]{containers.size(), props.instances()});
return false;
}

// Check host name
if (props.hostnameConstraint() != null
&& props.hostnameConstraint().matcher(cont.getNodeId().getHost()).matches())
{
log.log(Level.WARNING, "Wrong host name '{0}'. It didn't match to '{1}' pattern.",
new Object[]{cont.getNodeId().getHost(), props.hostnameConstraint().toString()});
return false;
}

// Check that slave satisfies min requirements.
if (cont.getResource().getVirtualCores() < props.cpusPerNode()
|| cont.getResource().getMemory() < props.totalMemoryPerNode()) {
log.log(Level.FINE, "Container resources not sufficient requirements. Host: {0}, cpu: {1}, mem: {2}",
log.log(Level.WARNING, "Container resources not sufficient requirements. Host: {0}, cpu: {1}, mem: {2}",
new Object[]{cont.getNodeId().getHost(), cont.getResource().getVirtualCores(),
cont.getResource().getMemory()});

Expand Down