#NEWLINE# def collect_placement( self , it , app ) : #NEWLINE# #INDENT# _log . analyze ( self . _node . id , '+ BEGIN' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , tb = True ) #NEWLINE# if app . _collect_placement_cb : #NEWLINE# #INDENT# app . _collect_placement_cb . cancel ( ) #NEWLINE# app . _collect_placement_cb = None #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# _log . analyze ( self . _node . id , '+ ITER' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# actor_node_id = it . next ( ) #NEWLINE# app . _collect_placement_last_value = app . _collect_placement_counter #NEWLINE# app . actor_placement . setdefault ( actor_node_id [ 0 ] , set ( [ ] ) ) . add ( actor_node_id [ 1 ] ) #NEWLINE# #UNINDENT# #UNINDENT# except dynops . PauseIteration : #NEWLINE# #INDENT# _log . analyze ( self . _node . id , '+ PAUSED' , { #NEWLINE# #INDENT# 'counter' : app . _collect_placement_counter , #NEWLINE# 'last_value' : app . _collect_placement_last_value , #NEWLINE# 'diff' : ( app . _collect_placement_counter - app . _collect_placement_last_value ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# delay = ( 0.0 if ( app . _collect_placement_counter > ( app . _collect_placement_last_value + 100 ) ) else 0.2 ) #NEWLINE# app . _collect_placement_counter += 1 #NEWLINE# app . _collect_placement_cb = async . DelayedCall ( delay , self . collect_placement , it = it , app = app ) #NEWLINE# return #NEWLINE# #UNINDENT# except StopIteration : #NEWLINE# #INDENT# if ( not app . done_final ) : #NEWLINE# #INDENT# app . done_final = True #NEWLINE# _log . analyze ( self . _node . id , '+ ALL' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . _app_requirements ( app ) #NEWLINE# _log . analyze ( self . _node . id , '+ END' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# _log . exception ( 'appmanager:collect_placement' )