public static TableOptimizations getConfiguredOptimizations ( FluoConfiguration fluoConfig ) { try ( FluoClient client = FluoFactory . newClient ( fluoConfig ) ) { SimpleConfiguration appConfig = client . getAppConfiguration ( ) ; TableOptimizations tableOptim = new TableOptimizations ( ) ; SimpleConfiguration subset = appConfig . subset ( PREFIX . substring ( 0 , PREFIX . length ( ) - 1 ) ) ; Iterator < String > keys = subset . getKeys ( ) ; while ( keys . hasNext ( ) ) { String key = keys . next ( ) ; String clazz = subset . getString ( key ) ; try { TableOptimizationsFactory factory = Class . forName ( clazz ) . asSubclass ( TableOptimizationsFactory . class ) . newInstance ( ) ; tableOptim . merge ( factory . getTableOptimizations ( key , appConfig ) ) ; } catch ( InstantiationException | IllegalAccessException | ClassNotFoundException e ) { throw new RuntimeException ( e ) ; } } return tableOptim ; } }
A utility method to get all registered table optimizations . Many recipes will automatically register table optimizations when configured .