Before this change it was possible to get the following unintuitive log line:
2017-08-08T02:49:30.956+0000 s.m.s.StormSchedulerImpl [INFO] sample-topology with requestedWorkerCpu 1.0 and requestedWorkerMem 1000 does not fit onto worker1 with resources cpus: 1.0 (dynamic: 0.0, static: 0.0, unreserved: 1.0), mem: 87671.0 (dynamic: 0.0, static: 0.0, unreserved: 87671.0), ports: [31004-31014,31024-31025,31027-32000,31003-31003]
This happens because inside the call to isFit supervisor resources are added to the request depending on the setting for supervisorExists. This means that while it may look like an offer will be a fit based on this log line (which is produced outside of the call to isFit), it may not actually be able to fit because the log line does not account for supervisor resources.
To compensate for that, this fix prints out a log line that also indicates when there is a need for a supervisor to be launched.
As confirmed by looking at the tests (but hand-hacked for consistency), the line above would print the following when there is a supervisor present:
2017-08-08T02:49:30.956+0000 s.m.s.StormSchedulerImpl [INFO] sample-topology with requestedWorkerCpu 1.0 and requestedWorkerMem 1000 does not fit onto worker1 with resources cpus: 1.0 (dynamic: 0.0, static: 0.0, unreserved: 1.0), mem: 87671.0 (dynamic: 0.0, static: 0.0, unreserved: 87671.0), ports: [31004-31014,31024-31025,31027-32000,31003-31003]
And the following when there isn't a supervisor present:
2017-08-08T02:49:30.956+0000 s.m.s.StormSchedulerImpl [INFO] sample-topology with requestedWorkerCpu 1.0 and requestedWorkerMem 1000 plus the requirements to launch a supervisor does not fit onto worker1 with resources cpus: 1.0 (dynamic: 0.0, static: 0.0, unreserved: 1.0), mem: 87671.0 (dynamic: 0.0, static: 0.0, unreserved: 87671.0), ports: [31004-31014,31024-31025,31027-32000,31003-31003]
Before this change it was possible to get the following unintuitive log line:
This happens because inside the call to
isFit
supervisor resources are added to the request depending on the setting forsupervisorExists
. This means that while it may look like an offer will be a fit based on this log line (which is produced outside of the call toisFit
), it may not actually be able to fit because the log line does not account for supervisor resources.To compensate for that, this fix prints out a log line that also indicates when there is a need for a supervisor to be launched.
As confirmed by looking at the tests (but hand-hacked for consistency), the line above would print the following when there is a supervisor present:
And the following when there isn't a supervisor present: