You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/09/20 06:31:34 UTC
[GitHub] jerrypeng commented on a change in pull request #2613: Avoid
scheduling heartbeat function if owner-worker not available
jerrypeng commented on a change in pull request #2613: Avoid scheduling heartbeat function if owner-worker not available
URL: https://github.com/apache/incubator-pulsar/pull/2613#discussion_r219048080
##########
File path: pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/scheduler/RoundRobinScheduler.java
##########
@@ -52,6 +52,10 @@
List<Assignment> newAssignments = Lists.newArrayList();
for (Instance unassignedFunctionInstance : unassignedFunctionInstances) {
String heartBeatWorkerId = checkHeartBeatFunction(unassignedFunctionInstance);
+ if (heartBeatWorkerId != null && workerIdToAssignment.get(heartBeatWorkerId) == null) {
Review comment:
I would suggest moving the logic of the heartbeat function outside of the abstraction of the scheduler. The scheduler is just suppose to assign instances to workers based on some strategy while the heartbeat function scheduling strategy will always be the same. In the future, if we don't move this logic out and we want to add alternative scheduling strategies, every scheduling strategy will need this logic. I would suggest moving this logic into the SchedulerManager and just assign it appropriately there.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services