Ethanlm commented on a change in pull request #3213: [STORM-3588] add
GenericResourceAwareSchedulingPriorityStrategy to accommodate generic resource
in grading topologies
URL: https://github.com/apache/storm/pull/3213#discussion_r406827001
##########
File path:
storm-server/src/main/java/org/apache/storm/scheduler/resource/ResourceAwareScheduler.java
##########
@@ -196,21 +204,18 @@ private void scheduleTopology(TopologyDetails td,
Cluster cluster, final User to
} else if (result.getStatus() ==
SchedulingStatus.FAIL_NOT_ENOUGH_RESOURCES) {
LOG.debug("Not enough resources to schedule {}",
td.getName());
List<TopologyDetails> reversedList =
ImmutableList.copyOf(orderedTopologies).reverse();
- boolean evictedSomething = false;
- LOG.debug("attempting to make space for topo {} from
user {}", td.getName(), td.getTopologySubmitter());
+ LOG.debug("Attempting to make space for topo {} from
user {}", td.getName(), td.getTopologySubmitter());
int tdIndex = reversedList.indexOf(td);
topologySchedulingResources.setRemainingRequiredResources(toSchedule, td);
+ Set<String> tmpEvictedTopos = new HashSet<>();
for (int index = 0; index < tdIndex; index++) {
TopologyDetails topologyEvict =
reversedList.get(index);
SchedulerAssignment evictAssignemnt =
workingState.getAssignmentById(topologyEvict.getId());
if (evictAssignemnt != null &&
!evictAssignemnt.getSlots().isEmpty()) {
- Collection<WorkerSlot> workersToEvict =
workingState.getUsedSlotsByTopologyId(topologyEvict.getId());
topologySchedulingResources.adjustResourcesForEvictedTopology(toSchedule,
topologyEvict);
-
- LOG.debug("Evicting Topology {} with workers:
{} from user {}", topologyEvict.getName(), workersToEvict,
- topologyEvict.getTopologySubmitter());
- evictedSomething = true;
+ tmpEvictedTopos.add(topologyEvict.getId());
Review comment:
`tmpEvictedTopos` is a set of evictedTopologies in every attempt.
It might evict multiple topologies in maxSchedulingAttempts.
So the current evictedTopologiesMap is just a subset.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services