Skip to content

Commit

Permalink
Adds docstrings to nm_dim_assigner.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pritchardn committed May 20, 2022
1 parent 627c611 commit 9b0862b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions daliuge-engine/dlg/nm_dim_assigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@


class NMAssigner:
"""
Handles the logic of assigning / removing NMs from DIMs && handling new DIMs coming on/off-line.
Maintains a leger of DIMs and NMs as name -> (server, port) mappings.
Maintains a mapping of NMs to DIMs
Allocation logic is currently very simple, handling only the case of a single DIM, but with
room for more advanced load-balancing, if we require in the future.
"""
def __init__(self):
self.DIMs = {} # Set of DIMs name -> (server, port)
self.NMs = {} # Set of NMs name -> (server, port)
Expand Down Expand Up @@ -60,4 +67,5 @@ def allocate_nms(self):
self.assignments[nm] = dim_ip
else: # We have lots of DIMs
# Will do nothing, it's up to the user/deployer to handle this.
logger.info("Multiple DIMs, handle node assignments externally.")
pass

0 comments on commit 9b0862b

Please sign in to comment.