@Test public void testSetKylinConfigInEnvIfMissingTakingEmptyProperties() { Properties properties = new Properties(); KylinConfig.setKylinConfigInEnvIfMissing(properties); assertEquals(0, properties.size()); assertTrue(properties.isEmpty()); KylinConfig.setKylinConfigInEnvIfMissing(properties); assertEquals(0, properties.size()); assertTrue(properties.isEmpty()); }
public static void setKylinConfigInEnvIfMissing(Properties prop) { synchronized (KylinConfig.class) { if (SYS_ENV_INSTANCE == null) { try { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(prop); logger.info("Resetting SYS_ENV_INSTANCE by a input stream: {}", System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } } }
KylinConfig extends KylinConfigBase { public static void setKylinConfigInEnvIfMissing(Properties prop) { synchronized (KylinConfig.class) { if (SYS_ENV_INSTANCE == null) { try { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(prop); logger.info("Resetting SYS_ENV_INSTANCE by a input stream: {}", System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } } } }
KylinConfig extends KylinConfigBase { public static void setKylinConfigInEnvIfMissing(Properties prop) { synchronized (KylinConfig.class) { if (SYS_ENV_INSTANCE == null) { try { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(prop); logger.info("Resetting SYS_ENV_INSTANCE by a input stream: {}", System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } } } private  KylinConfig(); protected  KylinConfig(Properties props, boolean force); }
KylinConfig extends KylinConfigBase { public static void setKylinConfigInEnvIfMissing(Properties prop) { synchronized (KylinConfig.class) { if (SYS_ENV_INSTANCE == null) { try { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(prop); logger.info("Resetting SYS_ENV_INSTANCE by a input stream: {}", System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } } } private  KylinConfig(); protected  KylinConfig(Properties props, boolean force); static File getKylinHomeAtBestEffort(); static KylinConfig getInstanceFromEnv(); static void destroyInstance(); static KylinConfig createInstanceFromUri(String uri); static Properties streamToProps(InputStream is); static void setKylinConfigInEnvIfMissing(Properties prop); static void setKylinConfigInEnvIfMissing(String propsInStr); static SetAndUnsetThreadLocalConfig setAndUnsetThreadLocalConfig(KylinConfig config); static KylinConfig createKylinConfig(String propsInStr); static KylinConfig createKylinConfig(KylinConfig another); static KylinConfig createKylinConfig(Properties prop); static File getKylinConfDir(); static void setSandboxEnvIfPossible(); T getManager(Class<T> clz); void clearManagers(); Properties exportToProperties(); String exportAllToString(); String exportToString(Collection<String> propertyKeys); void exportToFile(File file); synchronized void reloadFromSiteProperties(); KylinConfig base(); static void setKylinConfigForLocalTest(String localMetaDir); @Override int hashCode(); @Override boolean equals(Object another); }
KylinConfig extends KylinConfigBase { public static void setKylinConfigInEnvIfMissing(Properties prop) { synchronized (KylinConfig.class) { if (SYS_ENV_INSTANCE == null) { try { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(prop); logger.info("Resetting SYS_ENV_INSTANCE by a input stream: {}", System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } } } private  KylinConfig(); protected  KylinConfig(Properties props, boolean force); static File getKylinHomeAtBestEffort(); static KylinConfig getInstanceFromEnv(); static void destroyInstance(); static KylinConfig createInstanceFromUri(String uri); static Properties streamToProps(InputStream is); static void setKylinConfigInEnvIfMissing(Properties prop); static void setKylinConfigInEnvIfMissing(String propsInStr); static SetAndUnsetThreadLocalConfig setAndUnsetThreadLocalConfig(KylinConfig config); static KylinConfig createKylinConfig(String propsInStr); static KylinConfig createKylinConfig(KylinConfig another); static KylinConfig createKylinConfig(Properties prop); static File getKylinConfDir(); static void setSandboxEnvIfPossible(); T getManager(Class<T> clz); void clearManagers(); Properties exportToProperties(); String exportAllToString(); String exportToString(Collection<String> propertyKeys); void exportToFile(File file); synchronized void reloadFromSiteProperties(); KylinConfig base(); static void setKylinConfigForLocalTest(String localMetaDir); @Override int hashCode(); @Override boolean equals(Object another); static final String KYLIN_CONF_PROPERTIES_FILE; static final String KYLIN_DEFAULT_CONF_PROPERTIES_FILE; static final String KYLIN_CONF; }