[
https://issues.apache.org/jira/browse/AURORA-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15872045#comment-15872045
]
Mehrdad Nurolahzade commented on AURORA-1894:
---------------------------------------------
I used YourKit (default settings), can't say if this caused by profiler
bytecode manipulations for sampling or not.
However, just by looking at this logic, I am not sure if compiler can do such
optimizations. The Lambda is dependent on the method parameter ({{ITaskConfig
pendingTask}}).
{code}
private Predicate<PreemptionVictim> preemptionFilter(final ITaskConfig
pendingTask) {
return possibleVictim -> {
boolean pendingIsPreemptible =
tierManager.getTier(pendingTask).isPreemptible();
boolean victimIsPreemptible =
tierManager.getTier(possibleVictim.getConfig()).isPreemptible();
if (!pendingIsPreemptible && victimIsPreemptible) {
return true;
} else if (pendingIsPreemptible == victimIsPreemptible) {
// If preemptible flags are equal, preemption is based on priority
within the same role.
if (pendingTask.getJob().getRole().equals(possibleVictim.getRole())) {
return pendingTask.getPriority() > possibleVictim.getPriority();
} else {
return false;
}
} else {
return false;
}
};
}
{code}
> Inline preemption filter in PreemptionVictimFilterImpl
> ------------------------------------------------------
>
> Key: AURORA-1894
> URL: https://issues.apache.org/jira/browse/AURORA-1894
> Project: Aurora
> Issue Type: Task
> Components: Scheduler
> Reporter: Mehrdad Nurolahzade
> Priority: Minor
> Labels: newbie
>
> Profiling preemption logic, I can see
> {{PreemptionVictimFilterImpl#preemptionFilter()}} is producing ~200K/sec
> lambda objects to be used by {{filterPreemptionVictims()}}:
> {code:title=PreemptionVictimFilterImpl.filterPreemptionVictims()}
> FluentIterable<PreemptionVictim> preemptableTasks =
> FluentIterable.from(possibleVictims)
> .filter(preemptionFilter(pendingTask));
> {code}
> Inline this logic (refactor to loop) to remove the need to create these
> short-lived lambda objects.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)