package Ġcom . github . ker ub istan . ker ub . planner . steps . base Ċ Ċ import Ġcom . github . ker ub istan . ker ub . model . collection . Virtual Storage Data Collection Ċ import Ġcom . github . ker ub istan . ker ub . model . dynamic . Host Status Ċ import Ġcom . github . ker ub istan . ker ub . model . dynamic . Virtual Storage Allocation Ċ import Ġcom . github . ker ub istan . ker ub . planner . Operation al State Ċ import Ġcom . github . ker ub istan . ker ub . planner . steps . Abstract Operation al Step Factory Ċ import Ġio . github . ker ub istan . k ro ki . collections . concat Ċ import Ġkotlin . reflect . K Class Ċ Ċ abstract Ġclass ĠAbstract Un Allocate Factory < T Ġ: ĠAbstract Un Allocate < S >, ĠS Ġ: ĠVirtual Storage Allocation > Ġ: Ċĉ ĉ Abstract Operation al Step Factory < T >() Ġ{ ĊĊ ĉ final Ġoverride Ġfun Ġproduce ( state : ĠOperation al State ): ĠList < T > Ġ= Ċĉĉ ĉ state . v Storage . values . filter Ġ{ Ġit . stat . re cycl ing Ġ|| Ġhas Over Allocation ( it ) Ġ}. map NotNull Ġ{ Ġcoll Ġ-> Ċĉĉĉ ĉ coll . dynamic ?. alloc ations ?. map Ġ{ Ċĉĉĉĉ ĉ if Ġ( type . is Instance ( it ) Ġ&& Ġ( state . hosts [ it . host Id ]?. dynamic ?. status Ġ== ĠHost Status . Up )) Ġ{ Ċĉĉĉĉĉ ĉ un Allocate ( it Ġas ĠS , Ġcoll , Ġstate ) Ċĉĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉĉ ĉ null Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ }. concat (). filter NotNull () ĊĊ ĉ private Ġfun Ġhas Over Allocation ( it : ĠVirtual Storage Data Collection ) Ġ= Ċĉĉ ĉ it . stat . readOnly Ġ&& Ġit . dynamic ?. alloc ations ?. size Ġ?: Ġ 0 Ġ> Ġ 1 ĊĊ ĉ abstract Ġfun Ġun Allocate ( allocation : ĠS , Ġv Storage : ĠVirtual Storage Data Collection , Ġstate : ĠOperation al State ): ĠT ĊĊ ĉ abstract Ġval Ġtype : ĠK Class < S > Ċ Ċ }