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()); }
@Test(expected = IllegalArgumentException.class) public void testException() { sw.get(0); } }
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()); }