public static Scheduler scheduler(int schedulerType) { ImplementationSwitch<Scheduler> current = schedulers.get(); if (current == null) { current = new ImplementationSwitch<>(KylinConfig.getInstanceFromEnv().getSchedulers(), Scheduler.class); schedulers.set(current); } return current.get(schedulerType); }
public static IStorage storage(IStorageAware aware) { ImplementationSwitch<IStorage> current = storages.get(); if (storages.get() == null) { current = new ImplementationSwitch<>(KylinConfig.getInstanceFromEnv().getStorageEngines(), IStorage.class); storages.set(current); } return current.get(aware.getStorageType()); }
public ImplementationSwitchTest() { Map<Integer, String> impls = new HashMap<>(); impls.put(0, "non.exist.class"); impls.put(1, Impl1.class.getName()); impls.put(2, Impl2.class.getName()); sw = new ImplementationSwitch<I>(impls, I.class); }
public static IBatchCubingEngine batchEngine(IEngineAware aware) { ImplementationSwitch<IBatchCubingEngine> current = engines.get(); if (current == null) { current = new ImplementationSwitch<>(KylinConfig.getInstanceFromEnv().getJobEngines(), IBatchCubingEngine.class); engines.set(current); } return current.get(aware.getEngineType()); }
public static Scheduler scheduler(int schedulerType) { ImplementationSwitch<Scheduler> current = schedulers.get(); if (current == null) { current = new ImplementationSwitch<>(KylinConfig.getInstanceFromEnv().getSchedulers(), Scheduler.class); schedulers.set(current); } return current.get(schedulerType); }
public static IStorage storage(IStorageAware aware) { ImplementationSwitch<IStorage> current = storages.get(); if (storages.get() == null) { current = new ImplementationSwitch<>(KylinConfig.getInstanceFromEnv().getStorageEngines(), IStorage.class); storages.set(current); } return current.get(aware.getStorageType()); }
public static IBatchCubingEngine batchEngine(IEngineAware aware) { ImplementationSwitch<IBatchCubingEngine> current = engines.get(); if (current == null) { current = new ImplementationSwitch<>(KylinConfig.getInstanceFromEnv().getJobEngines(), IBatchCubingEngine.class); engines.set(current); } return current.get(aware.getEngineType()); }