#NEWLINE# def _build_replica_plan( self ) : #NEWLINE# #INDENT# '\n        Wraps return value of _build_target_replicas_by_tier to include\n        pre-calculated min and max values for each tier.\n\n        :returns: a dict, mapping <tier> => <replica_plan>, where\n                  <replica_plan> is itself a dict\n\n        <replica_plan> include at least the following keys:\n\n            min - the minimum number of replicas at the tier\n            target - the target replicanths at the tier\n            max - the maximum number of replicas at the tier\n        ' #NEWLINE# target_replicas = self . _build_target_replicas_by_tier ( ) #NEWLINE# replica_plan = defaultdict ( ( lambda : { #NEWLINE# #INDENT# 'min' : 0 , #NEWLINE# 'target' : 0 , #NEWLINE# 'max' : 0 , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# replica_plan . update ( { t : { #NEWLINE# #INDENT# 'min' : math . floor ( ( r + 1e-10 ) ) , #NEWLINE# 'target' : r , #NEWLINE# 'max' : math . ceil ( ( r - 1e-10 ) ) , #NEWLINE# #UNINDENT# } for ( t , r ) in target_replicas . items ( ) } ) #NEWLINE# return replica_plan