}
/**
- * Assign to nextWorkerNodeKey property the chosen worker node key.
+ * Check the next worker node eligibility.
*
* @param chosenWorkerNodeKey - The chosen worker node key.
*/
- protected assignChosenWorkerNodeKey (
- chosenWorkerNodeKey: number | undefined
- ): void {
- if (chosenWorkerNodeKey != null) {
- this.nextWorkerNodeKey = chosenWorkerNodeKey
- } else {
- this.nextWorkerNodeKey = undefined
- }
- }
-
protected checkNextWorkerNodeEligibility (
chosenWorkerNodeKey: number | undefined
): void {
/** @inheritDoc */
public choose (): number | undefined {
- const chosenWorkerNodeKey = this.fairShareNextWorkerNodeKey()
- this.assignChosenWorkerNodeKey(chosenWorkerNodeKey)
+ this.nextWorkerNodeKey = this.fairShareNextWorkerNodeKey()
return this.nextWorkerNodeKey
}
/** @inheritDoc */
public choose (): number | undefined {
- const chosenWorkerNodeKey = this.leastBusyNextWorkerNodeKey()
- this.assignChosenWorkerNodeKey(chosenWorkerNodeKey)
+ this.nextWorkerNodeKey = this.leastBusyNextWorkerNodeKey()
return this.nextWorkerNodeKey
}
/** @inheritDoc */
public choose (): number | undefined {
- const chosenWorkerNodeKey = this.leastEluNextWorkerNodeKey()
- this.assignChosenWorkerNodeKey(chosenWorkerNodeKey)
+ this.nextWorkerNodeKey = this.leastEluNextWorkerNodeKey()
return this.nextWorkerNodeKey
}
/** @inheritDoc */
public choose (): number | undefined {
- const chosenWorkerNodeKey = this.leastUsedNextWorkerNodeKey()
- this.assignChosenWorkerNodeKey(chosenWorkerNodeKey)
+ this.nextWorkerNodeKey = this.leastUsedNextWorkerNodeKey()
return this.nextWorkerNodeKey
}