Skip to content

Evenly-spread task placement - #1576

Merged
ssalinas merged 7 commits into
masterfrom
evenly-spread-task-placement
Jul 14, 2017
Merged

ssalinas merged 7 commits into
masterfrom
evenly-spread-task-placement

Conversation

@baconmania

Copy link
Copy Markdown
Contributor

No description provided.

@ssalinas ssalinas modified the milestone: 0.17.0 Jun 29, 2017
@@ -333,7 +333,8 @@ public void testFrozenSlaveCanBeDecommissioned() {

saveAndSchedule(request.toBuilder().setSlavePlacement(Optional.of(SlavePlacement.OPTIMISTIC)).setInstances(Optional.of(2)));

@ssalinas ssalinas Jul 5, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to change this to GREEDY or SEPARATE so that the frozen slave test isn't relying on calculations from optimistic


final boolean isSlaveOk = numOnSlave < numPerSlave;
// If no tasks are active for this request yet, we can fall back to greedy.
if (currentlyActiveTasksForRequestClusterwide.size() > 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to make this more explicit with a == 0 check + early return rather than having to add a comment?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so the general pattern in this method is to return only if the SlaveMatchState is determined to be something other than OK. Otherwise, flow is allowed to trickle down to that final return SlaveMatchState.OK statement.

final boolean isSlaveOk = numOnSlave <= numPerSlave;

if (!isSlaveOk) {
LOG.trace("Rejecting OPTIMISTIC task {} from slave {} ({}) due to numOnSlave {}", taskRequest.getRequest().getId(), slaveId, host, numOnSlave);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to add the other values you're using in he calculation in here for debugging purposes

@baconmania baconmania changed the title (WIP) Evenly-spread task placement Evenly-spread task placement Jul 6, 2017
@ssalinas
ssalinas merged commit 7ad28fd into master Jul 14, 2017
@ssalinas
ssalinas deleted the evenly-spread-task-placement branch July 14, 2017 19:40
@baconmania baconmania modified the milestones: 0.18.0, 0.17.0 Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants