public static void createMasters ( MasterRegistry registry , MasterContext context ) { List < Callable < Void >> callables = new ArrayList <> ( ) ; for ( final MasterFactory factory : alluxio . master . ServiceUtils . getMasterServiceLoader ( ) ) { callables . add ( ( ) -> { if ( factory . isEnabled ( ) ) { factory . create ( registry , context ) ; } return null ; } ) ; } try { CommonUtils . invokeAll ( callables , 10 * Constants . MINUTE_MS ) ; } catch ( Exception e ) { throw new RuntimeException ( "Failed to start masters" , e ) ; } }
Creates all the masters and registers them to the master registry .