code: def get_command_changes(self, current_commands, updated_commands):
      
      commands_to_kill = {}
      commands_to_keep = {}
      commands_to_start = {}
  
      # if the current command has a matching command in the updated commands we keep it
      # otherwise we kill it
      for current_name, current_command in current_commands.items():
        # We don't restart tmaster since it watches the packing plan and updates itself. The stream
        # manager is restarted just to reset state, but we could update it to do so without a restart
        if current_name in updated_commands.keys() and \
          current_command == updated_commands[current_name] and \
          not current_name.startswith('stmgr-'):
          commands_to_keep[current_name] = current_command
        else:
          commands_to_kill[current_name] = current_command
  
      # updated commands not in the keep list need to be started
      for updated_name, updated_command in updated_commands.items():
        if updated_name not in commands_to_keep.keys():
          commands_to_start[updated_name] = updated_command
  
      return commands_to_kill, commands_to_keep, commands_to_start
docs: Compares the current command with updated command to return a 3-tuple of dicts,
      keyed by command name: commands_to_kill, commands_to_keep and commands_to_start.